From 8a1939c80f7c02137a15cbd85aaf3a96e4e2d916 Mon Sep 17 00:00:00 2001 From: sdashmiz Date: Mon, 2 Oct 2023 10:37:41 -0400 Subject: [PATCH] SWDEV-421021 - add hipDrvGraphAddMemsetNode Signed-off-by: sdashmiz Change-Id: Id3fbfc0d9b663f74ed1b76f5aa32dea904b1eec6 [ROCm/hip commit: ffefac3a8d6c8191094599c842530b2df1d37a74] --- projects/hip/include/hip/hip_runtime_api.h | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index b63ffda448..c060b5b09a 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -1203,6 +1203,18 @@ typedef union hipKernelNodeAttrValue { int cooperative; } hipKernelNodeAttrValue; +/** + * Memset node params + */ +typedef struct HIP_MEMSET_NODE_PARAMS { + hipDeviceptr_t dst; ///< Destination pointer on device + size_t pitch; ///< Destination device pointer pitch. Unused if height equals 1 + unsigned int value; ///< Value of memset to be set + unsigned int elementSize; ///< Element in bytes. Must be 1, 2, or 4. + size_t width; ///< Width of a row + size_t height; ///< Number of rows +} HIP_MEMSET_NODE_PARAMS; + /** * Graph execution update result */ @@ -7613,6 +7625,24 @@ hipError_t hipDrvGraphMemcpyNodeGetParams(hipGraphNode_t hNode, HIP_MEMCPY3D* no * it is still open to changes and may have outstanding issues. */ hipError_t hipDrvGraphMemcpyNodeSetParams(hipGraphNode_t hNode, const HIP_MEMCPY3D* nodeParams); + +/** + * @brief Creates a memset node and adds it to a graph. + * + * @param [out] phGraphNode - pointer to graph node to create. + * @param [in] hGraph - instance of graph to add the created node to. + * @param [in] dependencies - const pointer to the dependencies on the memset execution node. + * @param [in] numDependencies - number of the dependencies. + * @param [in] memsetParams - const pointer to the parameters for the memory set. + * @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 hipDrvGraphAddMemsetNode(hipGraphNode_t* phGraphNode, hipGraph_t hGraph, + const hipGraphNode_t* dependencies, size_t numDependencies, + const HIP_MEMSET_NODE_PARAMS* memsetParams, hipCtx_t ctx); + // doxygen end graph API /** * @}