SWDEV-474345 - Address potential segmentation fault in Print_Out_Attributes test

Change-Id: Ie507d3da66d9644eea56a510e76564af1970e2c0
Этот коммит содержится в:
Ioannis Assiouras
2024-07-18 15:14:43 +01:00
родитель b0599b7e4a
Коммит e4077f827c
2 изменённых файлов: 3 добавлений и 3 удалений
+3 -2
Просмотреть файл
@@ -452,10 +452,11 @@ constexpr int kW = 60;
} // anonymous namespace
template <size_t n> void printAttributes(const AttributeToStringMap<n>& attributes, const int device) {
int attribute_value;
hipError_t ret_val;
for (const auto& attribute : attributes) {
ret_val = hipDeviceGetAttribute(&attribute_value, attribute.first, device);
int64_t attribute_value = 0;
ret_val = hipDeviceGetAttribute(reinterpret_cast<int *>(&attribute_value),
attribute.first, device);
std::cout << std::setw(kW) << std::string(attribute.second).append(": ");
if (ret_val == hipSuccess)
std::cout << attribute_value << "\n";