Skip to content

Commit 10cd3af

Browse files
committed
GPU: Fix CUDA/HIP API incompatibility with new ROCm
1 parent 7f4b3dd commit 10cd3af

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,11 @@ void GPUReconstructionCUDA::PrintKernelOccupancies()
594594
int32_t maxBlocks = 0, threads = 0, suggestedBlocks = 0, nRegs = 0, sMem = 0;
595595
GPUChkErr(cudaSetDevice(mDeviceId));
596596
for (uint32_t i = 0; i < mInternals->kernelFunctions.size(); i++) {
597-
GPUChkErr(cuOccupancyMaxPotentialBlockSize(&suggestedBlocks, &threads, *mInternals->kernelFunctions[i], 0, 0, 0)); // NOLINT: failure in clang-tidy
597+
#if !defined(__HIPCC__) || (defined(__clang_major__) && __clang_major__ < 23) // CUDA
598+
GPUChkErr(cuOccupancyMaxPotentialBlockSize(&suggestedBlocks, &threads, *mInternals->kernelFunctions[i], 0, 0, 0));
599+
#else
600+
GPUChkErr(cuOccupancyMaxPotentialBlockSize(&suggestedBlocks, &threads, *mInternals->kernelFunctions[i], 0, 0));
601+
#endif
598602
GPUChkErr(cuOccupancyMaxActiveBlocksPerMultiprocessor(&maxBlocks, *mInternals->kernelFunctions[i], threads, 0));
599603
GPUChkErr(cuFuncGetAttribute(&nRegs, CU_FUNC_ATTRIBUTE_NUM_REGS, *mInternals->kernelFunctions[i]));
600604
GPUChkErr(cuFuncGetAttribute(&sMem, CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, *mInternals->kernelFunctions[i]));

0 commit comments

Comments
 (0)