[HIPIFY] CUDA Driver API functions total revise (up to CUDA 10.0)

+ for all CUDA versions
+ add missing types
+ fix typos
+ sync with HIP
+ update CUDA_Driver_API_functions_supported_by_HIP.md
+ formatting, annotating
Tá an tiomantas seo le fáil i:
Evgeny Mankov
2018-11-19 20:00:05 +03:00
tuismitheoir 32767e92bc
tiomantas cfabad4354
D'athraigh 5 comhad le 858 breiseanna agus 405 scriosta
@@ -22,8 +22,8 @@
| typedef |`CUDA_RESOURCE_VIEW_DESC_st` | |
| struct |`CUDA_TEXTURE_DESC` | |
| typedef |`CUDA_TEXTURE_DESC_st` | |
| struct |`CUdevprop` |`hipDeviceProp_t` |
| typedef |`CUdevprop_st` |`hipDeviceProp_t` |
| struct |`CUdevprop` | |
| typedef |`CUdevprop_st` | |
| struct |`CUipcEventHandle` |`ihipIpcEventHandle_t` |
| typedef |`CUipcEventHandle_st` |`ihipIpcEventHandle_t` |
| struct |`CUipcMemHandle` |`hipIpcMemHandle_t` |
@@ -763,6 +763,7 @@
| `cuDeviceGetName` | `hipDeviceGetName` |
| `cuDeviceTotalMem` | `hipDeviceTotalMem` |
| `cuDeviceGetLuid` | |
| `cuDeviceGetUuid` | |
## **6. Device Management [DEPRECATED]**
@@ -792,9 +793,9 @@
| `cuCtxGetCurrent` | `hipCtxGetCurrent` |
| `cuCtxGetDevice` | `hipCtxGetDevice` |
| `cuCtxGetFlags` | `hipCtxGetFlags` |
| `cuCtxGetLimit` | |
| `cuCtxGetLimit` | `hipDeviceGetLimit` |
| `cuCtxGetSharedMemConfig` | `hipCtxGetSharedMemConfig` |
| `cuCtxGetStreamPriorityRange` | |
| `cuCtxGetStreamPriorityRange` | `hipDeviceGetStreamPriorityRange`|
| `cuCtxPopCurrent` | `hipCtxPopCurrent` |
| `cuCtxPushCurrent` | `hipCtxPushCurrent` |
| `cuCtxSetCacheConfig` | `hipCtxSetCacheConfig` |
@@ -835,16 +836,16 @@
|-----------------------------------------------------------|-------------------------------|
| `cuArray3DCreate` | `hipArray3DCreate` |
| `cuArray3DGetDescriptor` | |
| `cuArrayCreate` | |
| `cuArrayCreate` | `hipArrayCreate` |
| `cuArrayDestroy` | |
| `cuArrayGetDescriptor` | |
| `cuDeviceGetByPCIBusId` | `hipDeviceGetByPCIBusId` |
| `cuDeviceGetPCIBusId` | `hipDeviceGetPCIBusId` |
| `cuIpcCloseMemHandle` | |
| `cuIpcCloseMemHandle` | `hipIpcCloseMemHandle` |
| `cuIpcGetEventHandle` | |
| `cuIpcGetMemHandle` | |
| `cuIpcGetMemHandle` | `hipIpcGetMemHandle` |
| `cuIpcOpenEventHandle` | |
| `cuIpcOpenMemHandle` | |
| `cuIpcOpenMemHandle` | `hipIpcOpenMemHandle` |
| `cuMemAlloc` | `hipMalloc` |
| `cuMemAllocHost` | |
| `cuMemAllocManaged` | |
@@ -867,7 +868,7 @@
| `cuMemcpyDtoDAsync` | `hipMemcpyDtoDAsync` |
| `cuMemcpyDtoH` | `hipMemcpyDtoH` |
| `cuMemcpyDtoHAsync` | `hipMemcpyDtoHAsync` |
| `cuMemcpyHtoA` | |
| `cuMemcpyHtoA` | `hipMemcpyHtoA` |
| `cuMemcpyHtoAAsync` | |
| `cuMemcpyHtoD` | `hipMemcpyHtoD` |
| `cuMemcpyHtoDAsync` | `hipMemcpyHtoDAsync` |
@@ -875,11 +876,11 @@
| `cuMemcpyPeerAsync` | |
| `cuMemFree` | `hipFree` |
| `cuMemFreeHost` | `hipFreeHost` |
| `cuMemGetAddressRange` | |
| `cuMemGetAddressRange` | `hipMemGetAddressRange` |
| `cuMemGetInfo` | `hipMemGetInfo` |
| `cuMemHostAlloc` | `hipHostMalloc` |
| `cuMemHostGetDevicePointer` | |
| `cuMemHostGetFlags` | |
| `cuMemHostGetDevicePointer` | `hipHostGetDevicePointer` |
| `cuMemHostGetFlags` | `hipHostGetFlags` |
| `cuMemHostRegister` | `hipHostRegister` |
| `cuMemHostUnregister` | `hipHostUnregister` |
| `cuMemsetD16` | |
@@ -892,8 +893,8 @@
| `cuMemsetD2D8Async` | |
| `cuMemsetD32` | `hipMemset` |
| `cuMemsetD32Async` | `hipMemsetAsync` |
| `cuMemsetD2D8` | |
| `cuMemsetD2D8Async` | |
| `cuMemsetD8` | `hipMemsetD8` |
| `cuMemsetD8Async` | |
| `cuMipmappedArrayCreate` | |
| `cuMipmappedArrayDestroy` | |
| `cuMipmappedArrayGetLevel` | |
@@ -916,8 +917,8 @@
|-----------------------------------------------------------|-------------------------------|
| `cuStreamAddCallback` | `hipStreamAddCallback` |
| `cuStreamAttachMemAsync` | |
| `cuStreamCreate` | |
| `cuStreamCreateWithPriority` | |
| `cuStreamCreate` | `hipStreamCreateWithFlags` |
| `cuStreamCreateWithPriority` | `hipStreamCreateWithPriority` |
| `cuStreamDestroy` | `hipStreamDestroy` |
| `cuStreamGetFlags` | `hipStreamGetFlags` |
| `cuStreamGetPriority` | `hipStreamGetPriority` |
@@ -932,7 +933,7 @@
| **CUDA** | **HIP** |
|-----------------------------------------------------------|-------------------------------|
| `cuEventCreate` | `hipEventCreate` |
| `cuEventCreate` | `hipEventCreateWithFlags` |
| `cuEventDestroy` | `hipEventDestroy` |
| `cuEventElapsedTime` | `hipEventElapsedTime` |
| `cuEventQuery` | `hipEventQuery` |
@@ -967,10 +968,13 @@
| **CUDA** | **HIP** |
|-----------------------------------------------------------|-------------------------------|
| `cuFuncGetAttribute` | |
| `cuFuncSetAttribute` | |
| `cuFuncSetCacheConfig` | `hipFuncSetCacheConfig` |
| `cuFuncSetSharedMemConfig` | |
| `cuLaunchKernel` | `hipModuleLaunchKernel` |
| `cuLaunchHostFunc` | |
| `cuLaunchCooperativeKernel` | |
| `cuLaunchCooperativeKernelMultiDevice` | |
## **18. Execution Control [DEPRECATED]**
@@ -1047,8 +1051,8 @@
| `cuTexRefGetMipmapLevelBias` | |
| `cuTexRefGetMipmapLevelClamp` | |
| `cuTexRefGetMipmappedArray` | |
| `cuTexRefSetAddress` | |
| `cuTexRefSetAddress2D` | |
| `cuTexRefSetAddress` | `hipTexRefSetAddress` |
| `cuTexRefSetAddress2D` | `hipTexRefSetAddress2D` |
| `cuTexRefSetAddressMode` | `hipTexRefSetAddressMode` |
| `cuTexRefSetArray` | `hipTexRefSetArray` |
| `cuTexRefSetBorderColor` | |
@@ -1233,3 +1237,4 @@
| `cuEGLStreamProducerReturnFrame` | |
| `cuGraphicsEGLRegisterImage` | |
| `cuGraphicsResourceGetMappedEglFrame` | |
| `cuEventCreateFromEGLSync` | |
@@ -11,7 +11,7 @@
| `cudaDeviceGetLimit` | `hipDeviceGetLimit` |
| `cudaDeviceGetPCIBusId` | `hipDeviceGetPCIBusId` |
| `cudaDeviceGetSharedMemConfig` | `hipDeviceGetSharedMemConfig` |
| `cudaDeviceGetStreamPriorityRange` | |
| `cudaDeviceGetStreamPriorityRange` | `hipDeviceGetStreamPriorityRange` |
| `cudaDeviceReset` | `hipDeviceReset` |
| `cudaDeviceSetCacheConfig` | `hipDeviceSetCacheConfig` |
| `cudaDeviceSetLimit` | `hipDeviceSetLimit` |
@@ -19,7 +19,7 @@
| `cudaDeviceSynchronize` | `hipDeviceSynchronize` |
| `cudaGetDevice` | `hipGetDevice` |
| `cudaGetDeviceCount` | `hipGetDeviceCount` |
| `cudaGetDeviceFlags` | |
| `cudaGetDeviceFlags` | `hipCtxGetFlags` |
| `cudaGetDeviceProperties` | `hipGetDeviceProperties` |
| `cudaIpcCloseMemHandle` | `hipIpcCloseMemHandle` |
| `cudaIpcGetEventHandle` | `hipIpcGetEventHandle` |
@@ -56,12 +56,15 @@
|-----------------------------------------------------------|-------------------------------|
| `cudaStreamAddCallback` | `hipStreamAddCallback` |
| `cudaStreamAttachMemAsync` | |
| `cudaStreamBeginCapture` | |
| `cudaStreamEndCapture` | |
| `cudaStreamIsCapturing` | |
| `cudaStreamCreate` | `hipStreamCreate` |
| `cudaStreamCreateWithFlags` | `hipStreamCreateWithFlags` |
| `cudaStreamCreateWithPriority` | |
| `cudaStreamCreateWithPriority` | `hipStreamCreateWithPriority` |
| `cudaStreamDestroy` | `hipStreamDestroy` |
| `cudaStreamGetFlags` | `hipStreamGetFlags` |
| `cudaStreamGetPriority` | |
| `cudaStreamGetPriority` | `hipStreamGetPriority` |
| `cudaStreamQuery` | `hipStreamQuery` |
| `cudaStreamSynchronize` | `hipStreamSynchronize` |
| `cudaStreamWaitEvent` | `hipStreamWaitEvent` |
@@ -82,7 +85,14 @@
| **CUDA** | **HIP** |
|-----------------------------------------------------------|-------------------------------|
| `cudaSignalExternalSemaphoresAsync` | |
| `cudaWaitExternalSemaphoresAsync` | |
| `cudaImportExternalMemory` | |
| `cudaExternalMemoryGetMappedBuffer` | |
| `cudaExternalMemoryGetMappedMipmappedArray` | |
| `cudaDestroyExternalMemory` | |
| `cudaImportExternalSemaphore` | |
| `cudaDestroyExternalSemaphore` | |
## **7. Execution Control**
Tá difríocht comhad cosc orthu toisc go bhfuil sé ró-mhór Difríocht Luchtaigh
+4 -2
Féach ar an gComhad
@@ -80,8 +80,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{
{"CUDA_TEXTURE_DESC_st", {"HIP_TEXTURE_DESC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}},
{"CUDA_TEXTURE_DESC", {"HIP_TEXTURE_DESC", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}},
{"CUdevprop_st", {"hipDeviceProp_t", CONV_TYPE, API_DRIVER}},
{"CUdevprop", {"hipDeviceProp_t", CONV_TYPE, API_DRIVER}},
// no analogue
// NOTE: cudaDeviceProp differs
{"CUdevprop_st", {"hipDeviceProp_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}},
{"CUdevprop", {"hipDeviceProp_t", CONV_TYPE, API_DRIVER, HIP_UNSUPPORTED}},
// cudaIpcEventHandle_st
{"CUipcEventHandle_st", {"ihipIpcEventHandle_t", CONV_TYPE, API_DRIVER}},
+103 -21
Féach ar an gComhad
@@ -1,6 +1,6 @@
#include "CUDA2HIP.h"
// Map of all functions
// Map of all CUDA Runtime API functions
const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_FUNCTION_MAP{
// Error API
{"cudaGetLastError", {"hipGetLastError", CONV_ERROR, API_RUNTIME}},
@@ -9,29 +9,49 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_FUNCTION_MAP{
{"cudaGetErrorString", {"hipGetErrorString", CONV_ERROR, API_RUNTIME}},
// memcpy functions
// no analogue
// NOTE: Not equal to cuMemcpy due to different signatures
{"cudaMemcpy", {"hipMemcpy", CONV_MEMORY, API_RUNTIME}},
{"cudaMemcpyToArray", {"hipMemcpyToArray", CONV_MEMORY, API_RUNTIME}},
{"cudaMemcpyToSymbol", {"hipMemcpyToSymbol", CONV_MEMORY, API_RUNTIME}},
{"cudaMemcpyToSymbolAsync", {"hipMemcpyToSymbolAsync", CONV_MEMORY, API_RUNTIME}},
{"cudaMemcpyAsync", {"hipMemcpyAsync", CONV_MEMORY, API_RUNTIME}},
// no analogue
// NOTE: Not equal to cuMemcpy2D due to different signatures
{"cudaMemcpy2D", {"hipMemcpy2D", CONV_MEMORY, API_RUNTIME}},
// no analogue
// NOTE: Not equal to cuMemcpy2DAsync due to different signatures
{"cudaMemcpy2DAsync", {"hipMemcpy2DAsync", CONV_MEMORY, API_RUNTIME}},
{"cudaMemcpy2DToArray", {"hipMemcpy2DToArray", CONV_MEMORY, API_RUNTIME}},
{"cudaMemcpy2DArrayToArray", {"hipMemcpy2DArrayToArray", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaMemcpy2DFromArray", {"hipMemcpy2DFromArray", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaMemcpy2DFromArrayAsync", {"hipMemcpy2DFromArrayAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaMemcpy2DToArrayAsync", {"hipMemcpy2DToArrayAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// no analogue
// NOTE: Not equal to cuMemcpy3D due to different signatures
{"cudaMemcpy3D", {"hipMemcpy3D", CONV_MEMORY, API_RUNTIME}},
// no analogue
// NOTE: Not equal to cuMemcpy3DAsync due to different signatures
{"cudaMemcpy3DAsync", {"hipMemcpy3DAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// no analogue
// NOTE: Not equal to cuMemcpy3DPeer due to different signatures
{"cudaMemcpy3DPeer", {"hipMemcpy3DPeer", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// no analogue
// NOTE: Not equal to cuMemcpy3DPeerAsync due to different signatures
{"cudaMemcpy3DPeerAsync", {"hipMemcpy3DPeerAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// no analogue
// NOTE: Not equal to cuMemcpyAtoA due to different signatures
{"cudaMemcpyArrayToArray", {"hipMemcpyArrayToArray", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaMemcpyFromArrayAsync", {"hipMemcpyFromArrayAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaMemcpyFromSymbol", {"hipMemcpyFromSymbol", CONV_MEMORY, API_RUNTIME}},
{"cudaMemcpyFromSymbolAsync", {"hipMemcpyFromSymbolAsync", CONV_MEMORY, API_RUNTIME}},
{"cudaMemAdvise", {"hipMemAdvise", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}}, //
{"cudaMemRangeGetAttribute", {"hipMemRangeGetAttribute", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}}, //
{"cudaMemRangeGetAttributes", {"hipMemRangeGetAttributes", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}}, //
// cuMemAdvise
{"cudaMemAdvise", {"hipMemAdvise", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// cuMemRangeGetAttribute
{"cudaMemRangeGetAttribute", {"hipMemRangeGetAttribute", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// cuMemRangeGetAttributes
{"cudaMemRangeGetAttributes", {"hipMemRangeGetAttributes", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// memset
{"cudaMemset", {"hipMemset", CONV_MEMORY, API_RUNTIME}},
@@ -42,13 +62,17 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_FUNCTION_MAP{
{"cudaMemset3DAsync", {"hipMemset3DAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// Memory management
// cuMemGetInfo
{"cudaMemGetInfo", {"hipMemGetInfo", CONV_MEMORY, API_RUNTIME}},
{"cudaArrayGetInfo", {"hipArrayGetInfo", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// no analogue
// NOTE: Not equal to cuMipmappedArrayDestroy due to different signatures
{"cudaFreeMipmappedArray", {"hipFreeMipmappedArray", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaGetMipmappedArrayLevel", {"hipGetMipmappedArrayLevel", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaGetSymbolAddress", {"hipGetSymbolAddress", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaGetSymbolSize", {"hipGetSymbolSize", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaMemPrefetchAsync", {"hipMemPrefetchAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}}, // // API_Driver ANALOGUE (cuMemPrefetchAsync)
// TODO: double check cuMemPrefetchAsync
{"cudaMemPrefetchAsync", {"hipMemPrefetchAsync", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// malloc
{"cudaMalloc", {"hipMalloc", CONV_MEMORY, API_RUNTIME}},
@@ -57,15 +81,22 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_FUNCTION_MAP{
{"cudaMalloc3D", {"hipMalloc3D", CONV_MEMORY, API_RUNTIME}},
{"cudaMalloc3DArray", {"hipMalloc3DArray", CONV_MEMORY, API_RUNTIME}},
{"cudaMallocManaged", {"hipMallocManaged", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
// no analogue
// NOTE: Not equal to cuMipmappedArrayCreate due to different signatures
{"cudaMallocMipmappedArray", {"hipMallocMipmappedArray", CONV_MEMORY, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaMallocPitch", {"hipMallocPitch", CONV_MEMORY, API_RUNTIME}},
// cuMemFree
{"cudaFree", {"hipFree", CONV_MEMORY, API_RUNTIME}},
// cuMemFreeHost
{"cudaFreeHost", {"hipHostFree", CONV_MEMORY, API_RUNTIME}},
{"cudaFreeArray", {"hipFreeArray", CONV_MEMORY, API_RUNTIME}},
// cuMemHostRegister
{"cudaHostRegister", {"hipHostRegister", CONV_MEMORY, API_RUNTIME}},
// cuMemHostUnregister
{"cudaHostUnregister", {"hipHostUnregister", CONV_MEMORY, API_RUNTIME}},
// hipHostAlloc deprecated - use hipHostMalloc instead
// cuMemHostAlloc
// NOTE: hipHostAlloc deprecated - use hipHostMalloc instead
{"cudaHostAlloc", {"hipHostMalloc", CONV_MEMORY, API_RUNTIME}},
// make memory functions
@@ -74,35 +105,81 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_FUNCTION_MAP{
{"make_cudaPos", {"make_hipPos", CONV_MEMORY, API_RUNTIME}},
// Host Register Flags
// cuMemHostGetFlags
{"cudaHostGetFlags", {"hipHostGetFlags", CONV_MEMORY, API_RUNTIME}},
// Events
{"cudaEventCreate", {"hipEventCreate", CONV_EVENT, API_RUNTIME}},
{"cudaEventCreateWithFlags", {"hipEventCreateWithFlags", CONV_EVENT, API_RUNTIME}},
{"cudaEventDestroy", {"hipEventDestroy", CONV_EVENT, API_RUNTIME}},
{"cudaEventRecord", {"hipEventRecord", CONV_EVENT, API_RUNTIME}},
{"cudaEventElapsedTime", {"hipEventElapsedTime", CONV_EVENT, API_RUNTIME}},
{"cudaEventSynchronize", {"hipEventSynchronize", CONV_EVENT, API_RUNTIME}},
{"cudaEventQuery", {"hipEventQuery", CONV_EVENT, API_RUNTIME}},
// no analogue
// NOTE: Not equal to cuEventCreate due to different signatures
{"cudaEventCreate", {"hipEventCreate", CONV_EVENT, API_RUNTIME}},
// cuEventCreate
{"cudaEventCreateWithFlags", {"hipEventCreateWithFlags", CONV_EVENT, API_RUNTIME}},
// cuEventDestroy
{"cudaEventDestroy", {"hipEventDestroy", CONV_EVENT, API_RUNTIME}},
// cuEventRecord
{"cudaEventRecord", {"hipEventRecord", CONV_EVENT, API_RUNTIME}},
// cuEventElapsedTime
{"cudaEventElapsedTime", {"hipEventElapsedTime", CONV_EVENT, API_RUNTIME}},
// cuEventSynchronize
{"cudaEventSynchronize", {"hipEventSynchronize", CONV_EVENT, API_RUNTIME}},
// cuEventQuery
{"cudaEventQuery", {"hipEventQuery", CONV_EVENT, API_RUNTIME}},
// 5.6. External Resource Interoperability
// cuDestroyExternalMemory
{"cudaDestroyExternalMemory", {"hipDestroyExternalMemory", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// cuDestroyExternalSemaphore
{"cudaDestroyExternalSemaphore", {"hipDestroyExternalSemaphore", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// cuExternalMemoryGetMappedBuffer
{"cudaExternalMemoryGetMappedBuffer", {"hipExternalMemoryGetMappedBuffer", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// cuExternalMemoryGetMappedMipmappedArray
{"cudaExternalMemoryGetMappedMipmappedArray", {"hipExternalMemoryGetMappedMipmappedArray", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// cuImportExternalMemory
{"cudaImportExternalMemory", {"hipImportExternalMemory", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// cuImportExternalSemaphore
{"cudaImportExternalSemaphore", {"hipImportExternalSemaphore", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// cuSignalExternalSemaphoresAsync
{"cudaSignalExternalSemaphoresAsync", {"hipSignalExternalSemaphoresAsync", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// cuWaitExternalSemaphoresAsync
{"cudaWaitExternalSemaphoresAsync", {"hipWaitExternalSemaphoresAsync", CONV_EXT_RES, API_RUNTIME, HIP_UNSUPPORTED}},
// Streams
// no analogue
// NOTE: Not equal to cuStreamCreate due to different signatures
{"cudaStreamCreate", {"hipStreamCreate", CONV_STREAM, API_RUNTIME}},
// cuStreamCreate
{"cudaStreamCreateWithFlags", {"hipStreamCreateWithFlags", CONV_STREAM, API_RUNTIME}},
{"cudaStreamCreateWithPriority", {"hipStreamCreateWithPriority", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}},
// cuStreamCreateWithPriority
{"cudaStreamCreateWithPriority", {"hipStreamCreateWithPriority", CONV_STREAM, API_RUNTIME}},
// cuStreamDestroy
{"cudaStreamDestroy", {"hipStreamDestroy", CONV_STREAM, API_RUNTIME}},
// cuStreamWaitEvent
{"cudaStreamWaitEvent", {"hipStreamWaitEvent", CONV_STREAM, API_RUNTIME}},
// cuStreamSynchronize
{"cudaStreamSynchronize", {"hipStreamSynchronize", CONV_STREAM, API_RUNTIME}},
// cuStreamGetFlags
{"cudaStreamGetFlags", {"hipStreamGetFlags", CONV_STREAM, API_RUNTIME}},
// cuStreamQuery
{"cudaStreamQuery", {"hipStreamQuery", CONV_STREAM, API_RUNTIME}},
// cuStreamAddCallback
{"cudaStreamAddCallback", {"hipStreamAddCallback", CONV_STREAM, API_RUNTIME}},
// cuStreamAttachMemAsync
{"cudaStreamAttachMemAsync", {"hipStreamAttachMemAsync", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}},
{"cudaStreamGetPriority", {"hipStreamGetPriority", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}},
// cuStreamBeginCapture
{"cudaStreamBeginCapture", {"hipStreamBeginCapture", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}},
// cuStreamEndCapture
{"cudaStreamEndCapture", {"hipStreamEndCapture", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}},
// cuStreamIsCapturing
{"cudaStreamIsCapturing", {"hipStreamIsCapturing", CONV_STREAM, API_RUNTIME, HIP_UNSUPPORTED}},
// cuStreamGetPriority
{"cudaStreamGetPriority", {"hipStreamGetPriority", CONV_STREAM, API_RUNTIME}},
// Other synchronization
{"cudaDeviceSynchronize", {"hipDeviceSynchronize", CONV_DEVICE, API_RUNTIME}},
{"cudaDeviceReset", {"hipDeviceReset", CONV_DEVICE, API_RUNTIME}},
{"cudaSetDevice", {"hipSetDevice", CONV_DEVICE, API_RUNTIME}},
{"cudaGetDevice", {"hipGetDevice", CONV_DEVICE, API_RUNTIME}},
// cuDeviceGetCount
{"cudaGetDeviceCount", {"hipGetDeviceCount", CONV_DEVICE, API_RUNTIME}},
{"cudaChooseDevice", {"hipChooseDevice", CONV_DEVICE, API_RUNTIME}},
@@ -118,20 +195,25 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_FUNCTION_MAP{
{"cudaDeviceGetAttribute", {"hipDeviceGetAttribute", CONV_DEVICE, API_RUNTIME}},
// Pointer Attributes
// struct cudaPointerAttributes
{"cudaPointerGetAttributes", {"hipPointerGetAttributes", CONV_MEMORY, API_RUNTIME}},
// no analogue
// NOTE: Not equal to cuPointerGetAttributes due to different signatures
{"cudaPointerGetAttributes", {"hipPointerGetAttributes", CONV_ADDRESSING, API_RUNTIME}},
// cuMemHostGetDevicePointer
{"cudaHostGetDevicePointer", {"hipHostGetDevicePointer", CONV_MEMORY, API_RUNTIME}},
// Device
{"cudaGetDeviceProperties", {"hipGetDeviceProperties", CONV_DEVICE, API_RUNTIME}},
// cuDeviceGetPCIBusId
{"cudaDeviceGetPCIBusId", {"hipDeviceGetPCIBusId", CONV_DEVICE, API_RUNTIME}},
// cuDeviceGetByPCIBusId
{"cudaDeviceGetByPCIBusId", {"hipDeviceGetByPCIBusId", CONV_DEVICE, API_RUNTIME}},
{"cudaDeviceGetStreamPriorityRange", {"hipDeviceGetStreamPriorityRange", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}},
// cuCtxGetStreamPriorityRange
{"cudaDeviceGetStreamPriorityRange", {"hipDeviceGetStreamPriorityRange", CONV_DEVICE, API_RUNTIME}},
{"cudaSetValidDevices", {"hipSetValidDevices", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}},
// Device Flags
{"cudaGetDeviceFlags", {"hipGetDeviceFlags", CONV_DEVICE, API_RUNTIME, HIP_UNSUPPORTED}},
// cuCtxGetFlags
{"cudaGetDeviceFlags", {"hipCtxGetFlags", CONV_DEVICE, API_RUNTIME}},
{"cudaSetDeviceFlags", {"hipSetDeviceFlags", CONV_DEVICE, API_RUNTIME}},
// Cache config
@@ -179,7 +261,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_FUNCTION_MAP{
// {"cudaThreadGetSharedMemConfig", {"hipDeviceGetSharedMemConfig", CONV_DEVICE, API_RUNTIME}},
// {"cudaThreadSetSharedMemConfig", {"hipDeviceSetSharedMemConfig", CONV_DEVICE, API_RUNTIME}},
// cuCtxGetLimit
{"cudaDeviceGetLimit", {"hipDeviceGetLimit", CONV_DEVICE, API_RUNTIME}},
// Profiler