Skip to content

Commit 8ab843b

Browse files
authored
[SYCL] Remove sycl::byte alias (#4424)
sycl::byte is deprecated in SYCL 2020
1 parent b27c57c commit 8ab843b

File tree

6 files changed

+13
-26
lines changed

6 files changed

+13
-26
lines changed

sycl/include/CL/sycl/aliases.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ using half __SYCL2020_DEPRECATED("use 'sycl::half' instead") =
6868

6969
__SYCL_INLINE_NAMESPACE(cl) {
7070
namespace sycl {
71-
using byte __SYCL2020_DEPRECATED("use std::byte instead") = std::uint8_t;
7271
using schar = signed char;
7372
using uchar = unsigned char;
7473
using ushort = unsigned short;

sycl/include/CL/sycl/detail/image_impl.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
__SYCL_INLINE_NAMESPACE(cl) {
2323
namespace sycl {
24-
2524
// forward declarations
2625
enum class image_channel_order : unsigned int;
2726
enum class image_channel_type : unsigned int;
@@ -36,7 +35,7 @@ class handler;
3635
namespace detail {
3736

3837
// utility functions and typedefs for image_impl
39-
using image_allocator = aligned_allocator<byte>;
38+
using image_allocator = aligned_allocator<unsigned char>;
4039

4140
// utility function: Returns the Number of Channels for a given Order.
4241
__SYCL_EXPORT uint8_t getImageNumberChannels(image_channel_order Order);

sycl/include/CL/sycl/image.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ enum class image_channel_type : unsigned int {
5959
fp32 = 14
6060
};
6161

62-
using byte = unsigned char;
63-
64-
using image_allocator = detail::aligned_allocator<byte>;
62+
using image_allocator = detail::aligned_allocator<unsigned char>;
6563

6664
/// Defines a shared image data.
6765
///

sycl/include/CL/sycl/sycl_span.hpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ template<class Container>
138138
__SYCL_INLINE_NAMESPACE(cl) {
139139
namespace sycl {
140140

141-
// byte is unsigned char at sycl/image.hpp:58
142-
using byte = unsigned char;
143-
144141
// asserts suppressed for device compatibility.
145142
// TODO: enable
146143
#if defined(__SYCL_DEVICE_ONLY__)
@@ -384,16 +381,17 @@ template <typename _Tp, size_t _Extent> class _SYCL_SPAN_TEMPLATE_VIS span {
384381
return rev_iterator(begin());
385382
}
386383

387-
_SYCL_SPAN_INLINE_VISIBILITY span<const byte, _Extent * sizeof(element_type)>
384+
_SYCL_SPAN_INLINE_VISIBILITY
385+
span<const std::byte, _Extent * sizeof(element_type)>
388386
__as_bytes() const noexcept {
389-
return span<const byte, _Extent * sizeof(element_type)>{
390-
reinterpret_cast<const byte *>(data()), size_bytes()};
387+
return span<const std::byte, _Extent * sizeof(element_type)>{
388+
reinterpret_cast<const std::byte *>(data()), size_bytes()};
391389
}
392390

393-
_SYCL_SPAN_INLINE_VISIBILITY span<byte, _Extent * sizeof(element_type)>
391+
_SYCL_SPAN_INLINE_VISIBILITY span<std::byte, _Extent * sizeof(element_type)>
394392
__as_writable_bytes() const noexcept {
395-
return span<byte, _Extent * sizeof(element_type)>{
396-
reinterpret_cast<byte *>(data()), size_bytes()};
393+
return span<std::byte, _Extent * sizeof(element_type)>{
394+
reinterpret_cast<std::byte *>(data()), size_bytes()};
397395
}
398396

399397
private:
@@ -577,14 +575,14 @@ class _SYCL_SPAN_TEMPLATE_VIS span<_Tp, dynamic_extent> {
577575
return rev_iterator(begin());
578576
}
579577

580-
_SYCL_SPAN_INLINE_VISIBILITY span<const byte, dynamic_extent>
578+
_SYCL_SPAN_INLINE_VISIBILITY span<const std::byte, dynamic_extent>
581579
__as_bytes() const noexcept {
582-
return {reinterpret_cast<const byte *>(data()), size_bytes()};
580+
return {reinterpret_cast<const std::byte *>(data()), size_bytes()};
583581
}
584582

585-
_SYCL_SPAN_INLINE_VISIBILITY span<byte, dynamic_extent>
583+
_SYCL_SPAN_INLINE_VISIBILITY span<std::byte, dynamic_extent>
586584
__as_writable_bytes() const noexcept {
587-
return {reinterpret_cast<byte *>(data()), size_bytes()};
585+
return {reinterpret_cast<std::byte *>(data()), size_bytes()};
588586
}
589587

590588
private:

sycl/test/basic_tests/types.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ int main() {
9393
// Check the size and alignment of the SYCL vectors.
9494
checkVectors();
9595

96-
// Table 4.93: Additional scalar data types supported by SYCL.
97-
static_assert(sizeof(s::byte) == sizeof(int8_t), "");
98-
9996
// Table 4.94: Scalar data type aliases supported by SYCL
10097
static_assert(is_same<s::cl_bool, decltype(0 != 1)>::value, "");
10198
checkSizeForSignedIntegral<s::cl_char, sizeof(int8_t)>();

sycl/test/warnings/sycl_2020_deprecations.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ int main() {
130130
});
131131
});
132132

133-
// expected-warning@+1{{'byte' is deprecated: use std::byte instead}}
134-
sycl::byte B;
135-
(void)B;
136-
137133
// expected-warning@+1{{'max_constant_buffer_size' is deprecated: max_constant_buffer_size is deprecated}}
138134
auto MCBS = sycl::info::device::max_constant_buffer_size;
139135
(void)MCBS;

0 commit comments

Comments
 (0)