From 9afe7542de90878d8222682add79b519cadc12cc Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Mon, 3 Feb 2025 17:44:56 +0100 Subject: [PATCH] Avoid warnigns for MSVC --- libcudacxx/include/cuda/std/detail/__access_property | 6 +++--- libcudacxx/include/cuda/std/detail/__annotated_ptr | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libcudacxx/include/cuda/std/detail/__access_property b/libcudacxx/include/cuda/std/detail/__access_property index 7e4adb04268..8d85b166938 100644 --- a/libcudacxx/include/cuda/std/detail/__access_property +++ b/libcudacxx/include/cuda/std/detail/__access_property @@ -138,12 +138,12 @@ namespace __detail_ap _CCCL_HOST_DEVICE constexpr uint32_t __ap_floor_log2(uint32_t __x) { - return (__x == 1 | __x == 0) ? 0 : 1 + __ap_floor_log2(__x >> 1); + return ((__x == 1) || (__x == 0)) ? 0 : 1 + __ap_floor_log2(__x >> 1); } _CCCL_HOST_DEVICE constexpr uint32_t __ap_ceil_log2(uint32_t __x) { - return (__x == 1 | __x == 0) ? 0 : __ap_floor_log2(__x - 1) + 1; + return ((__x == 1) || (__x == 0)) ? 0 : __ap_floor_log2(__x - 1) + 1; } _CCCL_HOST_DEVICE constexpr uint32_t __ap_min(uint32_t __a, uint32_t __b) noexcept @@ -431,7 +431,7 @@ _CCCL_HOST_DEVICE constexpr std::uint64_t __block( cudaAccessProperty __hit_prop, cudaAccessProperty __miss_prop = cudaAccessPropertyNormal) { - return (__total_bytes <= (size_t{0xFFFFFFFF}) & __total_bytes != 0 & __hit_bytes <= __total_bytes) + return (__total_bytes <= (size_t{0xFFFFFFFF}) && __total_bytes != 0 && __hit_bytes <= __total_bytes) ? __sm_80::__block_descriptor_builder( reinterpret_cast(__ptr), __hit_bytes, diff --git a/libcudacxx/include/cuda/std/detail/__annotated_ptr b/libcudacxx/include/cuda/std/detail/__annotated_ptr index 7a684746f0c..7a477245cc4 100644 --- a/libcudacxx/include/cuda/std/detail/__annotated_ptr +++ b/libcudacxx/include/cuda/std/detail/__annotated_ptr @@ -176,6 +176,7 @@ _CCCL_DEVICE void* __associate_descriptor(void* __ptr, __Prop __prop) template <> inline _CCCL_DEVICE void* __associate_descriptor(void* __ptr, std::uint64_t __prop) { + (void) __prop; NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __nv_associate_access_property(__ptr, __prop);), (return __ptr;)) }