Fix for SWDEV-239415 to handle hipGetDevice properly while no GPU present
Change-Id: I252cbbf9a89fc76fe1be1fbb8f45778e96c70fb2
This commit is contained in:
@@ -449,7 +449,11 @@ hipError_t hipDeviceSynchronize ( void ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ihipGetDevice() {
|
int ihipGetDevice() {
|
||||||
return hip::getCurrentDevice()->deviceId();
|
hip::Device* device = hip::getCurrentDevice();
|
||||||
|
if(device == nullptr){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return device->deviceId();
|
||||||
}
|
}
|
||||||
|
|
||||||
hipError_t hipGetDevice ( int* deviceId ) {
|
hipError_t hipGetDevice ( int* deviceId ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user