Skip to content

Commit ad2098c

Browse files
committed
GPU: Rename misleading variable
1 parent 6d863f4 commit ad2098c

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

GPU/GPUTracking/Base/GPUReconstructionCPU.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ int32_t GPUReconstructionCPU::InitDevice()
194194
ClearAllocatedMemory();
195195
}
196196
if (GetProcessingSettings().inKernelParallel) {
197-
mBlockCount = mMaxHostThreads;
197+
mMultiprocessorCount = mMaxHostThreads;
198198
}
199199
mProcShadow.mProcessorsProc = processors();
200200
return 0;

GPU/GPUTracking/Base/GPUReconstructionCPU.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class GPUReconstructionCPU : public GPUReconstructionProcessing::KernelInterface
9494
GPUProcessorProcessors mProcShadow; // Host copy of tracker objects that will be used on the GPU
9595
GPUConstantMem*& mProcessorsShadow = mProcShadow.mProcessorsProc;
9696

97-
uint32_t mBlockCount = 1;
97+
uint32_t mMultiprocessorCount = 1;
9898
uint32_t mThreadCount = 1;
9999
uint32_t mWarpSize = 1;
100100

GPU/GPUTracking/Base/GPUReconstructionCPUKernels.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ inline void GPUReconstructionCPU::runKernelInterface(krnlSetup&& setup, Args con
3636
const uint32_t stream = setup.x.stream;
3737
auto prop = getKernelProperties<S, I>();
3838
const int32_t autoThreads = cpuFallback ? 1 : prop.nThreads;
39-
const int32_t autoBlocks = cpuFallback ? 1 : (prop.forceBlocks ? prop.forceBlocks : (prop.minBlocks * mBlockCount));
39+
const int32_t autoBlocks = cpuFallback ? 1 : (prop.forceBlocks ? prop.forceBlocks : (prop.minBlocks * mMultiprocessorCount));
4040
if (nBlocks == (uint32_t)-1) {
4141
nBlocks = (nThreads + autoThreads - 1) / autoThreads;
4242
nThreads = autoThreads;

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
247247
throw std::runtime_error("Invalid warp size on GPU");
248248
}
249249
mWarpSize = deviceProp.warpSize;
250-
mBlockCount = deviceProp.multiProcessorCount;
251-
mMaxBackendThreads = std::max<int32_t>(mMaxBackendThreads, deviceProp.maxThreadsPerBlock * mBlockCount);
250+
mMultiprocessorCount = deviceProp.multiProcessorCount;
251+
mMaxBackendThreads = std::max<int32_t>(mMaxBackendThreads, deviceProp.maxThreadsPerBlock * mMultiprocessorCount);
252252
mDeviceName = deviceProp.name;
253253
mDeviceName += " (CUDA GPU)";
254254

@@ -329,9 +329,9 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
329329
}
330330

331331
#ifndef __HIPCC__ // CUDA
332-
dummyInitKernel<<<mBlockCount, 256>>>(mDeviceMemoryBase);
332+
dummyInitKernel<<<mMultiprocessorCount, 256>>>(mDeviceMemoryBase); // TODO: Can't we just use the CUDA version and hipify will take care of the rest?
333333
#else // HIP
334-
hipLaunchKernelGGL(HIP_KERNEL_NAME(dummyInitKernel), dim3(mBlockCount), dim3(256), 0, 0, mDeviceMemoryBase);
334+
hipLaunchKernelGGL(HIP_KERNEL_NAME(dummyInitKernel), dim3(mMultiprocessorCount), dim3(256), 0, 0, mDeviceMemoryBase);
335335
#endif
336336

337337
if (GetProcessingSettings().rtc.enable) {
@@ -373,7 +373,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
373373
} else {
374374
GPUReconstructionCUDA* master = dynamic_cast<GPUReconstructionCUDA*>(mMaster);
375375
mDeviceId = master->mDeviceId;
376-
mBlockCount = master->mBlockCount;
376+
mMultiprocessorCount = master->mMultiprocessorCount;
377377
mWarpSize = master->mWarpSize;
378378
mMaxBackendThreads = master->mMaxBackendThreads;
379379
mDeviceName = master->mDeviceName;

GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ int32_t GPUReconstructionOCL::InitDevice_Runtime()
266266

267267
mDeviceName = device_name.c_str();
268268
mDeviceName += " (OpenCL)";
269-
mBlockCount = device_shaders;
269+
mMultiprocessorCount = device_shaders;
270270
mWarpSize = 32;
271-
mMaxBackendThreads = std::max<int32_t>(mMaxBackendThreads, deviceMaxWorkGroup * mBlockCount);
271+
mMaxBackendThreads = std::max<int32_t>(mMaxBackendThreads, deviceMaxWorkGroup * mMultiprocessorCount);
272272

273273
mInternals->context = clCreateContext(nullptr, 1, &mInternals->device, nullptr, nullptr, &ocl_error);
274274
if (GPUChkErrI(ocl_error)) {
@@ -378,7 +378,7 @@ int32_t GPUReconstructionOCL::InitDevice_Runtime()
378378
GPUInfo("OPENCL Initialisation successfull (%d: %s %s (Frequency %d, Shaders %d), %ld / %ld bytes host / global memory, Stack frame %d, Constant memory %ld)", bestDevice, device_vendor, device_name, (int32_t)device_freq, (int32_t)device_shaders, (int64_t)mDeviceMemorySize, (int64_t)mHostMemorySize, -1, (int64_t)gGPUConstantMemBufferSize);
379379
} else {
380380
GPUReconstructionOCL* master = dynamic_cast<GPUReconstructionOCL*>(mMaster);
381-
mBlockCount = master->mBlockCount;
381+
mMultiprocessorCount = master->mMultiprocessorCount;
382382
mWarpSize = master->mWarpSize;
383383
mMaxBackendThreads = master->mMaxBackendThreads;
384384
mDeviceName = master->mDeviceName;

GPU/GPUTracking/Global/GPUChain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class GPUChain
210210
krnlExec GetGridAuto(int32_t stream, GPUReconstruction::krnlDeviceType d = GPUReconstruction::krnlDeviceType::Auto, GPUDataTypes::RecoStep st = GPUDataTypes::RecoStep::NoRecoStep);
211211
krnlExec GetGridAutoStep(int32_t stream, GPUDataTypes::RecoStep st = GPUDataTypes::RecoStep::NoRecoStep);
212212

213-
inline uint32_t BlockCount() const { return mRec->mBlockCount; }
213+
inline uint32_t BlockCount() const { return mRec->mMultiprocessorCount; }
214214
inline uint32_t WarpSize() const { return mRec->mWarpSize; }
215215
inline uint32_t ThreadCount() const { return mRec->mThreadCount; }
216216

0 commit comments

Comments
 (0)