Merge pull request #883 from emankov/master
[HIPIFY] CUDA Runtime API functions total revise (up to CUDA 10.0)
此提交包含在:
@@ -770,7 +770,7 @@
|
||||
| **CUDA** | **HIP** |
|
||||
|-----------------------------------------------------------|-------------------------------|
|
||||
| `cuDeviceComputeCapability` | `hipDeviceComputeCapability` |
|
||||
| `cuDeviceGetProperties` | `hipGetDeviceProperties` |
|
||||
| `cuDeviceGetProperties` | |
|
||||
|
||||
## **7. Primary Context Management**
|
||||
|
||||
@@ -800,7 +800,7 @@
|
||||
| `cuCtxPushCurrent` | `hipCtxPushCurrent` |
|
||||
| `cuCtxSetCacheConfig` | `hipCtxSetCacheConfig` |
|
||||
| `cuCtxSetCurrent` | `hipCtxSetCurrent` |
|
||||
| `cuCtxSetLimit` | |
|
||||
| `cuCtxSetLimit` | `hipDeviceSetLimit` |
|
||||
| `cuCtxSetSharedMemConfig` | `hipCtxSetSharedMemConfig` |
|
||||
| `cuCtxSynchronize` | `hipCtxSynchronize` |
|
||||
|
||||
@@ -861,7 +861,7 @@
|
||||
| `cuMemcpyAsync` | |
|
||||
| `cuMemcpyAtoA` | |
|
||||
| `cuMemcpyAtoD` | |
|
||||
| `cuMemcpyAtoH` | |
|
||||
| `cuMemcpyAtoH` | `hipMemcpyAtoH` |
|
||||
| `cuMemcpyAtoHAsync` | |
|
||||
| `cuMemcpyDtoA` | |
|
||||
| `cuMemcpyDtoD` | `hipMemcpyDtoD` |
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
| `cudaSetDevice` | `hipSetDevice` |
|
||||
| `cudaSetDeviceFlags` | `hipSetDeviceFlags` |
|
||||
| `cudaSetValidDevices` | |
|
||||
| `cudaDeviceGetP2PAttribute` | |
|
||||
|
||||
## **2. Thread Management [DEPRECATED]**
|
||||
|
||||
@@ -99,6 +100,7 @@
|
||||
| **CUDA** | **HIP** |
|
||||
|-----------------------------------------------------------|-------------------------------|
|
||||
| `cudaFuncGetAttributes` | |
|
||||
| `cudaFuncSetAttribute` | |
|
||||
| `cudaFuncSetCacheConfig` | `hipFuncSetCacheConfig` |
|
||||
| `cudaFuncSetSharedMemConfig` | |
|
||||
| `cudaGetParameterBuffer` | |
|
||||
@@ -106,6 +108,9 @@
|
||||
| `cudaLaunchKernel` | `hipLaunchKernel` |
|
||||
| `cudaSetDoubleForDevice` | |
|
||||
| `cudaSetDoubleForHost` | |
|
||||
| `cudaLaunchCooperativeKernel` | |
|
||||
| `cudaLaunchCooperativeKernelMultiDevice` | |
|
||||
| `cudaLaunchHostFunc` | |
|
||||
|
||||
## **8. Occupancy**
|
||||
|
||||
@@ -148,6 +153,7 @@
|
||||
| `cudaMallocMipmappedArray` | |
|
||||
| `cudaMallocPitch` | |
|
||||
| `cudaMemGetInfo` | `hipMemGetInfo` |
|
||||
| `cudaMemPrefetchAsync` | |
|
||||
| `cudaMemcpy` | `hipMemcpy` |
|
||||
| `cudaMemcpy2D` | `hipMemcpy2D` |
|
||||
| `cudaMemcpy2DArrayToArray` | |
|
||||
@@ -162,10 +168,10 @@
|
||||
| `cudaMemcpy3DPeerAsync` | |
|
||||
| `cudaMemcpyArrayToArray` | |
|
||||
| `cudaMemcpyAsync` | `hipMemcpyAsync` |
|
||||
| `cudaMemcpyFromArray` | `MemcpyFromArray` |
|
||||
| `cudaMemcpyFromArray` | `hipMemcpyFromArray` |
|
||||
| `cudaMemcpyFromArrayAsync` | |
|
||||
| `cudaMemcpyFromSymbol` | `hipMemcpyFromSymbol` |
|
||||
| `cudaMemcpyFromSymbolAsync` | |
|
||||
| `cudaMemcpyFromSymbolAsync` | `hipMemcpyFromSymbolAsync` |
|
||||
| `cudaMemcpyPeer` | `hipMemcpyPeer` |
|
||||
| `cudaMemcpyPeerAsync` | `hipMemcpyPeerAsync` |
|
||||
| `cudaMemcpyToArray` | `hipMemcpyToArray` |
|
||||
@@ -299,11 +305,13 @@
|
||||
| `cudaEGLStreamConsumerAcquireFrame` | |
|
||||
| `cudaEGLStreamConsumerConnect` | |
|
||||
| `cudaEGLStreamConsumerConnectWithFlags` | |
|
||||
| `cudaEGLStreamConsumerDisconnect` | |
|
||||
| `cudaEGLStreamConsumerReleaseFrame` | |
|
||||
| `cudaEGLStreamProducerConnect` | |
|
||||
| `cudaEGLStreamProducerDisconnect` | |
|
||||
| `cudaEGLStreamProducerPresentFrame` | |
|
||||
| `cudaEGLStreamProducerReturnFrame` | |
|
||||
| `cudaEventCreateFromEGLSync` | |
|
||||
| `cudaGraphicsEGLRegisterImage` | |
|
||||
| `cudaGraphicsResourceGetMappedEglFrame` | |
|
||||
|
||||
@@ -321,17 +329,17 @@
|
||||
|
||||
## **24. Texture Reference Management**
|
||||
|
||||
| **CUDA** | **HIP** |
|
||||
|-----------------------------------------------------------|-------------------------------|
|
||||
| `cudaBindTexture` | `hipBindTexture` |
|
||||
| `cudaBindTexture2D` | `hipBindTexture2D` |
|
||||
| `cudaBindTextureToArray` | `hipBindTextureToArray` |
|
||||
| `cudaBindTextureToMipmappedArray` | |
|
||||
| `cudaCreateChannelDesc` | `hipCreateChannelDesc` |
|
||||
| `cudaGetChannelDesc` | `hipGetChannelDesc` |
|
||||
| `cudaGetTextureAlignmentOffset` | |
|
||||
| `cudaGetTextureReference` | |
|
||||
| `cudaUnbindTexture` | `hipUnbindTexture` |
|
||||
| **CUDA** | **HIP** |
|
||||
|-----------------------------------------------------------|----------------------------------|
|
||||
| `cudaBindTexture` | `hipBindTexture` |
|
||||
| `cudaBindTexture2D` | `hipBindTexture2D` |
|
||||
| `cudaBindTextureToArray` | `hipBindTextureToArray` |
|
||||
| `cudaBindTextureToMipmappedArray` | `hipBindTextureToMipmappedArray` |
|
||||
| `cudaCreateChannelDesc` | `hipCreateChannelDesc` |
|
||||
| `cudaGetChannelDesc` | `hipGetChannelDesc` |
|
||||
| `cudaGetTextureAlignmentOffset` | `hipGetTextureAlignmentOffset` |
|
||||
| `cudaGetTextureReference` | `hipGetTextureReference` |
|
||||
| `cudaUnbindTexture` | `hipUnbindTexture` |
|
||||
|
||||
## **25. Surface Reference Management**
|
||||
|
||||
@@ -369,6 +377,37 @@
|
||||
|
||||
| **CUDA** | **HIP** |
|
||||
|-----------------------------------------------------------|-------------------------------|
|
||||
| `cudaGraphAddChildGraphNode` | |
|
||||
| `cudaGraphAddDependencies` | |
|
||||
| `cudaGraphAddEmptyNode` | |
|
||||
| `cudaGraphAddHostNode` | |
|
||||
| `cudaGraphAddKernelNode` | |
|
||||
| `cudaGraphAddMemcpyNode` | |
|
||||
| `cudaGraphAddMemsetNode` | |
|
||||
| `cudaGraphChildGraphNodeGetGraph` | |
|
||||
| `cudaGraphClone` | |
|
||||
| `cudaGraphCreate` | |
|
||||
| `cudaGraphDestroy` | |
|
||||
| `cudaGraphDestroyNode` | |
|
||||
| `cudaGraphExecDestroy` | |
|
||||
| `cudaGraphGetEdges` | |
|
||||
| `cudaGraphGetNodes` | |
|
||||
| `cudaGraphGetRootNodes` | |
|
||||
| `cudaGraphHostNodeGetParams` | |
|
||||
| `cudaGraphHostNodeSetParams` | |
|
||||
| `cudaGraphInstantiate` | |
|
||||
| `cudaGraphKernelNodeGetParams` | |
|
||||
| `cudaGraphKernelNodeSetParams` | |
|
||||
| `cudaGraphLaunch` | |
|
||||
| `cudaGraphMemcpyNodeGetParams` | |
|
||||
| `cudaGraphMemcpyNodeSetParams` | |
|
||||
| `cudaGraphMemsetNodeGetParams` | |
|
||||
| `cudaGraphMemsetNodeSetParams` | |
|
||||
| `cudaGraphNodeFindInClone` | |
|
||||
| `cudaGraphNodeGetDependencies` | |
|
||||
| `cudaGraphNodeGetDependentNodes` | |
|
||||
| `cudaGraphNodeGetType` | |
|
||||
| `cudaGraphRemoveDependencies` | |
|
||||
|
||||
## **30. C++ API Routines**
|
||||
*(7.0 contains, 7.5 doesn’t)*
|
||||
@@ -381,12 +420,15 @@
|
||||
| `cudaBindTextureToArray` | |
|
||||
| `cudaBindTextureToMipmappedArray` | |
|
||||
| `cudaCreateChannelDesc` | `hipCreateChannelDesc` |
|
||||
| `cudaEventCreate` | |
|
||||
| `cudaFuncGetAttributes` | |
|
||||
| `cudaFuncSetAttribute` | |
|
||||
| `cudaFuncSetCacheConfig` | |
|
||||
| `cudaGetSymbolAddress` | `hipGetSymbolAddress` |
|
||||
| `cudaGetSymbolSize` | `hipGetSymbolSize` |
|
||||
| `cudaGetTextureAlignmentOffset` | |
|
||||
| `cudaLaunch` | |
|
||||
| `cudaLaunchCooperativeKernel` | |
|
||||
| `cudaLaunchKernel` | |
|
||||
| `cudaMallocHost` | |
|
||||
| `cudaMallocManaged` | |
|
||||
@@ -397,9 +439,9 @@
|
||||
| `cudaOccupancyMaxActiveBlocksPerMultiprocessor` | `hipOccupancyMaxActiveBlocksPerMultiprocessor` |
|
||||
| `cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` | |
|
||||
| `cudaOccupancyMaxPotentialBlockSize` | `hipOccupancyMaxPotentialBlockSize` |
|
||||
| `cudaOccupancyMaxPotentialBlockSizeWithFlags` | |
|
||||
| `cudaOccupancyMaxPotentialBlockSizeVariableSMem` | |
|
||||
| `cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags` | |
|
||||
| `cudaOccupancyMaxPotentialBlockSizeWithFlags` | |
|
||||
| `cudaSetupArgument` | |
|
||||
| `cudaStreamAttachMemAsync` | |
|
||||
| `cudaUnbindTexture` | `hipUnbindTexture` |
|
||||
@@ -876,11 +918,6 @@
|
||||
| 1 |*`cudaAddressModeClamp`* |*`hipAddressModeClamp`* |
|
||||
| 2 |*`cudaAddressModeMirror`* |*`hipAddressModeMirror`* |
|
||||
| 3 |*`cudaAddressModeBorder`* |*`hipAddressModeBorder`* |
|
||||
| enum |***`cudaTextureAddressMode`*** |***`hipTextureAddressMode`*** |
|
||||
| 0 |*`cudaAddressModeWrap`* |*`hipAddressModeWrap`* |
|
||||
| 1 |*`cudaAddressModeClamp`* |*`hipAddressModeClamp`* |
|
||||
| 2 |*`cudaAddressModeMirror`* |*`hipAddressModeMirror`* |
|
||||
| 3 |*`cudaAddressModeBorder`* |*`hipAddressModeBorder`* |
|
||||
| enum |***`cudaTextureFilterMode`*** |***`hipTextureFilterMode`*** |
|
||||
| 0 |*`cudaFilterModePoint`* |*`hipFilterModePoint`* |
|
||||
| 1 |*`cudaFilterModeLinear`* |*`hipFilterModeLinear`* |
|
||||
|
||||
@@ -26,10 +26,10 @@ THE SOFTWARE.
|
||||
const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
// 5.2. Error Handling
|
||||
// no analogue
|
||||
// NOTE: cudaGetErrorName and hipGetErrorName have different signature
|
||||
// NOTE: cudaGetErrorName and cuGetErrorName have different signatures
|
||||
{"cuGetErrorName", {"hipGetErrorName_", "", CONV_ERROR, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
// NOTE: cudaGetErrorString and hipGetErrorString have different signature
|
||||
// NOTE: cudaGetErrorString and cuGetErrorString have different signatures
|
||||
{"cuGetErrorString", {"hipGetErrorString_", "", CONV_ERROR, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
|
||||
// 5.3. Initialization
|
||||
@@ -60,7 +60,9 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
|
||||
// 5.6. Device Management [DEPRECATED]
|
||||
{"cuDeviceComputeCapability", {"hipDeviceComputeCapability", "", CONV_DEVICE, API_DRIVER}},
|
||||
{"cuDeviceGetProperties", {"hipGetDeviceProperties", "", CONV_DEVICE, API_DRIVER}},
|
||||
// no analogue
|
||||
// NOTE: Not equal to cudaGetDeviceProperties due to different attributes: cudaDeviceProp and CUdevprop
|
||||
{"cuDeviceGetProperties", {"hipGetDeviceProperties_", "", CONV_DEVICE, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
|
||||
// 5.7. Primary Context Management
|
||||
// no analogues
|
||||
@@ -85,6 +87,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
{"cuCtxGetFlags", {"hipCtxGetFlags", "", CONV_CONTEXT, API_DRIVER}},
|
||||
// cudaDeviceGetLimit
|
||||
{"cuCtxGetLimit", {"hipDeviceGetLimit", "", CONV_CONTEXT, API_DRIVER}},
|
||||
// cudaDeviceGetSharedMemConfig
|
||||
// TODO: rename to hipDeviceGetSharedMemConfig
|
||||
{"cuCtxGetSharedMemConfig", {"hipCtxGetSharedMemConfig", "", CONV_CONTEXT, API_DRIVER}},
|
||||
// cudaDeviceGetStreamPriorityRange
|
||||
{"cuCtxGetStreamPriorityRange", {"hipDeviceGetStreamPriorityRange", "", CONV_CONTEXT, API_DRIVER}},
|
||||
@@ -94,8 +98,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
{"cuCtxPushCurrent_v2", {"hipCtxPushCurrent", "", CONV_CONTEXT, API_DRIVER}},
|
||||
{"cuCtxSetCacheConfig", {"hipCtxSetCacheConfig", "", CONV_CONTEXT, API_DRIVER}},
|
||||
{"cuCtxSetCurrent", {"hipCtxSetCurrent", "", CONV_CONTEXT, API_DRIVER}},
|
||||
{"cuCtxSetLimit", {"hipCtxSetLimit", "", CONV_CONTEXT, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// cudaDeviceSetLimit
|
||||
{"cuCtxSetLimit", {"hipDeviceSetLimit", "", CONV_CONTEXT, API_DRIVER}},
|
||||
// cudaDeviceSetSharedMemConfig
|
||||
// TODO: rename to hipDeviceSetSharedMemConfig
|
||||
{"cuCtxSetSharedMemConfig", {"hipCtxSetSharedMemConfig", "", CONV_CONTEXT, API_DRIVER}},
|
||||
// cudaDeviceSynchronize
|
||||
// TODO: rename to hipDeviceSynchronize
|
||||
{"cuCtxSynchronize", {"hipCtxSynchronize", "", CONV_CONTEXT, API_DRIVER}},
|
||||
|
||||
// 5.9. Context Management [DEPRECATED]
|
||||
@@ -158,6 +167,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
// no analogue
|
||||
{"cuMemAllocManaged", {"hipMemAllocManaged", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
// NOTE: Not equal to cudaMallocPitch due to different signatures
|
||||
{"cuMemAllocPitch", {"hipMemAllocPitch", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuMemAllocPitch_v2", {"hipMemAllocPitch", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
@@ -199,8 +209,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
{"cuMemcpyAtoD", {"hipMemcpyAtoD", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuMemcpyAtoD_v2", {"hipMemcpyAtoD", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
{"cuMemcpyAtoH", {"hipMemcpyAtoH", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuMemcpyAtoH_v2", {"hipMemcpyAtoH", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuMemcpyAtoH", {"hipMemcpyAtoH", "", CONV_MEMORY, API_DRIVER}},
|
||||
{"cuMemcpyAtoH_v2", {"hipMemcpyAtoH", "", CONV_MEMORY, API_DRIVER}},
|
||||
// no analogue
|
||||
{"cuMemcpyAtoHAsync", {"hipMemcpyAtoHAsync", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuMemcpyAtoHAsync_v2", {"hipMemcpyAtoHAsync", "", CONV_MEMORY, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
@@ -399,14 +409,14 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
// NOTE: Not equal to cudaFuncSetCacheConfig due to different signatures
|
||||
{"cuFuncSetCacheConfig", {"hipFuncSetCacheConfig", "", CONV_EXECUTION, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
// NOTE: Not equal to cudaFuncSetCacheConfig due to different signatures
|
||||
// NOTE: Not equal to cudaFuncSetSharedMemConfig due to different signatures
|
||||
{"cuFuncSetSharedMemConfig", {"hipFuncSetSharedMemConfig", "", CONV_EXECUTION, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
// NOTE: Not equal to cudaLaunchCooperativeKernel due to different signatures
|
||||
{"cuLaunchCooperativeKernel", {"hipLaunchCooperativeKernel", "", CONV_EXECUTION, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuLaunchCooperativeKernel", {"hipLaunchCooperativeKernel_", "", CONV_EXECUTION, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
// NOTE: Not equal to cudaLaunchCooperativeKernelMultiDevice due to different signatures
|
||||
{"cuLaunchCooperativeKernelMultiDevice", {"hipLaunchCooperativeKernelMultiDevice", "", CONV_EXECUTION, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuLaunchCooperativeKernelMultiDevice", {"hipLaunchCooperativeKernelMultiDevice_", "", CONV_EXECUTION, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// cudaLaunchHostFunc
|
||||
{"cuLaunchHostFunc", {"hipLaunchHostFunc", "", CONV_EXECUTION, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
@@ -632,10 +642,12 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP{
|
||||
{"cuGLCtxCreate", {"hipGLCtxCreate", "", CONV_OPENGL, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
{"cuGLInit", {"hipGLInit", "", CONV_OPENGL, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
// NOTE: Not equal to cudaGLMapBufferObject due to different signatures
|
||||
{"cuGLMapBufferObject", {"hipGLMapBufferObject", "", CONV_OPENGL, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuGLMapBufferObject", {"hipGLMapBufferObject_", "", CONV_OPENGL, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// no analogue
|
||||
// NOTE: Not equal to cudaGLMapBufferObjectAsync due to different signatures
|
||||
{"cuGLMapBufferObjectAsync", {"hipGLMapBufferObjectAsync", "", CONV_OPENGL, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
{"cuGLMapBufferObjectAsync", {"hipGLMapBufferObjectAsync_", "", CONV_OPENGL, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// cudaGLRegisterBufferObject
|
||||
{"cuGLRegisterBufferObject", {"hipGLRegisterBufferObject", "", CONV_OPENGL, API_DRIVER, HIP_UNSUPPORTED}},
|
||||
// cudaGLSetBufferObjectMapFlags
|
||||
|
||||
檔案差異因為檔案過大而無法顯示
載入差異
@@ -283,7 +283,7 @@ int main(int argc, char* argv[]) {
|
||||
CURAND_CALL(curandGetVersion(&version));
|
||||
int runtime_version;
|
||||
// cudaRuntimeGetVersion is yet unsupported by HIP
|
||||
// CHECK-NOT: CUDA_CALL(hipRuntimeGetVersion(&runtime_version));
|
||||
// CHECK: CUDA_CALL(hipRuntimeGetVersion(&runtime_version));
|
||||
CUDA_CALL(cudaRuntimeGetVersion(&runtime_version));
|
||||
int device_id;
|
||||
// CHECK: CUDA_CALL(hipGetDevice(&device_id));
|
||||
|
||||
@@ -621,7 +621,7 @@ int main(int argc, char *argv[])
|
||||
CURAND_CALL(curandGetVersion(&version));
|
||||
int runtime_version;
|
||||
// cudaRuntimeGetVersion is yet unsupported by HIP
|
||||
// CHECK-NOT: CUDA_CALL(hipRuntimeGetVersion(&runtime_version));
|
||||
// CHECK: CUDA_CALL(hipRuntimeGetVersion(&runtime_version));
|
||||
CUDA_CALL(cudaRuntimeGetVersion(&runtime_version));
|
||||
int device_id;
|
||||
// CHECK: CUDA_CALL(hipGetDevice(&device_id));
|
||||
|
||||
新增問題並參考
封鎖使用者