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";