Skip to content

Commit

Permalink
GPU: Throw an error if attempting to create GPUReconstruction with DE…
Browse files Browse the repository at this point in the history
…BUG_STREAMER enabled, instead of simply segfaulting
  • Loading branch information
davidrohr committed Feb 15, 2023
1 parent 976334a commit b7abcff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions GPU/GPUTracking/Base/GPUReconstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,12 @@ GPUReconstruction* GPUReconstruction::CreateInstance(const GPUSettingsDeviceBack
{
GPUReconstruction* retVal = nullptr;
unsigned int type = cfg.deviceType;
#ifdef DEBUG_STREAMER
if (type != DeviceType::CPU) {
GPUError("Cannot create GPUReconstruction for a non-CPU device if DEBUG_STREAMER are enabled");
return nullptr;
}
#endif
if (type == DeviceType::CPU) {
retVal = GPUReconstruction_Create_CPU(cfg);
} else if (type == DeviceType::CUDA) {
Expand Down

0 comments on commit b7abcff

Please sign in to comment.