From 1086e1966342f7520dac691981513cbe0ff2721c Mon Sep 17 00:00:00 2001 From: sdashmiz Date: Mon, 15 Jan 2024 11:01:38 -0500 Subject: [PATCH] SWDEV-420016 - Add driver side graph APIs Signed-off-by: sdashmiz Change-Id: Ie30818495ffe66c664b9353b109a03b9c4fa03fe [ROCm/hip commit: f6e0b832b069b8142690b57e426c5eb6dd755442] --- projects/hip/include/hip/hip_runtime_api.h | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index 8e3cd80604..5766d7e324 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -7936,6 +7936,50 @@ hipError_t hipDrvGraphAddMemsetNode(hipGraphNode_t* phGraphNode, hipGraph_t hGra const hipGraphNode_t* dependencies, size_t numDependencies, const HIP_MEMSET_NODE_PARAMS* memsetParams, hipCtx_t ctx); +/** + * @brief Creates a memory free node and adds it to a graph + * + * @param [out] pGraphNode - Pointer to the graph node to create and add to the graph + * @param [in] hGraph - Instane of the graph the node to be added + * @param [in] dependencies - Const pointer to the node dependenties + * @param [in] numDependencies - The number of dependencies + * @param [in] dptr - Pointer to the memory to be freed + * @returns #hipSuccess, #hipErrorInvalidValue + * @warning : This API is marked as beta, meaning, while this is feature complete, + * it is still open to changes and may have outstanding issues. + */ +hipError_t hipDrvGraphAddMemFreeNode(hipGraphNode_t* phGraphNode, hipGraph_t hGraph, + const hipGraphNode_t* dependencies, size_t numDependencies, + hipDeviceptr_t dptr); + +/** + * @brief Sets the parameters for a memcpy node in the given graphExec. + * + * @param [in] hGraphExec - instance of the executable graph with the node. + * @param [in] hNode - instance of the node to set parameters to. + * @param [in] copyParams - const pointer to the memcpy node params. + * @param [in] ctx - cotext related to current device. + * @returns #hipSuccess, #hipErrorInvalidValue + * @warning : This API is marked as beta, meaning, while this is feature complete, + * it is still open to changes and may have outstanding issues. + */ +hipError_t hipDrvGraphExecMemcpyNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t hNode, + const HIP_MEMCPY3D* copyParams, hipCtx_t ctx); + +/** + * @brief Sets the parameters for a memset node in the given graphExec. + * + * @param [in] hGraphExec - instance of the executable graph with the node. + * @param [in] hNode - instance of the node to set parameters to. + * @param [in] memsetParams - pointer to the parameters. + * @param [in] ctx - cotext related to current device. + * @returns #hipSuccess, #hipErrorInvalidValue + * @warning : This API is marked as beta, meaning, while this is feature complete, + * it is still open to changes and may have outstanding issues. + */ +hipError_t hipDrvGraphExecMemsetNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t hNode, + const HIP_MEMSET_NODE_PARAMS* memsetParams, hipCtx_t ctx); + // doxygen end graph API /** * @}