From bfa572a7a932f6453e2e2786361593f9a027e687 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Thu, 26 Oct 2023 00:17:50 +0200 Subject: [PATCH] GPU: Don't apply OCL compile flags when reading SPIR-V IL code --- GPU/GPUTracking/Base/opencl-common/GPUReconstructionOCL.cxx | 5 ++++- GPU/GPUTracking/Base/opencl2/GPUReconstructionOCL2.cxx | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GPU/GPUTracking/Base/opencl-common/GPUReconstructionOCL.cxx b/GPU/GPUTracking/Base/opencl-common/GPUReconstructionOCL.cxx index 537aa64b21a25..fc3a97cc03d2e 100644 --- a/GPU/GPUTracking/Base/opencl-common/GPUReconstructionOCL.cxx +++ b/GPU/GPUTracking/Base/opencl-common/GPUReconstructionOCL.cxx @@ -118,9 +118,12 @@ int GPUReconstructionOCL::InitDevice_Runtime() if (mProcessingSettings.debugLevel >= 2) { GPUInfo("Available Platform %d: (%s %s) %s %s", i_platform, platform_profile, platform_version, platform_vendor, platform_name); } - if (CheckPlatform(i_platform)) { + if (!found && CheckPlatform(i_platform)) { found = true; mInternals->platform = mInternals->platforms[i_platform]; + if (mProcessingSettings.debugLevel >= 2) { + GPUInfo(" Using this platform"); + } } } } diff --git a/GPU/GPUTracking/Base/opencl2/GPUReconstructionOCL2.cxx b/GPU/GPUTracking/Base/opencl2/GPUReconstructionOCL2.cxx index 00df5928d5c58..ca36bd62cd2ef 100644 --- a/GPU/GPUTracking/Base/opencl2/GPUReconstructionOCL2.cxx +++ b/GPU/GPUTracking/Base/opencl2/GPUReconstructionOCL2.cxx @@ -65,9 +65,10 @@ int GPUReconstructionOCL2Backend::GetOCLPrograms() #ifdef OPENCL2_ENABLED_SPIRV // clang-format off if (ver >= 2.2) { mInternals->program = clCreateProgramWithIL(mInternals->context, _binary_GPUReconstructionOCL2Code_spirv_start, _binary_GPUReconstructionOCL2Code_spirv_len, &ocl_error); +#undef OCL_FLAGS +#define OCL_FLAGS } else #endif // clang-format on - { size_t program_sizes[1] = {_binary_GPUReconstructionOCL2Code_src_len}; char* programs_sources[1] = {_binary_GPUReconstructionOCL2Code_src_start};