SWDEV-325711: Add userobject functions for graph

- add user obj APIs for creating release and retain of user onbjects

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I0bf2999c77e44269565b27c31c7c1461f8a160a2
Этот коммит содержится в:
sdashmiz
2022-04-25 13:42:17 -04:00
коммит произвёл Shadi Dashmiz
родитель 5a485e3393
Коммит d6cee2332a
+24
Просмотреть файл
@@ -1107,6 +1107,7 @@ inline static enum cudaChannelFormatKind hipChannelFormatKindToCudaChannelFormat
typedef cudaGraph_t hipGraph_t;
typedef cudaGraphNode_t hipGraphNode_t;
typedef cudaGraphExec_t hipGraphExec_t;
typedef cudaUserObject_t hipUserObject_t;
typedef enum cudaGraphNodeType hipGraphNodeType;
#define hipGraphNodeTypeKernel cudaGraphNodeTypeKernel
@@ -3232,6 +3233,29 @@ inline static hipError_t hipDeviceSetGraphMemAttribute(int device, hipGraphMemAt
inline static hipError_t hipDeviceGraphMemTrim(int device) {
return hipCUDAErrorTohipError(cudaDeviceGraphMemTrim(device));
}
inline static hipError_t hipUserObjectCreate(hipUserObject_t* object_out, void* ptr, hipHostFn_t destroy,
unsigned int initialRefcount, unsigned int flags) {
return hipCUDAErrorTohipError(cudaUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags));
}
inline static hipError_t hipUserObjectRelease(hipUserObject_t object, unsigned int count __dparm(1)) {
return hipCUDAErrorTohipError(cudaUserObjectRelease(object, count));
}
inline static hipError_t hipUserObjectRetain(hipUserObject_t object, unsigned int count __dparm(1)) {
return hipCUDAErrorTohipError(cudaUserObjectRelease(object, count));
}
inline static hipError_t hipGraphRetainUserObject(hipGraph_t graph, hipUserObject_t object, unsigned int count __dparm(1), unsigned int flags __dparm(0)) {
return hipCUDAErrorTohipError(cudaGraphRetainUserObject(graph, object, count, flags));
}
inline static hipError_t hipGraphReleaseUserObject(hipGraph_t graph, hipUserObject_t object, unsigned int count __dparm(1)) {
return hipCUDAErrorTohipError(cudaGraphReleaseUserObject(graph, object, count));
}
#endif
inline static hipError_t hipGraphHostNodeSetParams(hipGraphNode_t node,