P4 to Git Change 1541938 by cpaquot@cpaquot-ocl-lc-lnx on 2018/04/16 18:27:17
SWDEV-145570 - [HIP] Set/GetDevice and Create/DestroyTextureObject Implemented Set/GetDevice relying on g_context (current context) Implemented create linear/2D texture object function Implemented hipDestroyTextureObject Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#5 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_texture.cpp#4 edit
This commit is contained in:
@@ -382,13 +382,17 @@ hipError_t hipGetDevice ( int* deviceId ) {
|
||||
HIP_INIT_API(deviceId);
|
||||
|
||||
if (deviceId != nullptr) {
|
||||
// this needs to return default device. For now return 0 always
|
||||
*deviceId = 0;
|
||||
for (unsigned int i = 0; i < g_devices.size(); i++) {
|
||||
if (g_devices[i] == g_context) {
|
||||
*deviceId = i;
|
||||
return hipSuccess;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
return hipSuccess;
|
||||
return hipErrorUnknown;
|
||||
}
|
||||
|
||||
hipError_t hipGetDeviceCount ( int* count ) {
|
||||
@@ -420,9 +424,12 @@ hipError_t hipIpcOpenEventHandle ( hipEvent_t* event, hipIpcEventHandle_t handle
|
||||
hipError_t hipSetDevice ( int device ) {
|
||||
HIP_INIT_API(device);
|
||||
|
||||
assert(0 && "Unimplemented");
|
||||
if (static_cast<unsigned int>(device) < g_devices.size()) {
|
||||
g_context = g_devices[device];
|
||||
|
||||
return hipErrorUnknown;
|
||||
return hipSuccess;
|
||||
}
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
hipError_t hipSetDeviceFlags ( unsigned int flags ) {
|
||||
|
||||
Reference in New Issue
Block a user