From e77a34158ce3ee00c11c66d0bf0a0e05c0c3ea7b Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Wed, 16 Feb 2022 14:37:58 +0000 Subject: [PATCH] fix memory limit check for HIP --- src/hip/HIPStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hip/HIPStream.cpp b/src/hip/HIPStream.cpp index fbc3b71..6aed1ee 100644 --- a/src/hip/HIPStream.cpp +++ b/src/hip/HIPStream.cpp @@ -54,7 +54,7 @@ HIPStream::HIPStream(const int ARRAY_SIZE, const int device_index) // Check buffers fit on the device hipDeviceProp_t props; hipGetDeviceProperties(&props, 0); - if (props.totalGlobalMem < 3*ARRAY_SIZE*sizeof(T)) + if (props.totalGlobalMem < std::size_t{3}*ARRAY_SIZE*sizeof(T)) throw std::runtime_error("Device does not have enough memory for all 3 buffers"); // Create device buffers