From 439899ec0bf4f9debf14ab02633c5977bb58e773 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Fri, 13 Dec 2024 19:25:50 +0100 Subject: [PATCH] [HIPIFY][SWDEV-501197][RT][6.4.0] Added experimental support for `hipGraphExecBatchMemOpNodeSetParams` API + Updated synthetic tests, the regenerated `hipify-perl`, and `Driver` `CUDA2HIP` docs accordingly --- bin/hipify-perl | 3 ++- docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md | 2 +- src/CUDA2HIP_Driver_API_functions.cpp | 5 +++-- tests/unit_tests/synthetic/driver_functions.cu | 5 +++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index f55158f2..a7234c13 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -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", @@ -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"); @@ -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"); diff --git a/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md b/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md index 0834ff28..2b948d6c 100644 --- a/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md +++ b/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md @@ -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| | | | | diff --git a/src/CUDA2HIP_Driver_API_functions.cpp b/src/CUDA2HIP_Driver_API_functions.cpp index 75ac7458..1d4b9819 100644 --- a/src/CUDA2HIP_Driver_API_functions.cpp +++ b/src/CUDA2HIP_Driver_API_functions.cpp @@ -814,8 +814,8 @@ const std::map 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 @@ -1669,6 +1669,7 @@ const std::map 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 CUDA_DRIVER_FUNCTION_CHANGED_VER_MAP { diff --git a/tests/unit_tests/synthetic/driver_functions.cu b/tests/unit_tests/synthetic/driver_functions.cu index f9b43eac..ec8fa722 100644 --- a/tests/unit_tests/synthetic/driver_functions.cu +++ b/tests/unit_tests/synthetic/driver_functions.cu @@ -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