Skip to content

Commit 379bfff

Browse files
fix warning unused return value
``` cuda_memtest/cuda_memtest.cpp:162:9: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result] MEMTEST_API_PREFIX(GetLastError()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rwidera/workspace/picongpu/thirdParty/cuda_memtest/cuda_memtest.h:62:38: note: expanded from macro 'MEMTEST_API_PREFIX' ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rwidera/workspace/picongpu/thirdParty/cuda_memtest/cuda_memtest.h:41:36: note: expanded from macro 'MEMTEST_PP_CONCAT_DO' ^~~~ <scratch space>:140:1: note: expanded from here hipGetLastError ^~~~~~~~~~~~~~~ ```
1 parent c3348b7 commit 379bfff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cuda_memtest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,18 @@ thread_func(void* _arg)
153153
}
154154

155155
unsigned int tot_num_blocks_old = tot_num_blocks;
156-
apiError_t err;
157156

158157
// Try to allocate tot_num_blocks memory, if this fails we reduce the number of blocks
159158
// until we find a valid number of blocks which can be allocated.
160159
do{
161160
// reset error
162-
MEMTEST_API_PREFIX(GetLastError());
161+
CUERR(MEMTEST_API_PREFIX(GetLastError()));
163162
DEBUG_PRINTF("Trying to allocate %d MB\n", tot_num_blocks);
164163
if (tot_num_blocks <= 0){
165164
FPRINTF("ERROR: cannot allocate any memory from GPU\n");
166165
exit(ERR_GENERAL);
167166
}
167+
apiError_t err;
168168
if(useMappedMemory)
169169
{
170170
//create cuda mapped memory

0 commit comments

Comments
 (0)