P4 to Git Change 2021608 by michliao@hliao-dev-00-hip.rocm-workspace on 2019/10/30 01:13:58
SWDEV-145570 - [HIP] Fix occupancy API prototype.
- They need to be C API, i.e. extern "C".
- Follow the current API and use `uint32_t` instead of `int`.
+ TODO: We need to revert them back once that APIs are changed to be
compatible with CUDA.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#46 edit
[ROCm/hip commit: a0f8995e3a]
Αυτή η υποβολή περιλαμβάνεται σε:
@@ -615,21 +615,31 @@ hipError_t ihipOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks,
|
extern "C" {
|
||||||
|
// FIXME: Need to replace `uint32_t` with `int` finally.
|
||||||
|
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(uint32_t* numBlocks,
|
||||||
hipFunction_t f,
|
hipFunction_t f,
|
||||||
int blockSize,
|
uint32_t blockSize,
|
||||||
size_t dynamicSMemSize)
|
size_t dynamicSMemSize)
|
||||||
{
|
{
|
||||||
HIP_RETURN(hip_impl::ihipOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, f, blockSize, dynamicSMemSize));
|
int NB;
|
||||||
|
hipError_t Ret = hip_impl::ihipOccupancyMaxActiveBlocksPerMultiprocessor(&NB, f, blockSize, dynamicSMemSize);
|
||||||
|
*numBlocks = NB;
|
||||||
|
HIP_RETURN(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks,
|
// FIXME: Need to replace `uint32_t` with `int` finally.
|
||||||
|
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(uint32_t* numBlocks,
|
||||||
hipFunction_t f,
|
hipFunction_t f,
|
||||||
int blockSize,
|
uint32_t blockSize,
|
||||||
size_t dynamicSMemSize,
|
size_t dynamicSMemSize,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
HIP_RETURN(hip_impl::ihipOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, f, blockSize, dynamicSMemSize));
|
int NB;
|
||||||
|
hipError_t Ret = hip_impl::ihipOccupancyMaxActiveBlocksPerMultiprocessor(&NB, f, blockSize, dynamicSMemSize);
|
||||||
|
*numBlocks = NB;
|
||||||
|
HIP_RETURN(Ret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Αναφορά σε νέο ζήτημα
Block a user