SWDEV-221166 - Detect support for large bar access through HIP runtime API
Change-Id: Iaa9756c1b5e40c1ab5afb38e44a6699fa5f6c13f
This commit is contained in:
@@ -136,7 +136,7 @@ typedef struct hipDeviceProp_t {
|
|||||||
///devices with unmatched block dimensions
|
///devices with unmatched block dimensions
|
||||||
int cooperativeMultiDeviceUnmatchedSharedMem; ///< HIP device supports cooperative launch on multiple
|
int cooperativeMultiDeviceUnmatchedSharedMem; ///< HIP device supports cooperative launch on multiple
|
||||||
///devices with unmatched shared memories
|
///devices with unmatched shared memories
|
||||||
|
int isLargeBar; ///< 1: if it is a large PCI bar device, else 0
|
||||||
} hipDeviceProp_t;
|
} hipDeviceProp_t;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ void printDeviceProp(int deviceId) {
|
|||||||
cout << setw(w1) << "maxTexture3D.width: " << props.maxTexture3D[0] << endl;
|
cout << setw(w1) << "maxTexture3D.width: " << props.maxTexture3D[0] << endl;
|
||||||
cout << setw(w1) << "maxTexture3D.height: " << props.maxTexture3D[1] << endl;
|
cout << setw(w1) << "maxTexture3D.height: " << props.maxTexture3D[1] << endl;
|
||||||
cout << setw(w1) << "maxTexture3D.depth: " << props.maxTexture3D[2] << endl;
|
cout << setw(w1) << "maxTexture3D.depth: " << props.maxTexture3D[2] << endl;
|
||||||
|
cout << setw(w1) << "isLargeBar: " << props.isLargeBar << endl;
|
||||||
|
|
||||||
int deviceCnt;
|
int deviceCnt;
|
||||||
hipGetDeviceCount(&deviceCnt);
|
hipGetDeviceCount(&deviceCnt);
|
||||||
|
|||||||
@@ -864,7 +864,7 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) {
|
|||||||
/* Computemode for HSA Devices is always : cudaComputeModeDefault */
|
/* Computemode for HSA Devices is always : cudaComputeModeDefault */
|
||||||
prop->computeMode = 0;
|
prop->computeMode = 0;
|
||||||
|
|
||||||
_isLargeBar = _acc.has_cpu_accessible_am();
|
prop->isLargeBar = _acc.has_cpu_accessible_am() ? 1 : 0;
|
||||||
|
|
||||||
// Get Max Threads Per Multiprocessor
|
// Get Max Threads Per Multiprocessor
|
||||||
uint32_t max_waves_per_cu;
|
uint32_t max_waves_per_cu;
|
||||||
|
|||||||
@@ -836,9 +836,6 @@ class ihipDevice_t {
|
|||||||
unsigned _computeUnits;
|
unsigned _computeUnits;
|
||||||
hipDeviceProp_t _props; // saved device properties.
|
hipDeviceProp_t _props; // saved device properties.
|
||||||
|
|
||||||
// TODO - report this through device properties, base on HCC API call.
|
|
||||||
int _isLargeBar;
|
|
||||||
|
|
||||||
// Node id reported by kfd for this device
|
// Node id reported by kfd for this device
|
||||||
uint32_t _driver_node_id;
|
uint32_t _driver_node_id;
|
||||||
|
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ hipError_t hipGetDeviceProperties ( hipDeviceProp_t* props, hipDevice_t device )
|
|||||||
deviceProps.texturePitchAlignment = info.imagePitchAlignment_;
|
deviceProps.texturePitchAlignment = info.imagePitchAlignment_;
|
||||||
deviceProps.kernelExecTimeoutEnabled = 0;
|
deviceProps.kernelExecTimeoutEnabled = 0;
|
||||||
deviceProps.ECCEnabled = info.errorCorrectionSupport_? 1:0;
|
deviceProps.ECCEnabled = info.errorCorrectionSupport_? 1:0;
|
||||||
|
deviceProps.isLargeBar = info.largeBar_ ? 1 : 0;
|
||||||
|
|
||||||
*props = deviceProps;
|
*props = deviceProps;
|
||||||
HIP_RETURN(hipSuccess);
|
HIP_RETURN(hipSuccess);
|
||||||
|
|||||||
Reference in New Issue
Block a user