File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
offload/plugins-nextgen/amdgpu/src Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -4477,6 +4477,26 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
44774477 // / the current configuration.
44784478 bool supportsUnifiedMemoryImpl () override final { return IsXnackEnabled; }
44794479
4480+ // / Get the normalized marketing name of the device.
4481+ // / It only targets Instinct MI series for now.
4482+ // / e.g AMD Instinct MI210 => MI210
4483+ std::string getNormMarketingName () const {
4484+ char MarketingName[64 ];
4485+ hsa_status_t Status = hsa_agent_get_info (
4486+ Agent, static_cast <hsa_agent_info_t >(HSA_AMD_AGENT_INFO_PRODUCT_NAME),
4487+ MarketingName);
4488+
4489+ if (Status != HSA_STATUS_SUCCESS)
4490+ return " UNKNOWN" ;
4491+
4492+ // Normalize
4493+ const char *MIPos = strstr (MarketingName, " MI" );
4494+ if (MIPos)
4495+ return std::string (MIPos);
4496+
4497+ return " UNKNOWN" ;
4498+ }
4499+
44804500 // / Envar for controlling the number of HSA queues per device. High number of
44814501 // / queues may degrade performance.
44824502 UInt32Envar OMPX_NumQueues;
You can’t perform that action at this time.
0 commit comments