-
Notifications
You must be signed in to change notification settings - Fork 379
cuda::std::simd core functionalities
#8251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fbusato
wants to merge
37
commits into
NVIDIA:main
Choose a base branch
from
fbusato:simd-core
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
2394c68
std::simd core functionalities
fbusato d65a896
remove simd_abi namespace
fbusato 28dbe31
type_traits unit tests and formatting
fbusato 49ffb87
flags unit test
fbusato e8f7ae3
renaming
fbusato b5e5fee
basic_mask unit test
fbusato e333e93
basic_mask unit tests
fbusato 6c32bf3
basic_mask small improvements
fbusato a243f92
fix CI failures
fbusato cb854c3
extend basic_mask test coverage
fbusato 05d27e1
basic_vec operator unit tests
fbusato 8a129f0
add floating-point
fbusato 2dec0ab
add extended floating point types and deduction guide tests
fbusato 0a053cb
fix deduction guides
fbusato f6dd824
remove macros from fixed_size_vec.h
fbusato 72d6e1c
additional tests and simplifications
fbusato d4d6ea6
address comments and CI
fbusato 99e0412
fixed alignment and added more unit tests
fbusato 089a55c
remove reductions
fbusato 979d861
avoid internal initialization in C++20
fbusato 6a8b6c6
fix headers
fbusato 0377ea4
fix NVRTC c++17
fbusato d34d5d3
add specialization header
fbusato fda62b4
use inline
fbusato 526215a
Update libcudacxx/include/cuda/std/__simd/basic_vec.h
fbusato a998247
remove c++17/20 dispatch
fbusato 9fbcec6
minor simplification
fbusato 2693a1f
follow c++ specification for non-specialized classes
fbusato 0d3a3d3
extend deduction tests
fbusato 574e878
use is_extended_arithmetic
fbusato 996020a
use fwd
fbusato 09ca81c
fix unit test headers
fbusato 185bb13
use const parameters
fbusato 5be8f3d
Merge branch 'main' into simd-core
fbusato 0b0faee
Merge branch 'simd-core' of github.com:fbusato/cccl into simd-core
fbusato 5e64748
use noexcept
fbusato 2c6c796
use TEST_FUNC
fbusato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of libcu++ in the CUDA C++ Core Libraries, | ||
| // under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef _CUDA_STD___FWD_SIMD_H | ||
| #define _CUDA_STD___FWD_SIMD_H | ||
|
|
||
| #include <cuda/std/detail/__config> | ||
|
|
||
| #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) | ||
| # pragma GCC system_header | ||
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) | ||
| # pragma clang system_header | ||
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) | ||
| # pragma system_header | ||
| #endif // no system header | ||
|
|
||
| #include <cuda/std/__cstddef/types.h> | ||
| #include <cuda/std/__simd/abi.h> | ||
| #include <cuda/std/__simd/exposition.h> | ||
|
|
||
| #include <cuda/std/__cccl/prologue.h> | ||
|
|
||
| _CCCL_BEGIN_NAMESPACE_CUDA_STD_SIMD | ||
|
|
||
| template <typename _Tp, typename _Abi = native<_Tp>, typename = void> | ||
| class basic_vec; | ||
|
|
||
| template <size_t _Bytes, typename _Abi = native<__integer_from<_Bytes>>, typename = void> | ||
| class basic_mask; | ||
|
|
||
| template <typename _Tp, __simd_size_type _Np = __simd_size_v<_Tp, native<_Tp>>> | ||
| using vec = basic_vec<_Tp, __deduce_abi_t<_Tp, _Np>>; | ||
|
|
||
| template <typename _Tp, __simd_size_type _Np = __simd_size_v<_Tp, native<_Tp>>> | ||
| using mask = basic_mask<sizeof(_Tp), __deduce_abi_t<_Tp, _Np>>; | ||
|
|
||
| // specializations | ||
|
|
||
| template <typename _Tp, typename _Abi> | ||
| struct __simd_storage; | ||
|
|
||
| template <typename _Tp, typename _Abi> | ||
| struct __simd_operations; | ||
|
|
||
| template <size_t _Bytes, typename _Abi> | ||
| struct __mask_storage; | ||
|
|
||
| template <size_t _Bytes, typename _Abi> | ||
| struct __mask_operations; | ||
|
|
||
| _CCCL_END_NAMESPACE_CUDA_STD_SIMD | ||
|
|
||
| #include <cuda/std/__cccl/epilogue.h> | ||
|
|
||
| #endif // _CUDA_STD___FWD_SIMD_H |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of libcu++ in the CUDA C++ Core Libraries, | ||
| // under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef _CUDA_STD___SIMD_ABI_H | ||
| #define _CUDA_STD___SIMD_ABI_H | ||
|
|
||
| #include <cuda/std/detail/__config> | ||
|
|
||
| #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) | ||
| # pragma GCC system_header | ||
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) | ||
| # pragma clang system_header | ||
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) | ||
| # pragma system_header | ||
| #endif // no system header | ||
|
|
||
| #include <cuda/std/__cstddef/types.h> | ||
|
|
||
| #include <cuda/std/__cccl/prologue.h> | ||
|
|
||
| _CCCL_BEGIN_NAMESPACE_CUDA_STD_SIMD | ||
|
|
||
| using __simd_size_type = ptrdiff_t; | ||
|
|
||
| // [simd.expos.abi], simd ABI tags | ||
| template <__simd_size_type _Np> | ||
| struct __fixed_size; // internal ABI tag | ||
|
|
||
| template <__simd_size_type _Np> | ||
| using fixed_size = __fixed_size<_Np>; // implementation-defined ABI | ||
|
|
||
| // TODO(fbusato): this could be optimized by using max access size / sizeof(T) | ||
| template <typename> | ||
| using native = fixed_size<1>; // implementation-defined ABI | ||
|
|
||
| template <typename, __simd_size_type _Np> | ||
| using __deduce_abi_t = fixed_size<_Np>; // exposition-only | ||
|
|
||
| _CCCL_END_NAMESPACE_CUDA_STD_SIMD | ||
|
|
||
| #include <cuda/std/__cccl/epilogue.h> | ||
|
|
||
| #endif // _CUDA_STD___SIMD_ABI_H |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.