SWDEV-436405 - Add hipGetDevicePropertiesR0000 and hipChooseDeviceR0000 to hip dispatch table
Change-Id: I5b373ac030502eb88477d20a1d216bc48369b51d
This commit is contained in:
committato da
Anusha Godavarthy Surya
parent
9551d48e7f
commit
3e72b8d1e1
@@ -67,6 +67,7 @@ typedef hipError_t (*t_hipBindTextureToMipmappedArray)(const textureReference* t
|
||||
hipMipmappedArray_const_t mipmappedArray,
|
||||
const hipChannelFormatDesc* desc);
|
||||
typedef hipError_t (*t_hipChooseDevice)(int* device, const hipDeviceProp_t* prop);
|
||||
typedef hipError_t (*t_hipChooseDeviceR0000)(int* device, const hipDeviceProp_tR0000* properties);
|
||||
typedef hipError_t (*t_hipConfigureCall)(dim3 gridDim, dim3 blockDim, size_t sharedMem,
|
||||
hipStream_t stream);
|
||||
typedef hipError_t (*t_hipCreateSurfaceObject)(hipSurfaceObject_t* pSurfObject,
|
||||
@@ -183,7 +184,8 @@ typedef hipError_t (*t_hipGetChannelDesc)(hipChannelFormatDesc* desc, hipArray_c
|
||||
typedef hipError_t (*t_hipGetDevice)(int* deviceId);
|
||||
typedef hipError_t (*t_hipGetDeviceCount)(int* count);
|
||||
typedef hipError_t (*t_hipGetDeviceFlags)(unsigned int* flags);
|
||||
typedef hipError_t (*t_hipGetDeviceProperties)(hipDeviceProp_t* prop, int deviceId);
|
||||
typedef hipError_t (*t_hipGetDevicePropertiesR0600)(hipDeviceProp_tR0600* prop, int device);
|
||||
typedef hipError_t (*t_hipGetDevicePropertiesR0000)(hipDeviceProp_tR0000* prop, int device);
|
||||
typedef const char* (*t_hipGetErrorName)(hipError_t hip_error);
|
||||
typedef const char* (*t_hipGetErrorString)(hipError_t hipError);
|
||||
typedef hipError_t (*t_hipGetLastError)(void);
|
||||
@@ -898,6 +900,7 @@ struct HipDispatchTable {
|
||||
t_hipBindTextureToArray hipBindTextureToArray_fn;
|
||||
t_hipBindTextureToMipmappedArray hipBindTextureToMipmappedArray_fn;
|
||||
t_hipChooseDevice hipChooseDevice_fn;
|
||||
t_hipChooseDeviceR0000 hipChooseDeviceR0000_fn;
|
||||
t_hipConfigureCall hipConfigureCall_fn;
|
||||
t_hipCreateSurfaceObject hipCreateSurfaceObject_fn;
|
||||
t_hipCreateTextureObject hipCreateTextureObject_fn;
|
||||
@@ -990,7 +993,8 @@ struct HipDispatchTable {
|
||||
t_hipGetDevice hipGetDevice_fn;
|
||||
t_hipGetDeviceCount hipGetDeviceCount_fn;
|
||||
t_hipGetDeviceFlags hipGetDeviceFlags_fn;
|
||||
t_hipGetDeviceProperties hipGetDeviceProperties_fn;
|
||||
t_hipGetDevicePropertiesR0600 hipGetDevicePropertiesR0600_fn;
|
||||
t_hipGetDevicePropertiesR0000 hipGetDevicePropertiesR0000_fn;
|
||||
t_hipGetErrorName hipGetErrorName_fn;
|
||||
t_hipGetErrorString hipGetErrorString_fn;
|
||||
t_hipGetLastError hipGetLastError_fn;
|
||||
|
||||
@@ -62,6 +62,7 @@ hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
|
||||
hipMipmappedArray_const_t mipmappedArray,
|
||||
const hipChannelFormatDesc* desc);
|
||||
hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
|
||||
hipError_t hipChooseDeviceR0000(int* device, const hipDeviceProp_tR0000* properties);
|
||||
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem, hipStream_t stream);
|
||||
hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
|
||||
const hipTextureDesc* pTexDesc,
|
||||
@@ -163,7 +164,8 @@ hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array)
|
||||
hipError_t hipGetDevice(int* deviceId);
|
||||
hipError_t hipGetDeviceCount(int* count);
|
||||
hipError_t hipGetDeviceFlags(unsigned int* flags);
|
||||
hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
|
||||
hipError_t hipGetDevicePropertiesR0600(hipDeviceProp_tR0600* prop, int deviceId);
|
||||
hipError_t hipGetDevicePropertiesR0000(hipDeviceProp_tR0000* prop, int device);
|
||||
const char* hipGetErrorName(hipError_t hip_error);
|
||||
const char* hipGetErrorString(hipError_t hipError);
|
||||
hipError_t hipGetLastError(void);
|
||||
@@ -764,6 +766,7 @@ void UpdateHipDispatchTable(HipDispatchTable* ptrDispatchTable) {
|
||||
ptrDispatchTable->hipBindTextureToArray_fn = hip::hipBindTextureToArray;
|
||||
ptrDispatchTable->hipBindTextureToMipmappedArray_fn = hip::hipBindTextureToMipmappedArray;
|
||||
ptrDispatchTable->hipChooseDevice_fn = hip::hipChooseDevice;
|
||||
ptrDispatchTable->hipChooseDeviceR0000_fn = hip::hipChooseDeviceR0000;
|
||||
ptrDispatchTable->hipConfigureCall_fn = hip::hipConfigureCall;
|
||||
ptrDispatchTable->hipCreateSurfaceObject_fn = hip::hipCreateSurfaceObject;
|
||||
ptrDispatchTable->hipCreateTextureObject_fn = hip::hipCreateTextureObject;
|
||||
@@ -854,7 +857,7 @@ void UpdateHipDispatchTable(HipDispatchTable* ptrDispatchTable) {
|
||||
ptrDispatchTable->hipGetDevice_fn = hip::hipGetDevice;
|
||||
ptrDispatchTable->hipGetDeviceCount_fn = hip::hipGetDeviceCount;
|
||||
ptrDispatchTable->hipGetDeviceFlags_fn = hip::hipGetDeviceFlags;
|
||||
ptrDispatchTable->hipGetDeviceProperties_fn = hip::hipGetDeviceProperties;
|
||||
ptrDispatchTable->hipGetDevicePropertiesR0600_fn = hip::hipGetDevicePropertiesR0600;
|
||||
ptrDispatchTable->hipGetErrorName_fn = hip::hipGetErrorName;
|
||||
ptrDispatchTable->hipGetErrorString_fn = hip::hipGetErrorString;
|
||||
ptrDispatchTable->hipGetLastError_fn = hip::hipGetLastError;
|
||||
@@ -1197,7 +1200,7 @@ void UpdateHipDispatchTable(HipDispatchTable* ptrDispatchTable) {
|
||||
ptrDispatchTable->hipLaunchHostFunc_spt_fn = hip::hipLaunchHostFunc_spt;
|
||||
ptrDispatchTable->hipGetStreamDeviceId_fn = hip::hipGetStreamDeviceId;
|
||||
ptrDispatchTable->hipDrvGraphAddMemsetNode_fn = hip::hipDrvGraphAddMemsetNode;
|
||||
|
||||
ptrDispatchTable->hipGetDevicePropertiesR0000_fn = hip::hipGetDevicePropertiesR0000;
|
||||
}
|
||||
|
||||
namespace hip {
|
||||
|
||||
@@ -578,9 +578,8 @@ hipError_t hipGetDevicePropertiesR0000(hipDeviceProp_tR0000* prop, int device) {
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
extern "C" hipError_t hipGetDeviceProperties(hipDeviceProp_tR0000* props, hipDevice_t device);
|
||||
hipError_t hipGetDeviceProperties(hipDeviceProp_tR0000* props, hipDevice_t device) {
|
||||
return hipGetDevicePropertiesR0000(props, device);
|
||||
}
|
||||
} // namespace hip
|
||||
|
||||
extern "C" hipError_t hipGetDeviceProperties(hipDeviceProp_tR0000* props, hipDevice_t device) {
|
||||
return hip::hipGetDevicePropertiesR0000(props, device);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
namespace hip {
|
||||
|
||||
hipError_t hipGetDevicePropertiesR0000(hipDeviceProp_tR0000* prop, int device);
|
||||
|
||||
template <typename DeviceProp>
|
||||
hipError_t ihipChooseDevice(int* device, const DeviceProp* properties) {
|
||||
if (device == nullptr || properties == nullptr) {
|
||||
@@ -48,9 +50,9 @@ hipError_t ihipChooseDevice(int* device, const DeviceProp* properties) {
|
||||
err = ihipGetDeviceProperties(¤tProp, i);
|
||||
}
|
||||
else {
|
||||
err = hipGetDevicePropertiesR0000(¤tProp, i);
|
||||
err = hip::hipGetDevicePropertiesR0000(¤tProp, i);
|
||||
}
|
||||
|
||||
|
||||
if (properties->major != 0) {
|
||||
validPropCount++;
|
||||
if (currentProp.major >= properties->major) {
|
||||
@@ -153,12 +155,10 @@ hipError_t hipChooseDeviceR0600(int* device, const hipDeviceProp_tR0600* propert
|
||||
hipError_t hipChooseDeviceR0000(int* device, const hipDeviceProp_tR0000* properties) {
|
||||
HIP_INIT_API(hipChooseDeviceR0000, device, properties);
|
||||
HIP_RETURN(ihipChooseDevice(device, properties));
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
extern "C" hipError_t hipChooseDevice(int* device, const hipDeviceProp_tR0000* properties);
|
||||
hipError_t hipChooseDevice(int* device, const hipDeviceProp_tR0000* properties) {
|
||||
return hipChooseDeviceR0000(device, properties);
|
||||
return hip::hipChooseDeviceR0000(device, properties);
|
||||
}
|
||||
|
||||
hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device) {
|
||||
|
||||
@@ -111,9 +111,12 @@ hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
|
||||
const hipChannelFormatDesc* desc) {
|
||||
return hip::GetHipDispatchTable()->hipBindTextureToMipmappedArray_fn(tex, mipmappedArray, desc);
|
||||
}
|
||||
hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop) {
|
||||
extern "C" hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop) {
|
||||
return hip::GetHipDispatchTable()->hipChooseDevice_fn(device, prop);
|
||||
}
|
||||
extern "C" hipError_t hipChooseDeviceR0000(int* device, const hipDeviceProp_tR0000* properties) {
|
||||
return hip::GetHipDispatchTable()->hipChooseDeviceR0000_fn(device, properties);
|
||||
}
|
||||
extern "C" hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem,
|
||||
hipStream_t stream) {
|
||||
return hip::GetHipDispatchTable()->hipConfigureCall_fn(gridDim, blockDim, sharedMem, stream);
|
||||
@@ -407,8 +410,11 @@ hipError_t hipGetDeviceCount(int* count) {
|
||||
hipError_t hipGetDeviceFlags(unsigned int* flags) {
|
||||
return hip::GetHipDispatchTable()->hipGetDeviceFlags_fn(flags);
|
||||
}
|
||||
hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId) {
|
||||
return hip::GetHipDispatchTable()->hipGetDeviceProperties_fn(prop, deviceId);
|
||||
extern "C" hipError_t hipGetDevicePropertiesR0600(hipDeviceProp_tR0600* prop, int deviceId) {
|
||||
return hip::GetHipDispatchTable()->hipGetDevicePropertiesR0600_fn(prop, deviceId);
|
||||
}
|
||||
extern "C" hipError_t hipGetDevicePropertiesR0000(hipDeviceProp_tR0000* prop, int device) {
|
||||
return hip::GetHipDispatchTable()->hipGetDevicePropertiesR0000_fn(prop, device);
|
||||
}
|
||||
const char* hipGetErrorName(hipError_t hip_error) {
|
||||
return hip::GetHipDispatchTable()->hipGetErrorName_fn(hip_error);
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user