From 9e3c65ccbd259fabfad45005f554e310f782d90b Mon Sep 17 00:00:00 2001 From: sdashmiz Date: Mon, 4 Apr 2022 16:22:16 -0400 Subject: [PATCH] SWDEV-325711 - add Graph memory APIs skeleton - hipDeviceGet/SetGraphMemAttr - hipDeviceGraphMemTrim - there is no memory pool for graphs currently Signed-off-by: sdashmiz Change-Id: I11db76ea7ea1c7732175fc93264448052357e8dc --- .../hip/nvidia_detail/nvidia_hip_runtime_api.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h b/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h index b9e095a676..008d734b50 100644 --- a/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h +++ b/hipnv/include/hip/nvidia_detail/nvidia_hip_runtime_api.h @@ -1133,6 +1133,7 @@ typedef enum cudaStreamCaptureStatus hipStreamCaptureStatus; typedef union cudaKernelNodeAttrValue hipKernelNodeAttrValue; typedef enum cudaKernelNodeAttrID hipKernelNodeAttrID; +typedef enum cudaGraphMemAttributeType hipGraphMemAttributeType; #if CUDA_VERSION >= CUDA_11030 typedef enum cudaStreamUpdateCaptureDependenciesFlags hipStreamUpdateCaptureDependenciesFlags; @@ -3018,6 +3019,18 @@ inline static hipError_t hipGraphExecEventWaitNodeSetEvent(hipGraphExec_t hGraph hipGraphNode_t hNode, hipEvent_t event) { return hipCUDAErrorTohipError(cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event)); } + +inline static hipError_t hipDeviceGetGraphMemAttribute(int device, hipGraphMemAttributeType attr, void* value) { + return hipCUDAErrorTohipError(cudaDeviceGetGraphMemAttribute(device, attr, value)); +} + +inline static hipError_t hipDeviceSetGraphMemAttribute(int device, hipGraphMemAttributeType attr, void* value) { + return hipCUDAErrorTohipError(cudaDeviceSetGraphMemAttribute(device, attr, value)); +} + +inline static hipError_t hipDeviceGraphMemTrim(int device) { + return hipCUDAErrorTohipError(cudaDeviceGraphMemTrim(device)); +} #endif inline static hipError_t hipGraphHostNodeSetParams(hipGraphNode_t node,