SWDEV-534394 - Kernel launch stream check (#533)
hipErrorInvalidResourceHandle is returned if stream is not on the launching device
[ROCm/clr commit: 7e777d3755]
Этот коммит содержится в:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Ссылка в новой задаче
Block a user