Skip to content

Commit

Permalink
CudaSift: switch to SIFT CPU if no cuda devices were found (instead o…
Browse files Browse the repository at this point in the history
…f asserting).
  • Loading branch information
matlabbe committed Nov 12, 2024
1 parent 75ac722 commit fd27380
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions corelib/src/Features2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,17 @@ void SIFT::parseParameters(const ParametersMap & parameters)
if(gpu_)
{
#ifdef RTABMAP_CUDASIFT
UDEBUG("Init SiftData");
if(cudaSiftData_ == 0) {
cudaSiftData_ = new SiftData();
InitSiftData(*cudaSiftData_, 8192, true, true);
// Check if there is a cuda device
if(InitCuda(0, ULogger::level() == ULogger::kDebug)) {
UDEBUG("Init SiftData");
if(cudaSiftData_ == 0) {
cudaSiftData_ = new SiftData();
InitSiftData(*cudaSiftData_, 8192, true, true);
}
}
else{
UWARN("No cuda device(s) detected, CudaSift is not available! Using SIFT CPU version instead.");
gpu_ = false;
}
#else
UWARN("RTAB-Map is not built with CudaSift so %s cannot be used!", Parameters::kSIFTGpu().c_str());
Expand Down

0 comments on commit fd27380

Please sign in to comment.