Skip to content

Commit bf8eb6f

Browse files
fweigdavidrohr
authored andcommitted
OpenCL: Propagate number of host threads to PoCL runtime.
1 parent 4cfc7e4 commit bf8eb6f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ int32_t GPUReconstructionOCL::GPUChkErrInternal(const int64_t error, const char*
6363

6464
int32_t GPUReconstructionOCL::InitDevice_Runtime()
6565
{
66+
// Propagate processing settings to PoCL runtime.
67+
// Won't affect other OpenCL runtimes.
68+
if (int nThreads = mProcessingSettings->nHostThreads; nThreads > 0) {
69+
auto nThreadsStr = std::to_string(nThreads);
70+
setenv("POCL_CPU_MAX_CU_COUNT", nThreadsStr.c_str(), 1);
71+
}
72+
6673
if (mMaster == nullptr) {
6774
cl_int ocl_error;
6875
cl_uint num_platforms;

0 commit comments

Comments
 (0)