Skip to content

Commit

Permalink
Merge pull request #1792 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][SWDEV-501197][RT][6.4.0] Experimental support for `hipGraphExecBatchMemOpNodeSetParams` API
  • Loading branch information
emankov authored Dec 13, 2024
2 parents 57c535a + 439899e commit 6de0424
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,7 @@ my %removed_funcs = (
my %experimental_funcs = (
"cuStreamBatchMemOp_v2" => "6.4.0",
"cuStreamBatchMemOp" => "6.4.0",
"cuGraphExecBatchMemOpNodeSetParams" => "6.4.0",
"cuGraphBatchMemOpNodeSetParams" => "6.4.0",
"cuGraphBatchMemOpNodeGetParams" => "6.4.0",
"cuGraphAddBatchMemOpNode" => "6.4.0",
Expand Down Expand Up @@ -1554,6 +1555,7 @@ sub experimentalSubstitutions {
subst("cuGraphAddBatchMemOpNode", "hipGraphAddBatchMemOpNode", "graph");
subst("cuGraphBatchMemOpNodeGetParams", "hipGraphBatchMemOpNodeGetParams", "graph");
subst("cuGraphBatchMemOpNodeSetParams", "hipGraphBatchMemOpNodeSetParams", "graph");
subst("cuGraphExecBatchMemOpNodeSetParams", "hipGraphExecBatchMemOpNodeSetParams", "graph");
subst("CUDA_BATCH_MEM_OP_NODE_PARAMS", "hipBatchMemOpNodeParams", "type");
subst("CUDA_BATCH_MEM_OP_NODE_PARAMS_st", "hipBatchMemOpNodeParams", "type");
subst("CUDA_BATCH_MEM_OP_NODE_PARAMS_v1", "hipBatchMemOpNodeParams", "type");
Expand Down Expand Up @@ -4118,7 +4120,6 @@ sub simpleSubstitutions {
subst("cuGraphEventRecordNodeSetEvent", "hipGraphEventRecordNodeSetEvent", "graph");
subst("cuGraphEventWaitNodeGetEvent", "hipGraphEventWaitNodeGetEvent", "graph");
subst("cuGraphEventWaitNodeSetEvent", "hipGraphEventWaitNodeSetEvent", "graph");
subst("cuGraphExecBatchMemOpNodeSetParams", "hipGraphExecBatchMemOpNodeSetParams", "graph");
subst("cuGraphExecChildGraphNodeSetParams", "hipGraphExecChildGraphNodeSetParams", "graph");
subst("cuGraphExecDestroy", "hipGraphExecDestroy", "graph");
subst("cuGraphExecEventRecordNodeSetEvent", "hipGraphExecEventRecordNodeSetEvent", "graph");
Expand Down
2 changes: 1 addition & 1 deletion docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@
|`cuGraphEventRecordNodeSetEvent`|11.1| | | |`hipGraphEventRecordNodeSetEvent`|5.0.0| | | | |
|`cuGraphEventWaitNodeGetEvent`|11.1| | | |`hipGraphEventWaitNodeGetEvent`|5.0.0| | | | |
|`cuGraphEventWaitNodeSetEvent`|11.1| | | |`hipGraphEventWaitNodeSetEvent`|5.0.0| | | | |
|`cuGraphExecBatchMemOpNodeSetParams`|11.7| | | |`hipGraphExecBatchMemOpNodeSetParams`| | | | | |
|`cuGraphExecBatchMemOpNodeSetParams`|11.7| | | |`hipGraphExecBatchMemOpNodeSetParams`|6.4.0| | | |6.4.0|
|`cuGraphExecChildGraphNodeSetParams`|11.1| | | |`hipGraphExecChildGraphNodeSetParams`|5.0.0| | | | |
|`cuGraphExecDestroy`|10.0| | | |`hipGraphExecDestroy`|4.3.0| | | | |
|`cuGraphExecEventRecordNodeSetEvent`|11.1| | | |`hipGraphExecEventRecordNodeSetEvent`|5.0.0| | | | |
Expand Down
5 changes: 3 additions & 2 deletions src/CUDA2HIP_Driver_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_FUNCTION_MAP {
{"cuGraphBatchMemOpNodeGetParams", {"hipGraphBatchMemOpNodeGetParams", "", CONV_GRAPH, API_DRIVER, SEC::GRAPH, HIP_EXPERIMENTAL}},
// no analogue yet
{"cuGraphBatchMemOpNodeSetParams", {"hipGraphBatchMemOpNodeSetParams", "", CONV_GRAPH, API_DRIVER, SEC::GRAPH, HIP_EXPERIMENTAL}},
//
{"cuGraphExecBatchMemOpNodeSetParams", {"hipGraphExecBatchMemOpNodeSetParams", "", CONV_GRAPH, API_DRIVER, SEC::GRAPH}},
// no analogue yet
{"cuGraphExecBatchMemOpNodeSetParams", {"hipGraphExecBatchMemOpNodeSetParams", "", CONV_GRAPH, API_DRIVER, SEC::GRAPH, HIP_EXPERIMENTAL}},
// cudaGraphInstantiateWithParams
{"cuGraphInstantiateWithParams", {"hipGraphInstantiateWithParams", "", CONV_GRAPH, API_DRIVER, SEC::GRAPH}},
// cudaGraphExecGetFlags
Expand Down Expand Up @@ -1669,6 +1669,7 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_DRIVER_FUNCTION_VER_MAP {
{"hipGraphAddBatchMemOpNode", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}},
{"hipGraphBatchMemOpNodeGetParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}},
{"hipGraphBatchMemOpNodeSetParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}},
{"hipGraphExecBatchMemOpNodeSetParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}},
};

const std::map<llvm::StringRef, cudaAPIChangedVersions> CUDA_DRIVER_FUNCTION_CHANGED_VER_MAP {
Expand Down
5 changes: 5 additions & 0 deletions tests/unit_tests/synthetic/driver_functions.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,11 @@ int main() {
// HIP: hipError_t hipGraphBatchMemOpNodeSetParams(hipGraphNode_t hNode, hipBatchMemOpNodeParams* nodeParams);
// CHECK: result = hipGraphBatchMemOpNodeSetParams(graphNode, &BATCH_MEM_OP_NODE_PARAMS);
result = cuGraphBatchMemOpNodeSetParams(graphNode, &BATCH_MEM_OP_NODE_PARAMS);

// CUDA: CUresult CUDAAPI cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS *nodeParams);
// HIP: hipError_t hipGraphExecBatchMemOpNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t hNode, const hipBatchMemOpNodeParams* nodeParams);
// CHECK: result = hipGraphExecBatchMemOpNodeSetParams(graphExec, graphNode, &BATCH_MEM_OP_NODE_PARAMS);
result = cuGraphExecBatchMemOpNodeSetParams(graphExec, graphNode, &BATCH_MEM_OP_NODE_PARAMS);
#endif

#if CUDA_VERSION >= 12000
Expand Down

0 comments on commit 6de0424

Please sign in to comment.