SWDEV-283515 - Fix crashing in kernel launch on MGPUS

Fix wrong mixing of current device and stream device in
ihipModuleLaunchKernel() and hipLaunchCooperativeKernel().

Fix missing hipSetDevice() in hipMemcpyWithStream* tests.

Change-Id: I09333bb40d239bb42c832df5ea16d17eeaeff5e7


[ROCm/hip commit: a95ff95bf7]
This commit is contained in:
Tao Sang authored and Tao Sang committed 2021-04-29 14:46:47 -04:00
1 parent 4ed5ed1db8
commit bed2381766
7 files changed
+25 -20

No files matched your search

+1 -7
View File
@@ -621,14 +621,8 @@ hipError_t ihipLaunchKernel(const void* hostFunction,
hipEvent_t stopEvent,
int flags)
{
hip::Stream* s = reinterpret_cast<hip::Stream*>(stream);
int deviceId = (s != nullptr)? s->DeviceId() : ihipGetDevice();
if (deviceId == -1) {
LogPrintfError("Wrong Device Id: %d \n", deviceId);
HIP_RETURN(hipErrorNoDevice);
}
hipFunction_t func = nullptr;
int deviceId = hip::Stream::DeviceId(stream);
hipError_t hip_error = PlatformState::instance().getStatFunc(&func, hostFunction, deviceId);
if ((hip_error != hipSuccess) || (func == nullptr)) {
HIP_RETURN(hipErrorInvalidDeviceFunction);