SWDEV-477324 - Graph Capture memcpy D2D
Change-Id: Ifaa4d78854c03b3150233142df187c9bbf731cab
[ROCm/clr commit: e98179d924]
Tá an tiomantas seo le fáil i:
tiomanta ag
Anusha Godavarthy Surya
tuismitheoir
71d97112cc
tiomantas
fc014587f8
@@ -1202,8 +1202,16 @@ hipError_t hipGraphExecMemcpyNodeSetParams1D(hipGraphExec_t hGraphExec, hipGraph
|
|||||||
if (oldkind != kind) {
|
if (oldkind != kind) {
|
||||||
HIP_RETURN(hipErrorInvalidValue);
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
}
|
}
|
||||||
HIP_RETURN(reinterpret_cast<hip::GraphMemcpyNode1D*>(clonedNode)->SetParams(dst, src,
|
hipError_t status = reinterpret_cast<hip::GraphMemcpyNode1D*>(clonedNode)->SetParams(dst, src,
|
||||||
count, kind));
|
count, kind);
|
||||||
|
if (status != hipSuccess) {
|
||||||
|
HIP_RETURN(status);
|
||||||
|
}
|
||||||
|
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||||
|
status = reinterpret_cast<hip::GraphExec*>(hGraphExec)
|
||||||
|
->UpdateAQLPacket(reinterpret_cast<hip::GraphKernelNode*>(clonedNode));
|
||||||
|
}
|
||||||
|
HIP_RETURN(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
hipError_t hipGraphAddMemsetNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
hipError_t hipGraphAddMemsetNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||||
@@ -1612,7 +1620,15 @@ hipError_t hipGraphExecMemcpyNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
|
|||||||
if (oldkind != newkind) {
|
if (oldkind != newkind) {
|
||||||
HIP_RETURN(hipErrorInvalidValue);
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
}
|
}
|
||||||
HIP_RETURN(reinterpret_cast<hip::GraphMemcpyNode*>(clonedNode)->SetParams(pNodeParams));
|
hipError_t status = reinterpret_cast<hip::GraphMemcpyNode*>(clonedNode)->SetParams(pNodeParams);
|
||||||
|
if (status != hipSuccess) {
|
||||||
|
HIP_RETURN(status);
|
||||||
|
}
|
||||||
|
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||||
|
status = reinterpret_cast<hip::GraphExec*>(hGraphExec)
|
||||||
|
->UpdateAQLPacket(reinterpret_cast<hip::GraphKernelNode*>(clonedNode));
|
||||||
|
}
|
||||||
|
HIP_RETURN(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
hipError_t hipGraphMemsetNodeGetParams(hipGraphNode_t node, hipMemsetParams* pNodeParams) {
|
hipError_t hipGraphMemsetNodeGetParams(hipGraphNode_t node, hipMemsetParams* pNodeParams) {
|
||||||
@@ -2181,8 +2197,16 @@ hipError_t hipGraphExecMemcpyNodeSetParamsFromSymbol(hipGraphExec_t hGraphExec,
|
|||||||
HIP_RETURN(hipErrorInvalidValue);
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
}
|
}
|
||||||
constexpr bool kCheckDeviceIsSame = true;
|
constexpr bool kCheckDeviceIsSame = true;
|
||||||
HIP_RETURN(reinterpret_cast<hip::GraphMemcpyNodeFromSymbol*>(clonedNode)
|
hipError_t status = reinterpret_cast<hip::GraphMemcpyNodeFromSymbol*>(clonedNode)
|
||||||
->SetParams(dst, symbol, count, offset, kind, kCheckDeviceIsSame));
|
->SetParams(dst, symbol, count, offset, kind, kCheckDeviceIsSame);
|
||||||
|
if (status != hipSuccess) {
|
||||||
|
HIP_RETURN(status);
|
||||||
|
}
|
||||||
|
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||||
|
status = reinterpret_cast<hip::GraphExec*>(hGraphExec)
|
||||||
|
->UpdateAQLPacket(reinterpret_cast<hip::GraphKernelNode*>(clonedNode));
|
||||||
|
}
|
||||||
|
HIP_RETURN(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
hipError_t hipGraphAddMemcpyNodeToSymbol(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
hipError_t hipGraphAddMemcpyNodeToSymbol(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||||
@@ -2255,8 +2279,16 @@ hipError_t hipGraphExecMemcpyNodeSetParamsToSymbol(hipGraphExec_t hGraphExec, hi
|
|||||||
HIP_RETURN(hipErrorInvalidValue);
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
}
|
}
|
||||||
constexpr bool kCheckDeviceIsSame = true;
|
constexpr bool kCheckDeviceIsSame = true;
|
||||||
HIP_RETURN(reinterpret_cast<hip::GraphMemcpyNodeToSymbol*>(clonedNode)
|
hipError_t status = reinterpret_cast<hip::GraphMemcpyNodeToSymbol*>(clonedNode)
|
||||||
->SetParams(symbol, src, count, offset, kind, kCheckDeviceIsSame));
|
->SetParams(symbol, src, count, offset, kind, kCheckDeviceIsSame);
|
||||||
|
if (status != hipSuccess) {
|
||||||
|
HIP_RETURN(status);
|
||||||
|
}
|
||||||
|
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||||
|
status = reinterpret_cast<hip::GraphExec*>(hGraphExec)
|
||||||
|
->UpdateAQLPacket(reinterpret_cast<hip::GraphKernelNode*>(clonedNode));
|
||||||
|
}
|
||||||
|
HIP_RETURN(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
hipError_t hipGraphAddEventRecordNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
hipError_t hipGraphAddEventRecordNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ struct GraphNode : public hipGraphNodeDOTAttribute {
|
|||||||
std::vector<uint8_t *> gpuPackets_; //!< GPU Packet to enqueue during graph launch
|
std::vector<uint8_t *> gpuPackets_; //!< GPU Packet to enqueue during graph launch
|
||||||
std::string capturedKernelName_;
|
std::string capturedKernelName_;
|
||||||
size_t alignedKernArgSize_ = 256; //!< Aligned size required for kernel args
|
size_t alignedKernArgSize_ = 256; //!< Aligned size required for kernel args
|
||||||
size_t kernargSegmentByteSize_ = 256; //!< Kernel arg segment byte size
|
size_t kernargSegmentByteSize_ = 512; //!< Kernel arg segment byte size
|
||||||
size_t kernargSegmentAlignment_ = 256; //!< Kernel arg segment alignment
|
size_t kernargSegmentAlignment_ = 256; //!< Kernel arg segment alignment
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -434,13 +434,11 @@ struct GraphNode : public hipGraphNodeDOTAttribute {
|
|||||||
unsigned int GetEnabled() const { return isEnabled_; }
|
unsigned int GetEnabled() const { return isEnabled_; }
|
||||||
void SetEnabled(unsigned int isEnabled) { isEnabled_ = isEnabled; }
|
void SetEnabled(unsigned int isEnabled) { isEnabled_ = isEnabled; }
|
||||||
// Returns true if capture is enabled for the current node.
|
// Returns true if capture is enabled for the current node.
|
||||||
bool GraphCaptureEnabled() {
|
virtual bool GraphCaptureEnabled() {
|
||||||
bool isGraphCapture = false;
|
bool isGraphCapture = false;
|
||||||
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||||
switch (GetType()) {
|
switch (GetType()) {
|
||||||
case hipGraphNodeTypeKernel:
|
case hipGraphNodeTypeKernel:
|
||||||
isGraphCapture = true;
|
|
||||||
break;
|
|
||||||
case hipGraphNodeTypeMemset:
|
case hipGraphNodeTypeMemset:
|
||||||
isGraphCapture = true;
|
isGraphCapture = true;
|
||||||
break;
|
break;
|
||||||
@@ -1525,6 +1523,19 @@ class GraphMemcpyNode : public GraphNode {
|
|||||||
return shape_;
|
return shape_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
virtual bool GraphCaptureEnabled() override {
|
||||||
|
bool isGraphCapture = false;
|
||||||
|
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||||
|
switch (copyParams_.kind) {
|
||||||
|
case hipMemcpyDeviceToDevice:
|
||||||
|
isGraphCapture = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isGraphCapture;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class GraphMemcpyNode1D : public GraphMemcpyNode {
|
class GraphMemcpyNode1D : public GraphMemcpyNode {
|
||||||
@@ -1704,6 +1715,19 @@ class GraphMemcpyNode1D : public GraphMemcpyNode {
|
|||||||
return shape_;
|
return shape_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
virtual bool GraphCaptureEnabled() override {
|
||||||
|
bool isGraphCapture = false;
|
||||||
|
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
|
||||||
|
switch (kind_) {
|
||||||
|
case hipMemcpyDeviceToDevice:
|
||||||
|
isGraphCapture = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isGraphCapture;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class GraphMemcpyNodeFromSymbol : public GraphMemcpyNode1D {
|
class GraphMemcpyNodeFromSymbol : public GraphMemcpyNode1D {
|
||||||
|
|||||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir