SWDEV-437832 - Adding device property to check if the device is accelerator.

Change-Id: I8349e99c03422c268bbb60a8c143bd492d9cec09
This commit is contained in:
kjayapra-amd
2023-12-15 10:40:18 -05:00
committato da Maneesh Gupta
parent 0a055f874b
commit b366a7c992
3 ha cambiato i file con 17 aggiunte e 0 eliminazioni
+2
Vedi File
@@ -463,6 +463,8 @@ hipError_t ihipGetDeviceProperties(hipDeviceProp_tR0600* props, int device) {
deviceProps.timelineSemaphoreInteropSupported = 0;
deviceProps.unifiedFunctionPointers = 0;
deviceProps.integrated = info.accelerator_;
*props = deviceProps;
return hipSuccess;
}
+2
Vedi File
@@ -624,6 +624,8 @@ struct Info : public amd::EmbeddedObject {
//! global CU mask which will be applied to all queues created on this device
std::vector<uint32_t> globalCUMask_;
bool accelerator_; //!< Accelerator or discrete graphics card.
//! AQL Barrier Value Packet support
bool aqlBarrierValue_;
+13
Vedi File
@@ -1836,6 +1836,19 @@ bool Device::populateOCLDeviceConstants() {
std::numeric_limits<uint32_t>::max(); // gfx10+ does not share SGPRs between waves
}
uint8_t memory_properties[8];
// Get the memory property from ROCr.
if (HSA_STATUS_SUCCESS != hsa_agent_get_info(bkendDevice_,
(hsa_agent_info_t) HSA_AMD_AGENT_INFO_MEMORY_PROPERTIES,
memory_properties)) {
LogError("HSA_AGENT_INFO_AMD_MEMORY_PROPERTIES query failed");
}
// Check if the device is APU
if (hsa_flag_isset64(memory_properties, HSA_AMD_MEMORY_PROPERTY_AGENT_IS_APU)) {
info_.accelerator_ = 1;
}
return true;
}