SWDEV-405485 - move the param validation

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: Ic3a27c47a88954da866a91494bcfb8721f33ad2b


[ROCm/clr commit: 2cdaf7e80f]
Этот коммит содержится в:
sdashmiz
2023-06-21 14:43:57 -04:00
коммит произвёл Maneesh Gupta
родитель 867d1fc66f
Коммит 6c174f79fa
2 изменённых файлов: 5 добавлений и 4 удалений
+1
Просмотреть файл
@@ -389,6 +389,7 @@ hipError_t hipEventRecord_common(hipEvent_t event, hipStream_t stream) {
if (event == nullptr) {
return hipErrorInvalidHandle;
}
getStreamPerThread(stream);
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
+4 -4
Просмотреть файл
@@ -31,7 +31,7 @@ namespace hip {
// ================================================================================================
Stream::Stream(hip::Device* dev, Priority p, unsigned int f, bool null_stream,
const std::vector<uint32_t>& cuMask, hipStreamCaptureStatus captureStatus)
: amd::HostQueue(*dev->asContext(), *dev->devices()[0], 0, amd::CommandQueue::RealTimeDisabled,
: amd::HostQueue(*dev->asContext(), *dev->devices()[0], 0, amd::CommandQueue::RealTimeDisabled,
convertToQueuePriority(p), cuMask),
lock_("Stream Callback lock"),
device_(dev),
@@ -518,9 +518,6 @@ hipError_t hipStreamWaitEvent_common(hipStream_t stream, hipEvent_t event, unsig
if (event == nullptr) {
return hipErrorInvalidHandle;
}
if (stream == nullptr) {
return hipErrorInvalidValue;
}
if (!hip::isValid(stream)) {
return hipErrorContextIsDestroyed;
}
@@ -529,6 +526,9 @@ hipError_t hipStreamWaitEvent_common(hipStream_t stream, hipEvent_t event, unsig
hip::Stream* eventStream = reinterpret_cast<hip::Stream*>(e->GetCaptureStream());
if (eventStream != nullptr && eventStream->IsEventCaptured(event) == true) {
if (waitStream == nullptr) {
return hipErrorInvalidHandle;
}
if (!waitStream->IsOriginStream()) {
waitStream->SetCaptureGraph((eventStream)->GetCaptureGraph());
waitStream->SetCaptureId((eventStream)->GetCaptureID());