@@ -421,13 +421,15 @@ __esimd_scatter_scaled(__ESIMD_DNS::simd_mask_storage_t<N> pred,
421
421
#else
422
422
{
423
423
static_assert (N == 1 || N == 8 || N == 16 || N == 32 );
424
+ static_assert (sizeof (Ty) == 4 );
424
425
static_assert (TySizeLog2 <= 2 );
425
426
static_assert (std::is_integral<Ty>::value || TySizeLog2 == 2 );
426
427
427
428
// determine the original element's type size (as __esimd_scatter_scaled
428
429
// requires vals to be a vector of 4-byte integers)
429
430
constexpr size_t OrigSize = __ESIMD_DNS::ElemsPerAddrDecoding (TySizeLog2);
430
- using RestoredTy = __ESIMD_DNS::uint_type_t <OrigSize>;
431
+ using RestoredTy = std::conditional_t <sizeof (Ty) == OrigSize, Ty,
432
+ __ESIMD_DNS::uint_type_t <OrigSize>>;
431
433
432
434
sycl::detail::ESIMDDeviceInterface *I =
433
435
sycl::detail::getESIMDDeviceInterface ();
@@ -638,11 +640,13 @@ __esimd_gather_masked_scaled2(SurfIndAliasTy surf_ind, uint32_t global_offset,
638
640
#else
639
641
{
640
642
static_assert (Scale == 0 );
643
+ static_assert (sizeof (Ty) == 4 );
641
644
642
645
// determine the original element's type size (as __esimd_scatter_scaled
643
646
// requires vals to be a vector of 4-byte integers)
644
647
constexpr size_t OrigSize = __ESIMD_DNS::ElemsPerAddrDecoding (TySizeLog2);
645
- using RestoredTy = __ESIMD_DNS::uint_type_t <OrigSize>;
648
+ using RestoredTy = std::conditional_t <sizeof (Ty) == OrigSize, Ty,
649
+ __ESIMD_DNS::uint_type_t <OrigSize>>;
646
650
647
651
__ESIMD_DNS::vector_type_t <Ty, N> retv = 0 ;
648
652
sycl::detail::ESIMDDeviceInterface *I =
0 commit comments