SWDEV-527781 - Remove Stream Validation in HIP APIs

This commit is contained in:
Xie, Pengda
2025-05-13 13:45:27 -07:00
committed by GitHub
parent f7482ef0a6
commit 0457b634f8
7 changed files with 21 additions and 68 deletions
+5 -18
View File
@@ -42,9 +42,7 @@ inline hipError_t ihipGraphUpload(hipGraphExec_t graphExec, hipStream_t stream)
if (graphExec == nullptr) {
return hipErrorInvalidValue;
}
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
getStreamPerThread(stream);
if (!hip::GraphExec::isGraphExecValid(reinterpret_cast<hip::GraphExec*>(graphExec))) {
return hipErrorInvalidValue;
}
@@ -1026,9 +1024,7 @@ hipError_t hipStreamIsCapturing_common(hipStream_t stream, hipStreamCaptureStatu
if (pCaptureStatus == nullptr) {
return hipErrorInvalidValue;
}
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
getStreamPerThread(stream);
if (hip::Stream::StreamCaptureBlocking() == true &&
(stream == nullptr || stream == hipStreamLegacy)) {
return hipErrorStreamCaptureImplicit;
@@ -1069,9 +1065,7 @@ hipError_t hipThreadExchangeStreamCaptureMode(hipStreamCaptureMode* mode) {
hipError_t hipStreamBeginCapture_common(hipStream_t stream, hipStreamCaptureMode mode,
hipGraph_t graph = nullptr) {
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
getStreamPerThread(stream);
// capture cannot be initiated on legacy stream
if (stream == nullptr || stream == hipStreamLegacy) {
return hipErrorStreamCaptureUnsupported;
@@ -1591,9 +1585,7 @@ hipError_t hipGraphExecDestroy(hipGraphExec_t pGraphExec) {
}
hipError_t ihipGraphLaunch(hip::GraphExec* graphExec, hipStream_t stream) {
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
getStreamPerThread(stream);
hip::Stream* launch_stream = hip::getStream(stream);
return graphExec->Run(launch_stream);
}
@@ -1605,9 +1597,6 @@ hipError_t hipGraphLaunch_common(hip::GraphExec* graphExec, hipStream_t stream)
if (graphExec->GetNodeCount() == 0) {
return hipSuccess;
}
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
return ihipGraphLaunch(graphExec, stream);
}
@@ -2004,9 +1993,7 @@ hipError_t hipStreamGetCaptureInfo_common(hipStream_t stream,
if (pCaptureStatus == nullptr) {
return hipErrorInvalidValue;
}
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
getStreamPerThread(stream);
if (hip::Stream::StreamCaptureBlocking() == true &&
(stream == nullptr || stream == hipStreamLegacy)) {
return hipErrorStreamCaptureImplicit;