Skip to content

Commit

Permalink
fix unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
davebayer committed Feb 5, 2025
1 parent 39e6b4c commit 097d858
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libcudacxx/include/cuda/std/__cstdlib/malloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI _CCCL_HOST void* __aligned_alloc_host(size_t
{
void* __ptr{};
# if _CCCL_COMPILER(MSVC)
_LIBCUDACXX_UNUSED_VAR(__nbytes);
_LIBCUDACXX_UNUSED_VAR(__align);
_CCCL_ASSERT(false, "Use of aligned_alloc in host code is not supported with MSVC");
# else
__ptr = ::std::aligned_alloc(__align, __nbytes);
Expand All @@ -73,16 +75,20 @@ _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI _CCCL_HOST void* __aligned_alloc_host(size_t
}
#endif // !_CCCL_COMPILER(NVRTC)

#if _CCCL_HAS_CUDA_COMPILER
_CCCL_NODISCARD _CCCL_HIDE_FROM_ABI _CCCL_DEVICE void* __aligned_alloc_device(size_t __nbytes, size_t __align) noexcept
{
void* __ptr{};
#if _CCCL_CUDA_COMPILER(CLANG)
# if _CCCL_CUDA_COMPILER(CLANG)
_LIBCUDACXX_UNUSED_VAR(__nbytes);
_LIBCUDACXX_UNUSED_VAR(__align);
_CCCL_ASSERT(false, "Use of aligned_alloc in device code is not supported with clang-cuda");
#else // ^^^ _CCCL_CUDA_COMPILER(CLANG) ^^^ / vvv !_CCCL_CUDA_COMPILER(CLANG)
# else // ^^^ _CCCL_CUDA_COMPILER(CLANG) ^^^ / vvv !_CCCL_CUDA_COMPILER(CLANG)
NV_IF_TARGET(NV_IS_DEVICE, (__ptr = ::__nv_aligned_device_malloc(__nbytes, __align);))
#endif // ^^^ !_CCCL_CUDA_COMPILER(CLANG) ^^^
# endif // ^^^ !_CCCL_CUDA_COMPILER(CLANG) ^^^
return __ptr;
}
#endif // _CCCL_HAS_CUDA_COMPILER

_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI void* aligned_alloc(size_t __nbytes, size_t __align) noexcept
{
Expand Down

0 comments on commit 097d858

Please sign in to comment.