SWDEV-390597 - Return No Device error for hipSetDevice and hipSetDeviceFlags.

Change-Id: I457b1197a8f1b71a8bbbdf09f193f643c61700b6
Este commit está contenido en:
Jaydeep Patel
2023-04-11 14:21:57 +00:00
cometido por Jaydeepkumar Patel
padre 930d1f04c2
commit 3dfe48b582
+5 -2
Ver fichero
@@ -559,18 +559,21 @@ hipError_t hipGetDeviceFlags ( unsigned int* flags ) {
hipError_t hipSetDevice ( int device ) {
HIP_INIT_API(hipSetDevice, device);
if (static_cast<unsigned int>(device) < g_devices.size()) {
hip::setCurrentDevice(device);
HIP_RETURN(hipSuccess);
} else if (g_devices.empty()) {
HIP_RETURN(hipErrorNoDevice);
}
HIP_RETURN(hipErrorInvalidDevice);
}
hipError_t hipSetDeviceFlags ( unsigned int flags ) {
HIP_INIT_API(hipSetDeviceFlags, flags);
if (g_devices.empty()) {
HIP_RETURN(hipErrorNoDevice);
}
constexpr uint32_t supportedFlags =
hipDeviceScheduleMask | hipDeviceMapHost | hipDeviceLmemResizeToMax;
constexpr uint32_t mutualExclusiveFlags =