SWDEV-353281 - Initial support of memalloc in graph
Add memory allocation support in graph. Current implementation uses cache from mempool to hold the allocations which belong to the graph. Also the resource tracking is disabled at this moment because mempool operates with hip::Stream objects, but graph has execution with amd::HostQueue objects. Change-Id: I54fe3250126d24f5a26ada975f37d429bb4ef17b
Этот коммит содержится в:
@@ -1340,6 +1340,10 @@ typedef struct cudaHostNodeParams hipHostNodeParams;
|
||||
typedef struct cudaKernelNodeParams hipKernelNodeParams;
|
||||
typedef struct cudaMemsetParams hipMemsetParams;
|
||||
|
||||
#if CUDA_VERSION >= CUDA_11040
|
||||
typedef struct cudaMemAllocNodeParams hipMemAllocNodeParams;
|
||||
#endif
|
||||
|
||||
typedef enum cudaGraphExecUpdateResult hipGraphExecUpdateResult;
|
||||
#define hipGraphExecUpdateSuccess cudaGraphExecUpdateSuccess
|
||||
#define hipGraphExecUpdateError cudaGraphExecUpdateError
|
||||
@@ -3208,6 +3212,30 @@ inline static hipError_t hipGraphInstantiateWithFlags(hipGraphExec_t* pGraphExec
|
||||
unsigned long long flags) {
|
||||
return hipCUDAErrorTohipError(cudaGraphInstantiateWithFlags(pGraphExec, graph, flags));
|
||||
}
|
||||
|
||||
inline hipError_t hipGraphAddMemAllocNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||
const hipGraphNode_t* pDependencies,
|
||||
size_t numDependencies,
|
||||
hipMemAllocNodeParams* pNodeParams) {
|
||||
return hipCUDAErrorTohipError(cudaGraphAddMemAllocNode(
|
||||
pGraphNode, graph, pDependencies, numDependencies, pNodeParams));
|
||||
}
|
||||
|
||||
inline hipError_t hipGraphMemAllocNodeGetParams(hipGraphNode_t node,
|
||||
hipMemAllocNodeParams* pNodeParams) {
|
||||
return hipCUDAErrorTohipError(cudaGraphMemAllocNodeGetParams(node, pNodeParams));
|
||||
}
|
||||
|
||||
inline hipError_t hipGraphAddMemFreeNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||
const hipGraphNode_t* pDependencies,
|
||||
size_t numDependencies, void* dev_ptr) {
|
||||
return hipCUDAErrorTohipError(cudaGraphAddMemFreeNode(
|
||||
pGraphNode, graph, pDependencies, numDependencies, dev_ptr));
|
||||
}
|
||||
|
||||
inline hipError_t hipGraphMemFreeNodeGetParams(hipGraphNode_t node, void* dev_ptr) {
|
||||
return hipCUDAErrorTohipError(cudaGraphMemFreeNodeGetParams(node, dev_ptr));
|
||||
}
|
||||
#endif
|
||||
inline static hipError_t hipGraphLaunch(hipGraphExec_t graphExec, hipStream_t stream) {
|
||||
return hipCUDAErrorTohipError(cudaGraphLaunch(graphExec, stream));
|
||||
|
||||
Ссылка в новой задаче
Block a user