Skip to content

Commit

Permalink
Cannot work without is_constant_evaluated
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Oct 4, 2024
1 parent 87ed0d1 commit cfdce0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/__memory/assume_aligned.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _Tp* assume_alig
#if (!defined(_CCCL_COMPILER_GCC) || _CCCL_GCC_VERSION >= 90000) && !defined(_CCCL_COMPILER_MSVC)
_CCCL_ASSERT(reinterpret_cast<uintptr_t>(__ptr) % _Align == 0, "Alignment assumption is violated");
#endif // gcc >= 9
#if defined(_CCCL_BUILTIN_ASSUME_ALIGNED)
#if defined(_CCCL_BUILTIN_ASSUME_ALIGNED) && defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED)
return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Align));
#endif // _CCCL_BUILTIN_ASSUME_ALIGNED
#endif // _CCCL_BUILTIN_ASSUME_ALIGNED && _CCCL_BUILTIN_IS_CONSTANT_EVALUATED
}
return __ptr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ __host__ __device__ TEST_CONSTEXPR_CXX14 bool tests()
check(&l);
check(&d);

S s;
S4 s4;
S8 s8;
S16 s16;
S32 s32;
S64 s64;
S128 s128;
S s{};
S4 s4{};
S8 s8{};
S16 s16{};
S32 s32{};
S64 s64{};
S128 s128{};
check(&s);
check(&s4);
check(&s8);
Expand Down

0 comments on commit cfdce0b

Please sign in to comment.