Skip to content

Commit

Permalink
[HIPIFY] Add support for CUDA 11.6 Driver API functions only
Browse files Browse the repository at this point in the history
+ Update hipify-perl accordingly
+ Update CUDA_Driver_API_functions_supported_by_HIP.md accordingly
  • Loading branch information
emankov committed Jan 20, 2022
1 parent 20ac0f8 commit dff1269
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -5846,6 +5846,7 @@ sub warnUnsupportedFunctions {
"cuOccupancyAvailableDynamicSMemPerBlock",
"cuModuleLoadFatBinary",
"cuModuleGetSurfRef",
"cuMipmappedArrayGetMemoryRequirements",
"cuMemsetD2D8_v2",
"cuMemsetD2D8Async",
"cuMemsetD2D8",
Expand Down Expand Up @@ -5928,6 +5929,8 @@ sub warnUnsupportedFunctions {
"cuGraphUpload",
"cuGraphRetainUserObject",
"cuGraphReleaseUserObject",
"cuGraphNodeSetEnabled",
"cuGraphNodeGetEnabled",
"cuGraphMemFreeNodeGetParams",
"cuGraphMemAllocNodeGetParams",
"cuGraphKernelNodeSetAttribute",
Expand Down Expand Up @@ -6036,6 +6039,7 @@ sub warnUnsupportedFunctions {
"cuCtxAttach",
"cuArrayGetSparseProperties",
"cuArrayGetPlane",
"cuArrayGetMemoryRequirements",
"cuArrayGetDescriptor_v2",
"cuArrayGetDescriptor",
"cuArray3DGetDescriptor_v2",
Expand Down
4 changes: 4 additions & 0 deletions doc/markdown/CUDA_Driver_API_functions_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,7 @@
|`cuArrayDestroy`| | | |`hipArrayDestroy`|4.2.0| | | |
|`cuArrayGetDescriptor`| | | | | | | | |
|`cuArrayGetDescriptor_v2`| | | | | | | | |
|`cuArrayGetMemoryRequirements`|11.6| | | | | | | |
|`cuArrayGetPlane`|11.2| | | | | | | |
|`cuArrayGetSparseProperties`|11.1| | | | | | | |
|`cuDeviceGetByPCIBusId`| | | |`hipDeviceGetByPCIBusId`|1.6.0| | | |
Expand Down Expand Up @@ -1308,6 +1309,7 @@
|`cuMipmappedArrayCreate`| | | |`hipMipmappedArrayCreate`|3.5.0| | | |
|`cuMipmappedArrayDestroy`| | | |`hipMipmappedArrayDestroy`|3.5.0| | | |
|`cuMipmappedArrayGetLevel`| | | |`hipMipmappedArrayGetLevel`|3.5.0| | | |
|`cuMipmappedArrayGetMemoryRequirements`|11.6| | | | | | | |

## **12. Virtual Memory Management**

Expand Down Expand Up @@ -1521,7 +1523,9 @@
|`cuGraphNodeFindInClone`|10.0| | |`hipGraphNodeFindInClone`|5.0.0| | |5.0.0|
|`cuGraphNodeGetDependencies`|10.0| | |`hipGraphNodeGetDependencies`|5.0.0| | |5.0.0|
|`cuGraphNodeGetDependentNodes`|10.0| | |`hipGraphNodeGetDependentNodes`|5.0.0| | |5.0.0|
|`cuGraphNodeGetEnabled`|11.6| | | | | | | |
|`cuGraphNodeGetType`|10.0| | |`hipGraphNodeGetType`|5.0.0| | |5.0.0|
|`cuGraphNodeSetEnabled`|11.6| | | | | | | |
|`cuGraphReleaseUserObject`|11.3| | | | | | | |
|`cuGraphRemoveDependencies`|10.0| | |`hipGraphRemoveDependencies`|5.0.0| | |5.0.0|
|`cuGraphRetainUserObject`|11.3| | | | | | | |
Expand Down
12 changes: 12 additions & 0 deletions src/CUDA2HIP_Driver_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP {
{"cuArrayDestroy", {"hipArrayDestroy", "", CONV_MEMORY, API_DRIVER, 11}},
{"cuArrayGetDescriptor", {"hipArrayGetDescriptor", "", CONV_MEMORY, API_DRIVER, 11, HIP_UNSUPPORTED}},
{"cuArrayGetDescriptor_v2", {"hipArrayGetDescriptor", "", CONV_MEMORY, API_DRIVER, 11, HIP_UNSUPPORTED}},
//
{"cuMipmappedArrayGetMemoryRequirements", {"hipMipmappedArrayGetMemoryRequirements", "", CONV_MEMORY, API_DRIVER, 11, HIP_UNSUPPORTED}},
//
{"cuArrayGetMemoryRequirements", {"hipArrayGetMemoryRequirements", "", CONV_MEMORY, API_DRIVER, 11, HIP_UNSUPPORTED}},
// cudaDeviceGetByPCIBusId
{"cuDeviceGetByPCIBusId", {"hipDeviceGetByPCIBusId", "", CONV_MEMORY, API_DRIVER, 11}},
// cudaDeviceGetPCIBusId
Expand Down Expand Up @@ -623,8 +627,12 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP {
{"cuGraphNodeGetDependencies", {"hipGraphNodeGetDependencies", "", CONV_GRAPH, API_DRIVER, 21, HIP_EXPERIMENTAL}},
// cudaGraphNodeGetDependentNodes
{"cuGraphNodeGetDependentNodes", {"hipGraphNodeGetDependentNodes", "", CONV_GRAPH, API_DRIVER, 21, HIP_EXPERIMENTAL}},
//
{"cuGraphNodeGetEnabled", {"hipGraphNodeGetEnabled", "", CONV_GRAPH, API_DRIVER, 21, HIP_UNSUPPORTED}},
// cudaGraphNodeGetType
{"cuGraphNodeGetType", {"hipGraphNodeGetType", "", CONV_GRAPH, API_DRIVER, 21, HIP_EXPERIMENTAL}},
//
{"cuGraphNodeSetEnabled", {"hipGraphNodeSetEnabled", "", CONV_GRAPH, API_DRIVER, 21, HIP_UNSUPPORTED}},
// cudaGraphRemoveDependencies
{"cuGraphRemoveDependencies", {"hipGraphRemoveDependencies", "", CONV_GRAPH, API_DRIVER, 21, HIP_EXPERIMENTAL}},
// no analogue
Expand Down Expand Up @@ -1235,6 +1243,10 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_DRIVER_FUNCTION_VER_MAP {
{"cuDeviceGetGraphMemAttribute", {CUDA_114, CUDA_0, CUDA_0 }},
{"cuDeviceSetGraphMemAttribute", {CUDA_114, CUDA_0, CUDA_0 }},
{"cuGraphInstantiateWithFlags", {CUDA_114, CUDA_0, CUDA_0 }},
{"cuArrayGetMemoryRequirements", {CUDA_116, CUDA_0, CUDA_0 }},
{"cuMipmappedArrayGetMemoryRequirements", {CUDA_116, CUDA_0, CUDA_0 }},
{"cuGraphNodeSetEnabled", {CUDA_116, CUDA_0, CUDA_0 }},
{"cuGraphNodeGetEnabled", {CUDA_116, CUDA_0, CUDA_0 }},
};

const std::map<llvm::StringRef, hipAPIversions> HIP_DRIVER_FUNCTION_VER_MAP {
Expand Down

0 comments on commit dff1269

Please sign in to comment.