Skip to content
This repository was archived by the owner on Dec 24, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9a99e7f

Browse files
ypapadop-amdmakslevental
authored andcommittedSep 1, 2024
rocr/aie: Missing AIEAgent info cases
* Add missing info cases to AIEAgent * Following the single value set from GPUAgent * AIEs have no caches, no cacheline is reported
1 parent 239fe8e commit 9a99e7f

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed
 

‎runtime/hsa-runtime/core/runtime/amd_aie_agent.cpp

+56-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// The University of Illinois/NCSA
44
// Open Source License (NCSA)
55
//
6-
// Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
6+
// Copyright (c) 2022-2024, Advanced Micro Devices, Inc. All rights reserved.
77
//
88
// Developed by:
99
//
@@ -111,14 +111,30 @@ hsa_status_t AieAgent::GetInfo(hsa_agent_info_t attribute, void *value) const {
111111
case HSA_AGENT_INFO_MACHINE_MODEL:
112112
*reinterpret_cast<hsa_machine_model_t *>(value) = HSA_MACHINE_MODEL_LARGE;
113113
break;
114-
case HSA_AGENT_INFO_PROFILE:
114+
case HSA_AGENT_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES:
115+
case HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE:
116+
// TODO: validate if this is true.
117+
*reinterpret_cast<hsa_default_float_rounding_mode_t *>(value) =
118+
HSA_DEFAULT_FLOAT_ROUNDING_MODE_NEAR;
119+
break;
120+
case HSA_AGENT_INFO_PROFILE:
115121
*reinterpret_cast<hsa_profile_t *>(value) = profile_;
116122
break;
117123
case HSA_AGENT_INFO_WAVEFRONT_SIZE:
124+
*reinterpret_cast<uint32_t *>(value) = 0;
125+
break;
118126
case HSA_AGENT_INFO_WORKGROUP_MAX_DIM:
127+
std::memset(value, 0, sizeof(uint16_t) * 3);
128+
break;
119129
case HSA_AGENT_INFO_WORKGROUP_MAX_SIZE:
130+
*reinterpret_cast<uint32_t*>(value) = 0;
131+
break;
120132
case HSA_AGENT_INFO_GRID_MAX_DIM:
133+
std::memset(value, 0, sizeof(hsa_dim3_t));
134+
break;
121135
case HSA_AGENT_INFO_GRID_MAX_SIZE:
136+
*reinterpret_cast<uint32_t *>(value) = 0;
137+
break;
122138
case HSA_AGENT_INFO_FBARRIER_MAX_SIZE:
123139
*reinterpret_cast<uint32_t *>(value) = 0;
124140
break;
@@ -149,6 +165,36 @@ hsa_status_t AieAgent::GetInfo(hsa_agent_info_t attribute, void *value) const {
149165
case HSA_AGENT_INFO_VERSION_MINOR:
150166
*reinterpret_cast<uint32_t *>(value) = 0;
151167
break;
168+
case HSA_AMD_AGENT_INFO_CHIP_ID:
169+
*reinterpret_cast<uint32_t *>(value) = 0;
170+
break;
171+
case HSA_AMD_AGENT_INFO_CACHELINE_SIZE:
172+
*reinterpret_cast<uint32_t *>(value) = 0;
173+
break;
174+
case HSA_AMD_AGENT_INFO_COMPUTE_UNIT_COUNT:
175+
*reinterpret_cast<uint32_t *>(value) = 0;
176+
break;
177+
case HSA_AMD_AGENT_INFO_MAX_CLOCK_FREQUENCY:
178+
*reinterpret_cast<uint32_t *>(value) = 0;
179+
break;
180+
case HSA_AMD_AGENT_INFO_DRIVER_NODE_ID:
181+
*reinterpret_cast<uint32_t *>(value) = node_id();
182+
break;
183+
case HSA_AMD_AGENT_INFO_MAX_ADDRESS_WATCH_POINTS:
184+
*reinterpret_cast<uint32_t *>(value) = 0;
185+
break;
186+
case HSA_AMD_AGENT_INFO_BDFID:
187+
*reinterpret_cast<uint32_t *>(value) = 0;
188+
break;
189+
case HSA_AMD_AGENT_INFO_NUM_SIMDS_PER_CU:
190+
*reinterpret_cast<uint32_t *>(value) = 0;
191+
break;
192+
case HSA_AMD_AGENT_INFO_NUM_SHADER_ENGINES:
193+
*reinterpret_cast<uint32_t *>(value) = 0;
194+
break;
195+
case HSA_AMD_AGENT_INFO_NUM_SHADER_ARRAYS_PER_SE:
196+
*reinterpret_cast<uint32_t *>(value) = 0;
197+
break;
152198
case HSA_EXT_AGENT_INFO_IMAGE_1D_MAX_ELEMENTS:
153199
case HSA_EXT_AGENT_INFO_IMAGE_1DA_MAX_ELEMENTS:
154200
case HSA_EXT_AGENT_INFO_IMAGE_1DB_MAX_ELEMENTS:
@@ -165,6 +211,14 @@ hsa_status_t AieAgent::GetInfo(hsa_agent_info_t attribute, void *value) const {
165211
std::strcpy(reinterpret_cast<char *>(value), product_name_info_.c_str());
166212
break;
167213
}
214+
case HSA_AMD_AGENT_INFO_ASIC_REVISION:
215+
*reinterpret_cast<uint32_t *>(value) = 0;
216+
break;
217+
case HSA_AMD_AGENT_INFO_SVM_DIRECT_HOST_ACCESS:
218+
// commented out until we populate AIE agent regions
219+
assert(regions_.size() != 0 && "No device local memory found!");
220+
*reinterpret_cast<bool *>(value) = true;
221+
break;
168222
default:
169223
*reinterpret_cast<uint32_t *>(value) = 0;
170224
return HSA_STATUS_ERROR_INVALID_ARGUMENT;

0 commit comments

Comments
 (0)
This repository has been archived.