ROCm / HIPIFY

HIPIFY: Convert CUDA to Portable C++ Code
MIT License
442 stars 69 forks source link

[HIPIFY][SWDEV-446374][#72][#577][fix] Return `reinterpret_cast` for an explicit conversion between `pointer-to-function` and `pointer-to-object` #1478

Closed emankov closed 1 month ago

emankov commented 1 month ago

[Reasons]

__global__ void myKernel() {}
int main() {
  cudaFuncSetCacheConfig(myKernel,cudaFuncCachePreferEqual);
  return 0;
}

[Misc]

extern __host__ cudaError_t CUDARTAPI cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig);

hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);

[Affected APIs]

cudaFuncGetAttributes -> hipFuncGetAttributes cudaFuncSetAttribute -> hipFuncSetAttribute cudaFuncSetCacheConfig -> hipFuncSetCacheConfig cudaFuncSetSharedMemConfig -> hipFuncSetSharedMemConfig cudaLaunchKernel -> hipLaunchKernel cudaLaunchCooperativeKernel -> hipLaunchCooperativeKernel

[ToDo]