From 64f2d5e8619f3d9f7f7903f79e4f9fdaefc82ea1 Mon Sep 17 00:00:00 2001 From: Michael LIAO Date: Fri, 11 Oct 2019 16:49:18 -0400 Subject: [PATCH] [HIP] Correct headers and add missing function templates for hip-clang. - Fix 2 runtime API prototypes `hipOccupancyMaxActiveBlocksPerMultiprocessor` and `hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` - Add missing function templates of them in hip-clang. [ROCm/clr commit: 61bc68a5f4f80f99ce4175300852b6bcbc32545c] --- .../include/hip/hcc_detail/hip_runtime_api.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/projects/clr/hipamd/include/hip/hcc_detail/hip_runtime_api.h b/projects/clr/hipamd/include/hip/hcc_detail/hip_runtime_api.h index f2518c3b75..5a61219f4a 100644 --- a/projects/clr/hipamd/include/hip/hcc_detail/hip_runtime_api.h +++ b/projects/clr/hipamd/include/hip/hcc_detail/hip_runtime_api.h @@ -3219,6 +3219,21 @@ hipError_t hipLaunchKernel(const void* function_address, } /* extern "c" */ #endif +#if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__) +template +static hipError_t __host__ inline hipOccupancyMaxActiveBlocksPerMultiprocessor( + uint32_t* numBlocks, F func, uint32_t blockSize, size_t dynSharedMemPerBlk) { + return ::hipOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, (hipFunction_t)func, blockSize, + dynSharedMemPerBlk); +} +template +static hipError_t __host__ inline hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( + uint32_t* numBlocks, F func, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags) { + return ::hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( + numBlocks, (hipFunction_t)func, blockSize, dynSharedMemPerBlk, flags); +} +#endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__) + #if USE_PROF_API #include #endif