Skip to content

Commit

Permalink
Avoid warnigns for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Feb 3, 2025
1 parent c89ab1a commit e70bc06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libcudacxx/include/cuda/std/detail/__access_property
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<std::uintptr_t>(__ptr),
__hit_bytes,
Expand Down
1 change: 1 addition & 0 deletions libcudacxx/include/cuda/std/detail/__annotated_ptr
Original file line number Diff line number Diff line change
Expand Up @@ -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;))
}

Expand Down

0 comments on commit e70bc06

Please sign in to comment.