SWDEV-313905 - Fix segfault
Change-Id: I7b7bbe80a169014b5d4a8de134351b9f8bf11735
Tento commit je obsažen v:
odevzdal
Sarbojit Sarkar
rodič
c4f6037ae8
revize
017603703b
@@ -518,6 +518,10 @@ hipError_t hipLaunchCooperativeKernel(const void* f,
|
||||
HIP_INIT_API(hipLaunchCooperativeKernel, f, gridDim, blockDim,
|
||||
sharedMemBytes, hStream);
|
||||
|
||||
if (!hip::isValid(hStream)) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
hipFunction_t func = nullptr;
|
||||
int deviceId = hip::Stream::DeviceId(hStream);
|
||||
HIP_RETURN_ONFAIL(PlatformState::instance().getStatFunc(&func, f, deviceId));
|
||||
|
||||
@@ -169,7 +169,7 @@ int Stream::DeviceId(const hipStream_t hStream) {
|
||||
//return invalid device id
|
||||
return -1;
|
||||
}
|
||||
hip::Stream* s = reinterpret_cast<hip::Stream*>(hStream);
|
||||
hip::Stream* s = reinterpret_cast<hip::Stream*>(inputStream);
|
||||
int deviceId = (s != nullptr)? s->DeviceId() : ihipGetDevice();
|
||||
assert(deviceId >= 0 && deviceId < static_cast<int>(g_devices.size()));
|
||||
return deviceId;
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele