Skip to content

Commit

Permalink
Fix compiler warning when compiling with ICX
Browse files Browse the repository at this point in the history
Compiling with icx uncovered an error from -Wenum-conversion. Need
to explicitly cast from CUresult to cudaError_t for ofi_cudaGetErrorName
and ofi_cudaGetErrorString calls.

Even with this fix, there is a risk that the return code is not a valid
cudaError_t enumeration, but the only consequence will be that the
functions return "Unknown Error".

Signed-off-by: Scott Breyer <[email protected]>
  • Loading branch information
sjb017 authored and j-xiong committed Jan 9, 2024
1 parent a2efd14 commit 0c51388
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hmem_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ static int cuda_hmem_detect_p2p_access_support(void)
"Failed to detect support for peer-to-peer "
"access between CUDA devices via "
"cuDeviceCanAccessPeer(): %s:%s\n",
ofi_cudaGetErrorName(cuda_ret),
ofi_cudaGetErrorString(cuda_ret));
ofi_cudaGetErrorName((cudaError_t)cuda_ret),
ofi_cudaGetErrorString((cudaError_t)cuda_ret));
return -FI_EIO;
}
FI_INFO(&core_prov, FI_LOG_CORE,
Expand Down

0 comments on commit 0c51388

Please sign in to comment.