diff options
author | Gard Spreemann <gspr@nonempty.org> | 2023-06-08 11:52:00 +0200 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2023-06-08 11:52:00 +0200 |
commit | 63870a2e60c1bc8bfa7e3672457b551a8e51ffaf (patch) | |
tree | fe2c0cd5f62e3fbd17e58d3903ec6bb37983f620 /src/utilities/compile.cpp | |
parent | d31fb141cb597aaf405674621aa25f263aa375e1 (diff) | |
parent | b0b302889cc786907efb080c4e1beea30d2fa39f (diff) |
Merge tag '1.6.0' into gspr/post-bookworm
Diffstat (limited to 'src/utilities/compile.cpp')
-rw-r--r-- | src/utilities/compile.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/utilities/compile.cpp b/src/utilities/compile.cpp index aeb7a3e2..59aa6107 100644 --- a/src/utilities/compile.cpp +++ b/src/utilities/compile.cpp @@ -37,13 +37,13 @@ std::shared_ptr<Program> CompileFromSource( // Not all OpenCL compilers support the 'inline' keyword. The keyword is only used for devices on // which it is known to work with all OpenCL platforms. - if (device.IsNVIDIA() || device.IsARM()) { + if (device.IsNVIDIA() || device.IsARM() || device.IsQualcomm()) { header_string += "#define USE_INLINE_KEYWORD 1\n"; } // For specific devices, use the non-IEE754 compliant OpenCL mad() instruction. This can improve // performance, but might result in a reduced accuracy. - if (device.IsAMD() && device.IsGPU()) { + if ((device.IsAMD() && device.IsGPU()) || (device.IsQualcomm() && device.IsGPU())) { header_string += "#define USE_CL_MAD 1\n"; } @@ -54,7 +54,7 @@ std::shared_ptr<Program> CompileFromSource( // For specific devices add a global synchronisation barrier to the GEMM kernel to optimize // performance through better cache behaviour - if (device.IsARM() && device.IsGPU()) { + if ((device.IsARM() && device.IsGPU()) || (device.IsQualcomm() && device.IsGPU())) { header_string += "#define GLOBAL_MEM_FENCE 1\n"; } @@ -77,6 +77,12 @@ std::shared_ptr<Program> CompileFromSource( header_string += "#define SUBGROUP_SHUFFLING_NVIDIA_PRE_VOLTA 1\n"; } } + + // For Qualcomm devices, specifying the OpenCL kernel attribute reqd_work_group_size reduces performance. + // This option compiles without the workgroup size requirement and does not affect correctness. + if (device.IsQualcomm()) { + header_string += "#define RELAX_WORKGROUP_SIZE 1\n"; + } // Optionally adds a translation header from OpenCL kernels to CUDA kernels #ifdef CUDA_API |