Open
Conversation
This was referenced Mar 31, 2026
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
miscco
requested changes
Apr 8, 2026
libcudacxx/include/cuda/std/__simd/specializations/fixed_size_mask.h
Outdated
Show resolved
Hide resolved
libcudacxx/include/cuda/std/__simd/specializations/fixed_size_mask.h
Outdated
Show resolved
Hide resolved
libcudacxx/include/cuda/std/__simd/specializations/fixed_size_mask.h
Outdated
Show resolved
Hide resolved
Contributor
😬 CI Workflow Results🟥 Finished in 1h 18m: Pass: 46%/99 | Total: 20h 15m | Max: 59m 11s | Hits: 94%/35139See results here. |
miscco
requested changes
Apr 9, 2026
| _CCCL_PRAGMA_UNROLL_FULL() | ||
| for (__simd_size_type __i = 0; __i < _Np; ++__i) | ||
| { | ||
| __result.__data[__i] = __lhs.__data[__i] && __rhs.__data[__i]; |
Contributor
There was a problem hiding this comment.
Critical: This should be bitwise and
Suggested change
| __result.__data[__i] = __lhs.__data[__i] && __rhs.__data[__i]; | |
| __result.__data[__i] = __lhs.__data[__i] & __rhs.__data[__i]; |
| _CCCL_PRAGMA_UNROLL_FULL() | ||
| for (__simd_size_type __i = 0; __i < _Np; ++__i) | ||
| { | ||
| __result.__data[__i] = __lhs.__data[__i] || __rhs.__data[__i]; |
Contributor
There was a problem hiding this comment.
Critical: This should be bitwise or
Suggested change
| __result.__data[__i] = __lhs.__data[__i] || __rhs.__data[__i]; | |
| __result.__data[__i] = __lhs.__data[__i] | __rhs.__data[__i]; |
| _CCCL_PRAGMA_UNROLL_FULL() | ||
| for (__simd_size_type __i = 0; __i < _Np; ++__i) | ||
| { | ||
| __result.__data[__i] = __lhs.__data[__i] != __rhs.__data[__i]; |
Contributor
There was a problem hiding this comment.
Critical: This should be bitwise xor
Suggested change
| __result.__data[__i] = __lhs.__data[__i] != __rhs.__data[__i]; | |
| __result.__data[__i] = __lhs.__data[__i] ^ __rhs.__data[__i]; |
|
|
||
| [[nodiscard]] _CCCL_API static constexpr __simd_size_type __min_index(const _MaskStorage& __s) noexcept | ||
| { | ||
| _CCCL_PRAGMA_UNROLL_FULL() |
Contributor
There was a problem hiding this comment.
Question: Should we add an assert?
Comment on lines
+89
to
+99
| [[nodiscard]] _CCCL_API static constexpr _MaskStorage | ||
| __logic_and(const _MaskStorage& __lhs, const _MaskStorage& __rhs) noexcept | ||
| { | ||
| _MaskStorage __result{}; | ||
| _CCCL_PRAGMA_UNROLL_FULL() | ||
| for (__simd_size_type __i = 0; __i < _Np; ++__i) | ||
| { | ||
| __result.__data[__i] = __lhs.__data[__i] && __rhs.__data[__i]; | ||
| } | ||
| return __result; | ||
| } |
Contributor
There was a problem hiding this comment.
Again, I believe all of those could just be
Suggested change
| [[nodiscard]] _CCCL_API static constexpr _MaskStorage | |
| __logic_and(const _MaskStorage& __lhs, const _MaskStorage& __rhs) noexcept | |
| { | |
| _MaskStorage __result{}; | |
| _CCCL_PRAGMA_UNROLL_FULL() | |
| for (__simd_size_type __i = 0; __i < _Np; ++__i) | |
| { | |
| __result.__data[__i] = __lhs.__data[__i] && __rhs.__data[__i]; | |
| } | |
| return __result; | |
| } | |
| template <__simd_size_type... _Is> | |
| [[nodiscard]] _CCCL_API static constexpr _MaskStorage | |
| __logic_and(const _MaskStorage& __lhs, const _MaskStorage& __rhs, integer_sequence<__simd_size_type, _Is...> = {}) noexcept | |
| { | |
| return _MaskStorage{(__result{__lhs.__data[_Is] && __rhs.__data[_Is])...}; | |
| } |
miscco
reviewed
Apr 9, 2026
| { | ||
| static constexpr size_t __element_bytes = _Bytes; | ||
|
|
||
| bool __data[_Np]{}; // initialization required for constexpr constructor |
Contributor
There was a problem hiding this comment.
I would be really awesome, if we could see whether we can get around this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address #30
Description
Implement the core functionalities of C++26
std::simd, reference https://eel.is/c++draft/simdThe PR introduces the minimal set of functionalities that are self-consistent.
The main goal is to provide a C++26-compliant implementation, no specific optimizations have been introduced.
List of features:
cuda::std::simdnamespace and main header.simd_abi::fixed_size_simple,simd_abi::native,alignment,rebind,resize.flags,flag_default,flag_convert,flag_aligned,flag_overaligned.basic_vecandbasic_maskclasses.fixed_size_simple(custom ABI) specialization.To do: