Skip to content
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

[SYCL] Use std::array as storage for syc::vec on device #13270

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
2b2a3d7
Made preview-breaking-changes default
uditagarwal97 Mar 29, 2024
459e66d
Initial cleanup
uditagarwal97 Apr 3, 2024
fd09190
Merge origin/sycl
uditagarwal97 Apr 3, 2024
7065472
Fix
uditagarwal97 Apr 3, 2024
0ca00e2
Delete sycl/test_bfloat.cpp
uditagarwal97 Apr 3, 2024
b3881f0
Cleanup
uditagarwal97 Apr 3, 2024
d77d537
Cleanup
uditagarwal97 Apr 10, 2024
1fe41c2
More cleanup
uditagarwal97 Apr 10, 2024
a75a93b
Fix failures
uditagarwal97 Apr 11, 2024
c78b57d
Fiox formatting
uditagarwal97 Apr 11, 2024
ca85863
Add a test for checking dveice code.
uditagarwal97 Apr 12, 2024
8af05a2
Fix formating
uditagarwal97 Apr 12, 2024
c1763a0
Fix test
uditagarwal97 Apr 12, 2024
209e9f0
Remove HostHalf
uditagarwal97 Apr 12, 2024
4cda13a
Adress reviews
uditagarwal97 Apr 12, 2024
91301c3
Fix failures
uditagarwal97 Apr 14, 2024
7305e3b
Fix
uditagarwal97 Apr 16, 2024
f8840c2
Fix formatting and device code check test case.
uditagarwal97 Apr 16, 2024
ea6f828
Fix formatting
uditagarwal97 Apr 16, 2024
686b9fc
More formatting
uditagarwal97 Apr 16, 2024
4fb6456
Merge remote-tracking branch 'origin/sycl' into vector-refac
uditagarwal97 Apr 17, 2024
7af74da
Remove comments
uditagarwal97 Apr 17, 2024
88ae8af
Fix SYCL-CTS
uditagarwal97 Apr 17, 2024
2c33af1
Wrap changes in PREVIEW_BREAKING_FLAG
uditagarwal97 Apr 18, 2024
efef104
Fix formating
uditagarwal97 Apr 18, 2024
49d83f3
Create a new header for vector
uditagarwal97 Apr 23, 2024
b22b47b
Refactor sycl::vec into a header of its own.
uditagarwal97 Apr 24, 2024
b0dc2f9
Fix formatting and LIT tests
uditagarwal97 Apr 24, 2024
aa43da1
Create a seperate header for ABI breaking changes.
uditagarwal97 Apr 24, 2024
e45b3c6
Create a new header for vector
uditagarwal97 Apr 23, 2024
d7adc6e
Create a seperate header for ABI breaking changes.
uditagarwal97 Apr 24, 2024
259240c
Refactor sycl::vec into a header of its own.
uditagarwal97 Apr 24, 2024
f640f02
Merge branch 'vec_header_preview_changes' into vector-refac
uditagarwal97 Apr 24, 2024
34fdbc6
Fix no line at EOF
uditagarwal97 Apr 24, 2024
8c285a8
Add device code tests for vector operations.
uditagarwal97 Apr 25, 2024
49fa63d
Remove redundant code
uditagarwal97 Apr 26, 2024
4516e75
Add line at EOF
uditagarwal97 Apr 26, 2024
e8adc8a
Simplify code
uditagarwal97 Apr 26, 2024
eb8b8b7
Merge the test cases. Add detailed checks
uditagarwal97 Apr 28, 2024
3879fe9
Merge branch 'vector_add_device_code_tests' into vector-refac
uditagarwal97 Apr 28, 2024
ec0717d
Don't use ext_vector for bool with ! operator
uditagarwal97 Apr 29, 2024
fb8fba3
Merge remote-tracking branch 'upstream/sycl' into vector-refac
uditagarwal97 Apr 30, 2024
75df511
Merge remote-tracking branch 'upstream/sycl' into vector-refac
uditagarwal97 Apr 30, 2024
3b652fb
Remove redundant changes
uditagarwal97 Apr 30, 2024
55329df
Update vec device code test
uditagarwal97 May 1, 2024
3d9b9d0
Merge branch 'sycl' into vector-refac
uditagarwal97 May 1, 2024
fc95f45
Update test
uditagarwal97 May 1, 2024
be95897
Merge branch 'vector-refac' of https://github.com/uditagarwal97/llvm …
uditagarwal97 May 1, 2024
f71b232
Remove storage type alias
uditagarwal97 May 2, 2024
c7eba64
clang format
uditagarwal97 May 2, 2024
61dd7d4
clang-format
uditagarwal97 May 2, 2024
5dd79c0
Optimize operations on half
uditagarwal97 May 2, 2024
d4da05d
Removed VecStorage type aliases
uditagarwal97 May 3, 2024
8aa33e4
Remove some vec_helper stuff
uditagarwal97 May 3, 2024
0b223b8
Replace HalfStorage with half as storage type for sycl::half vec
uditagarwal97 May 3, 2024
6b09e14
Fix
uditagarwal97 May 3, 2024
4eb19da
Fix comments. DCE
uditagarwal97 May 3, 2024
2451cc2
Make std::byte as storage type for vec<byte,_>
uditagarwal97 May 4, 2024
04d9121
More DCE. Refactor std::byte sycl::vec
uditagarwal97 May 7, 2024
26987f4
Fix sycl::vec BFloat16
uditagarwal97 May 7, 2024
1c85fc8
For Num=1, store as array<_, 1>
uditagarwal97 May 8, 2024
3812b8c
Limit math operations to their designated types, as per the SPEC.
uditagarwal97 May 8, 2024
62dd74d
Add guard before using std::byte
uditagarwal97 May 8, 2024
54e9c25
clang format
uditagarwal97 May 8, 2024
4ec3cc1
Update dev code. Replace union UB with __builtin_bit_cast
uditagarwal97 May 9, 2024
76a2ca3
Remove unnessary use of vec_data casts.
uditagarwal97 May 9, 2024
3073a13
Address reviews
uditagarwal97 May 9, 2024
668334b
Merge branch 'sycl' into vector-refac
uditagarwal97 May 9, 2024
1ec252d
Fix test failure for half swizzles.
uditagarwal97 May 9, 2024
f1b7496
Fix build on Windows
uditagarwal97 May 9, 2024
4b63aff
Merge branch 'sycl' into vector-refac
uditagarwal97 May 9, 2024
2e85695
Address reviews
uditagarwal97 May 13, 2024
66c30bc
Address reviews
uditagarwal97 May 14, 2024
4dd04bd
Merge branch 'sycl' into vector-refac
uditagarwal97 May 14, 2024
5579f7b
Address reviews. Fix formatting and tests
uditagarwal97 May 16, 2024
3b6da03
Fix cformatting
uditagarwal97 May 16, 2024
48713c7
Remove invert logic for NumElements=1 as we now use ext_vector_type f…
uditagarwal97 May 16, 2024
9376a62
Address reviews
uditagarwal97 May 17, 2024
a953f6a
Fix tests
uditagarwal97 May 17, 2024
d41f747
Replace static_cast<vector_t> with sycl::bit_cast
uditagarwal97 May 20, 2024
561a225
Add asserts. Address reviews.
uditagarwal97 May 20, 2024
4a89d59
All tests passing, including CTS. Address reviews
uditagarwal97 May 23, 2024
f4b965c
Merge byte_preview and byte
uditagarwal97 May 23, 2024
cf9d905
Fix vector/byte E2E test case. Restrict swizzles of std::byte to limi…
uditagarwal97 May 24, 2024
1e61bd1
Store bool as it is, not as int8_t. All test passing.
uditagarwal97 May 28, 2024
79012b7
Refactor setValue and getValue
uditagarwal97 May 28, 2024
1b260d0
Address reviews.
uditagarwal97 May 28, 2024
935c139
Fix formatting
uditagarwal97 May 28, 2024
7f3badd
clang-format; update check_device_code/vector
uditagarwal97 May 28, 2024
273229a
Remove cast
uditagarwal97 May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sycl/include/sycl/detail/generic_type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ template <typename T> auto convertToOpenCLType(T &&x) {
// TODO: for some mysterious reasons on NonUniformGroups E2E tests fail if
// we use the "else" version only. I suspect that's an issues with
// non-uniform groups implementation.
if constexpr (std::is_same_v<MatchingVec, no_ref>)
return static_cast<typename MatchingVec::vector_t>(x);
else
return static_cast<typename MatchingVec::vector_t>(
x.template as<MatchingVec>());
if constexpr (std::is_same_v<MatchingVec, no_ref>) {
return bit_cast<typename no_ref::vector_t>(x);
} else {
return bit_cast<typename MatchingVec::vector_t>(x);
}
uditagarwal97 marked this conversation as resolved.
Show resolved Hide resolved
#else
return x.template as<MatchingVec>();
#endif
Expand Down
6 changes: 6 additions & 0 deletions sycl/include/sycl/ext/oneapi/bfloat16.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ using Vec3StorageT = Bfloat16StorageT __attribute__((ext_vector_type(3)));
using Vec4StorageT = Bfloat16StorageT __attribute__((ext_vector_type(4)));
using Vec8StorageT = Bfloat16StorageT __attribute__((ext_vector_type(8)));
using Vec16StorageT = Bfloat16StorageT __attribute__((ext_vector_type(16)));

using Vec2DeviceStorageT = std::array<Bfloat16StorageT, 2>;
using Vec3DeviceStorageT = std::array<Bfloat16StorageT, 3>;
using Vec4DeviceStorageT = std::array<Bfloat16StorageT, 4>;
using Vec8DeviceStorageT = std::array<Bfloat16StorageT, 8>;
using Vec16DeviceStorageT = std::array<Bfloat16StorageT, 16>;
#else
using Vec2StorageT = std::array<Bfloat16StorageT, 2>;
using Vec3StorageT = std::array<Bfloat16StorageT, 3>;
Expand Down
6 changes: 6 additions & 0 deletions sycl/include/sycl/half_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ using Vec3StorageT = StorageT __attribute__((ext_vector_type(3)));
using Vec4StorageT = StorageT __attribute__((ext_vector_type(4)));
using Vec8StorageT = StorageT __attribute__((ext_vector_type(8)));
using Vec16StorageT = StorageT __attribute__((ext_vector_type(16)));

using Vec2DeviceStorageT = std::array<StorageT, 2>;
using Vec3DeviceStorageT = std::array<StorageT, 4>;
using Vec4DeviceStorageT = std::array<StorageT, 4>;
using Vec8DeviceStorageT = std::array<StorageT, 8>;
using Vec16DeviceStorageT = std::array<StorageT, 16>;
#else // SYCL_DEVICE_ONLY
using StorageT = detail::host_half_impl::half;
// No need to extract underlying data type for built-in functions operating on
Expand Down
Loading
Loading