Fix occupancy calculations API on NVCC (#1941)
NVCC warned if you tried to use hipOccupancyMaxActiveBlocksPerMultiprocessor
because when passing in a device function pointer, "const void* func" was
insufficient to describe it accurately. Adding a C++ templated class type
definition for this function.
[ROCm/hip commit: 4128d68ed7]
This commit is contained in:
@@ -1708,6 +1708,17 @@ inline static hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams*
|
||||
|
||||
#ifdef __CUDACC__
|
||||
|
||||
template<class T>
|
||||
inline static hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks,
|
||||
T func,
|
||||
int blockSize,
|
||||
size_t dynamicSMemSize) {
|
||||
cudaError_t cerror;
|
||||
cerror =
|
||||
cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize);
|
||||
return hipCUDAErrorTohipError(cerror);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline static hipError_t hipOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, T func,
|
||||
size_t dynamicSMemSize = 0,
|
||||
|
||||
مرجع در شماره جدید
Block a user