Skip to content

Commit 88c1e45

Browse files
committed
GPU Standalone Benchmark: Apply forceGPUType only if GPU was requested
1 parent 6c54a70 commit 88c1e45

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ EndConfig()
462462

463463
// Settings for the standalone benchmark
464464
BeginConfig(GPUSettingsStandalone, configStandalone)
465-
AddOption(runGPU, bool, true, "", 'g', "Use GPU for processing", message("GPU processing: %s"))
466-
AddOptionSet(runGPU, bool, false, "", 'c', "Use CPU for processing", message("CPU enabled"))
465+
AddOption(runGPU, uint8_t, 1, "", 'g', "Use GPU for processing", message("GPU processing enabled"), set(2))
466+
AddOptionSet(runGPU, uint8_t, 0, "", 'c', "Use CPU for processing", message("CPU enabled"))
467467
AddOption(gpuType, std::string, "AUTO", "", 0, "GPU type (CUDA / HIP / OCL / OCL2) or CPU or AUTO")
468468
AddOption(runGPUforce, bool, true, "", 0, "Force usage of the specified GPU device type, no CPU fallback")
469469
AddOption(noprompt, bool, true, "", 0, "Do prompt for keypress before exiting")

GPU/GPUTracking/Standalone/Benchmark/standalone.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ int32_t ReadConfiguration(int argc, char** argv)
268268
} else if (GPUReconstruction::CheckInstanceAvailable(GPUReconstruction::DeviceType::OCL, configStandalone.proc.debugLevel >= 2)) {
269269
configStandalone.gpuType = "OCL";
270270
} else {
271-
if (configStandalone.runGPUforce) {
271+
if (configStandalone.runGPU > 1 && configStandalone.runGPUforce) {
272272
printf("No GPU backend / device found, running on CPU is disabled due to runGPUforce\n");
273273
return 1;
274274
}

0 commit comments

Comments
 (0)