SWDEV-374383 - Check from and to if no of dependencies are more than 0, Check from and to node are belongs to graph pass in.
Change-Id: I0cdafb497147f9ac7f84d40203a21e9eefd595a3
[ROCm/clr commit: bb486b04c6]
This commit is contained in:
gecommit door
Jaydeepkumar Patel
bovenliggende
87db95fad7
commit
d12bfbbb4d
@@ -1615,11 +1615,12 @@ hipError_t hipStreamUpdateCaptureDependencies(hipStream_t stream, hipGraphNode_t
|
|||||||
hipError_t hipGraphRemoveDependencies(hipGraph_t graph, const hipGraphNode_t* from,
|
hipError_t hipGraphRemoveDependencies(hipGraph_t graph, const hipGraphNode_t* from,
|
||||||
const hipGraphNode_t* to, size_t numDependencies) {
|
const hipGraphNode_t* to, size_t numDependencies) {
|
||||||
HIP_INIT_API(hipGraphRemoveDependencies, graph, from, to, numDependencies);
|
HIP_INIT_API(hipGraphRemoveDependencies, graph, from, to, numDependencies);
|
||||||
if (graph == nullptr || from == nullptr || to == nullptr) {
|
if (graph == nullptr || (numDependencies > 0 && (from == nullptr || to == nullptr))) {
|
||||||
HIP_RETURN(hipErrorInvalidValue);
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < numDependencies; i++) {
|
for (size_t i = 0; i < numDependencies; i++) {
|
||||||
if (from[i]->RemoveEdge(to[i]) == false) {
|
if (to[i]->GetParentGraph() != graph || from[i]->GetParentGraph() != graph ||
|
||||||
|
from[i]->RemoveEdge(to[i]) == false) {
|
||||||
HIP_RETURN(hipErrorInvalidValue);
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Verwijs in nieuw issue
Block a user