Skip to content

Commit 3877f10

Browse files
authored
[ESIMD] Use BGRA as default value for mask in gather/scatter (#6141)
* [ESIMD] Use BGRA as default value for mask in gather/scatter Signed-off-by: Vyacheslav N Klochkov <[email protected]>
1 parent 09c3b46 commit 3877f10

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sycl/include/sycl/ext/intel/esimd/memory.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,8 @@ __ESIMD_API void scalar_store(AccessorTy acc, uint32_t offset, T val) {
517517
/// undefined.
518518
/// @return Read data - up to N*4 values of type \c Tx.
519519
///
520-
template <rgba_channel_mask RGBAMask, typename T, int N>
520+
template <rgba_channel_mask RGBAMask = rgba_channel_mask::ABGR, typename T,
521+
int N>
521522
__ESIMD_API std::enable_if_t<(N == 8 || N == 16 || N == 32) && sizeof(T) == 4,
522523
simd<T, N * get_num_channels_enabled(RGBAMask)>>
523524
gather_rgba(const T *p, simd<uint32_t, N> offsets, simd_mask<N> mask = 1) {
@@ -568,7 +569,8 @@ template <rgba_channel_mask M> static void validate_rgba_write_channel_mask() {
568569
/// predicate are not accessed. Their values in the resulting vector are
569570
/// undefined.
570571
///
571-
template <rgba_channel_mask RGBAMask, typename T, int N>
572+
template <rgba_channel_mask RGBAMask = rgba_channel_mask::ABGR, typename T,
573+
int N>
572574
__ESIMD_API std::enable_if_t<(N == 8 || N == 16 || N == 32) && sizeof(T) == 4>
573575
scatter_rgba(T *p, simd<uint32_t, N> offsets,
574576
simd<T, N * get_num_channels_enabled(RGBAMask)> vals,
@@ -613,7 +615,8 @@ __ESIMD_API std::
613615
/// undefined.
614616
/// @return Read data - up to N*4 values of type \c Tx.
615617
///
616-
template <rgba_channel_mask RGBAMask, typename AccessorT, int N,
618+
template <rgba_channel_mask RGBAMask = rgba_channel_mask::ABGR,
619+
typename AccessorT, int N,
617620
typename T = typename AccessorT::value_type>
618621
__ESIMD_API std::enable_if_t<((N == 8 || N == 16 || N == 32) &&
619622
sizeof(T) == 4 && !std::is_pointer_v<AccessorT>),
@@ -642,7 +645,8 @@ gather_rgba(AccessorT acc, simd<uint32_t, N> offsets,
642645
/// @param global_offset Byte offset of the pixels relative to the base pointer.
643646
/// @param mask Operation mask. All-1 by default.
644647
///
645-
template <rgba_channel_mask RGBAMask, typename AccessorT, int N,
648+
template <rgba_channel_mask RGBAMask = rgba_channel_mask::ABGR,
649+
typename AccessorT, int N,
646650
typename T = typename AccessorT::value_type>
647651
__ESIMD_API std::enable_if_t<(N == 8 || N == 16 || N == 32) && sizeof(T) == 4 &&
648652
!std::is_pointer_v<AccessorT>>

0 commit comments

Comments
 (0)