SWDEV-534394 - Kernel launch stream check (#533)

hipErrorInvalidResourceHandle is returned if stream is not on the launching device
Цей коміт міститься в:
Xie, Pengda
2025-08-05 10:39:37 -07:00
зафіксовано GitHub
джерело 4121a860bf
коміт 7e777d3755
2 змінених файлів з 6 додано та 3 видалено
+3 -3
Переглянути файл
@@ -374,7 +374,7 @@ hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop) {
hip::Event* eStop = reinterpret_cast<hip::Event*>(stop);
if (eStart->deviceId() != eStop->deviceId()) {
HIP_RETURN(hipErrorInvalidHandle);
HIP_RETURN(hipErrorInvalidResourceHandle);
}
HIP_RETURN(eStart->elapsedTime(*eStop, *ms), "Elapsed Time = ", *ms);
@@ -414,8 +414,8 @@ hipError_t hipEventRecord_common(hipEvent_t event, hipStream_t stream, unsigned
s->SetLastCapturedNode(pGraphNode);
}
} else {
if (g_devices[e->deviceId()]->devices()[0] != &hip_stream->device()) {
return hipErrorInvalidHandle;
if (e->deviceId() != hip_stream->DeviceId()) {
return hipErrorInvalidResourceHandle;
}
status = e->addMarker(hip_stream, nullptr, !hip::Event::kBatchFlush);
}
+3
Переглянути файл
@@ -429,6 +429,9 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, amd::LaunchParams& launch_par
uint64_t prevGridSum = 0, uint64_t allGridSum = 0,
uint32_t firstDevice = 0) {
int deviceId = hip::Stream::DeviceId(hStream);
if (deviceId != ihipGetDevice()) {
return hipErrorInvalidResourceHandle;
}
HIP_RETURN_ONFAIL(PlatformState::instance().initStatManagedVarDevicePtr(deviceId));
if (f == nullptr) {