Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d890d77

Browse files
committed
SWDEV-221166 - Detect support for large bar access through HIP runtime API
Change-Id: Iaa9756c1b5e40c1ab5afb38e44a6699fa5f6c13f
1 parent b90bc53 commit d890d77

5 files changed

Lines changed: 5 additions & 6 deletions

File tree

include/hip/hip_runtime_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ typedef struct hipDeviceProp_t {
136136
///devices with unmatched block dimensions
137137
int cooperativeMultiDeviceUnmatchedSharedMem; ///< HIP device supports cooperative launch on multiple
138138
///devices with unmatched shared memories
139-
139+
int isLargeBar; ///< 1: if it is a large PCI bar device, else 0
140140
} hipDeviceProp_t;
141141

142142

samples/1_Utils/hipInfo/hipInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ void printDeviceProp(int deviceId) {
146146
cout << setw(w1) << "maxTexture3D.width: " << props.maxTexture3D[0] << endl;
147147
cout << setw(w1) << "maxTexture3D.height: " << props.maxTexture3D[1] << endl;
148148
cout << setw(w1) << "maxTexture3D.depth: " << props.maxTexture3D[2] << endl;
149-
149+
cout << setw(w1) << "isLargeBar: " << props.isLargeBar << endl;
150+
150151
int deviceCnt;
151152
hipGetDeviceCount(&deviceCnt);
152153
cout << setw(w1) << "peers: ";

src/hip_hcc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) {
864864
/* Computemode for HSA Devices is always : cudaComputeModeDefault */
865865
prop->computeMode = 0;
866866

867-
_isLargeBar = _acc.has_cpu_accessible_am();
867+
prop->isLargeBar = _acc.has_cpu_accessible_am() ? 1 : 0;
868868

869869
// Get Max Threads Per Multiprocessor
870870
uint32_t max_waves_per_cu;

src/hip_hcc_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,9 +836,6 @@ class ihipDevice_t {
836836
unsigned _computeUnits;
837837
hipDeviceProp_t _props; // saved device properties.
838838

839-
// TODO - report this through device properties, base on HCC API call.
840-
int _isLargeBar;
841-
842839
// Node id reported by kfd for this device
843840
uint32_t _driver_node_id;
844841

vdi/hip_device.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ hipError_t hipGetDeviceProperties ( hipDeviceProp_t* props, hipDevice_t device )
230230
deviceProps.texturePitchAlignment = info.imagePitchAlignment_;
231231
deviceProps.kernelExecTimeoutEnabled = 0;
232232
deviceProps.ECCEnabled = info.errorCorrectionSupport_? 1:0;
233+
deviceProps.isLargeBar = info.largeBar_ ? 1 : 0;
233234

234235
*props = deviceProps;
235236
HIP_RETURN(hipSuccess);

0 commit comments

Comments
 (0)