Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][ESIMD] Removing warning messages from deprecated definitions #340

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions SYCL/ESIMD/BitonicSortK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ bitonic_exchange4(simd<uint32_t, BASE_SZ> A, simd<ushort, 32> flip) {
simd<uint32_t, BASE_SZ> B;
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MA = A.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MA = A.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
MB.select<4, 1, 4, 1>(0, 0) = MA.select<4, 1, 4, 1>(0, 4);
MB.select<4, 1, 4, 1>(0, 4) = MA.select<4, 1, 4, 1>(0, 0);
B.select<32, 1>(i).merge(A.select<32, 1>(i),
Expand Down Expand Up @@ -196,8 +196,8 @@ bitonic_exchange2(simd<uint32_t, BASE_SZ> A, simd<ushort, 32> flip) {
simd<uint32_t, BASE_SZ> B;
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MB = B.select<32, 1>(i).format<long long, 4, 4>();
auto MA = A.select<32, 1>(i).format<long long, 4, 4>();
auto MB = B.select<32, 1>(i).bit_cast_view<long long, 4, 4>();
auto MA = A.select<32, 1>(i).bit_cast_view<long long, 4, 4>();
MB.select<4, 1, 2, 2>(0, 0) = MA.select<4, 1, 2, 2>(0, 1);
MB.select<4, 1, 2, 2>(0, 1) = MA.select<4, 1, 2, 2>(0, 0);
B.select<32, 1>(i).merge(A.select<32, 1>(i),
Expand Down Expand Up @@ -326,8 +326,8 @@ ESIMD_INLINE void bitonic_merge(uint32_t offset, simd<uint32_t, BASE_SZ> &A,
simd<ushort, 32> flip16(init_mask16);
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MA = A.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MA = A.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
MA.select<4, 1, 4, 1>(0, 0) = MB.select<4, 1, 4, 1>(0, 4);
MA.select<4, 1, 4, 1>(0, 4) = MB.select<4, 1, 4, 1>(0, 0);
bool dir_up = (((offset + i) >> (m + 1)) & 1) == 0;
Expand All @@ -346,8 +346,8 @@ ESIMD_INLINE void bitonic_merge(uint32_t offset, simd<uint32_t, BASE_SZ> &A,
simd<ushort, 32> flip18(init_mask18);
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MB = B.select<32, 1>(i).format<long long, 4, 4>();
auto MA = A.select<32, 1>(i).format<long long, 4, 4>();
auto MB = B.select<32, 1>(i).bit_cast_view<long long, 4, 4>();
auto MA = A.select<32, 1>(i).bit_cast_view<long long, 4, 4>();

MB.select<4, 1, 2, 2>(0, 0) = MA.select<4, 1, 2, 2>(0, 1);
MB.select<4, 1, 2, 2>(0, 1) = MA.select<4, 1, 2, 2>(0, 0);
Expand Down
16 changes: 8 additions & 8 deletions SYCL/ESIMD/BitonicSortKv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ bitonic_exchange4(simd<uint32_t, BASE_SZ> A, simd<ushort, 32> flip) {
simd<uint32_t, BASE_SZ> B;
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MA = A.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MA = A.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
MB.select<4, 1, 4, 1>(0, 0) = MA.select<4, 1, 4, 1>(0, 4);
MB.select<4, 1, 4, 1>(0, 4) = MA.select<4, 1, 4, 1>(0, 0);
B.select<32, 1>(i).merge(A.select<32, 1>(i),
Expand Down Expand Up @@ -113,8 +113,8 @@ bitonic_exchange2(simd<uint32_t, BASE_SZ> A, simd<ushort, 32> flip) {
simd<uint32_t, BASE_SZ> B;
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MB = B.select<32, 1>(i).format<long long, 4, 4>();
auto MA = A.select<32, 1>(i).format<long long, 4, 4>();
auto MB = B.select<32, 1>(i).bit_cast_view<long long, 4, 4>();
auto MA = A.select<32, 1>(i).bit_cast_view<long long, 4, 4>();
MB.select<4, 1, 2, 2>(0, 0) = MA.select<4, 1, 2, 2>(0, 1);
MB.select<4, 1, 2, 2>(0, 1) = MA.select<4, 1, 2, 2>(0, 0);
B.select<32, 1>(i).merge(A.select<32, 1>(i),
Expand Down Expand Up @@ -243,8 +243,8 @@ ESIMD_INLINE void bitonic_merge(uint32_t offset, simd<uint32_t, BASE_SZ> &A,
simd<ushort, 32> flip16 = esimd_unpack_mask<32>(0x0f0f0f0f); //(init_mask16);
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MA = A.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).format<uint32_t, 4, 8>();
auto MA = A.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
auto MB = B.select<32, 1>(i).bit_cast_view<uint32_t, 4, 8>();
MA.select<4, 1, 4, 1>(0, 0) = MB.select<4, 1, 4, 1>(0, 4);
MA.select<4, 1, 4, 1>(0, 4) = MB.select<4, 1, 4, 1>(0, 0);
bool dir_up = (((offset + i) >> (m + 1)) & 1) == 0;
Expand All @@ -263,8 +263,8 @@ ESIMD_INLINE void bitonic_merge(uint32_t offset, simd<uint32_t, BASE_SZ> &A,
simd<ushort, 32> flip18 = esimd_unpack_mask<32>(0x33333333); //(init_mask18);
#pragma unroll
for (int i = 0; i < BASE_SZ; i += 32) {
auto MB = B.select<32, 1>(i).format<long long, 4, 4>();
auto MA = A.select<32, 1>(i).format<long long, 4, 4>();
auto MB = B.select<32, 1>(i).bit_cast_view<long long, 4, 4>();
auto MA = A.select<32, 1>(i).bit_cast_view<long long, 4, 4>();

MB.select<4, 1, 2, 2>(0, 0) = MA.select<4, 1, 2, 2>(0, 1);
MB.select<4, 1, 2, 2>(0, 1) = MA.select<4, 1, 2, 2>(0, 0);
Expand Down
12 changes: 6 additions & 6 deletions SYCL/ESIMD/PrefixSum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#define TUPLE_SZ 1

#if TUPLE_SZ == 1
#define GATHER_SCATTER_MASK ESIMD_R_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::R
#elif TUPLE_SZ == 2
#define GATHER_SCATTER_MASK ESIMD_GR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::GR
#elif TUPLE_SZ == 4
#define GATHER_SCATTER_MASK ESIMD_ABGR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::ABGR
#endif

#define LOG_ENTRIES 8
Expand Down Expand Up @@ -148,7 +148,7 @@ void cmk_acum_iterative(unsigned *buf, unsigned h_pos,
S += T;
}

auto cnt_table = S.format<unsigned int, 32, TUPLE_SZ>();
auto cnt_table = S.bit_cast_view<unsigned int, 32, TUPLE_SZ>();
// sum reduction for each bin
cnt_table.select<16, 1, TUPLE_SZ, 1>(0, 0) +=
cnt_table.select<16, 1, TUPLE_SZ, 1>(16, 0);
Expand Down Expand Up @@ -186,7 +186,7 @@ void cmk_acum_final(unsigned *buf, unsigned h_pos, unsigned int stride_elems,

S = gather4<unsigned int, 32, GATHER_SCATTER_MASK>(buf, element_offset, p);

auto cnt_table = S.format<unsigned int, TUPLE_SZ, 32>();
auto cnt_table = S.bit_cast_view<unsigned int, TUPLE_SZ, 32>();
cnt_table.column(0) += prev;
#pragma unroll
for (unsigned j = 0; j < TUPLE_SZ; j++) {
Expand Down Expand Up @@ -254,7 +254,7 @@ void cmk_prefix_iterative(unsigned *buf, unsigned h_pos,

S = gather4<unsigned int, 32, GATHER_SCATTER_MASK>(buf, element_offset);

auto cnt_table = S.format<unsigned int, TUPLE_SZ, 32>();
auto cnt_table = S.bit_cast_view<unsigned int, TUPLE_SZ, 32>();
cnt_table.column(0) += prev;
#pragma unroll
for (unsigned j = 0; j < TUPLE_SZ; j++) {
Expand Down
8 changes: 4 additions & 4 deletions SYCL/ESIMD/Prefix_Local_sum1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#define TUPLE_SZ 1

#if TUPLE_SZ == 1
#define GATHER_SCATTER_MASK ESIMD_R_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::R
#elif TUPLE_SZ == 2
#define GATHER_SCATTER_MASK ESIMD_GR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::GR
#elif TUPLE_SZ == 4
#define GATHER_SCATTER_MASK ESIMD_ABGR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::ABGR
#endif

#define PREFIX_ENTRIES 256
Expand Down Expand Up @@ -87,7 +87,7 @@ void cmk_sum_tuple_count(unsigned int *buf, unsigned int h_pos) {
}

// format S to be a 32xTUPLE_SZ matrix
auto cnt_table = S.format<unsigned int, 32, TUPLE_SZ>();
auto cnt_table = S.bit_cast_view<unsigned int, 32, TUPLE_SZ>();
// sum reduction for each bin
cnt_table.select<16, 1, TUPLE_SZ, 1>(0, 0) +=
cnt_table.select<16, 1, TUPLE_SZ, 1>(16, 0);
Expand Down
8 changes: 4 additions & 4 deletions SYCL/ESIMD/Prefix_Local_sum2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#define TUPLE_SZ 4

#if TUPLE_SZ == 1
#define GATHER_SCATTER_MASK ESIMD_R_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::R
#elif TUPLE_SZ == 2
#define GATHER_SCATTER_MASK ESIMD_GR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::GR
#elif TUPLE_SZ == 4
#define GATHER_SCATTER_MASK ESIMD_ABGR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::ABGR
#endif

#define PREFIX_ENTRIES 256
Expand Down Expand Up @@ -83,7 +83,7 @@ void cmk_acum_iterative(unsigned *buf, unsigned h_pos,
S += T;
}

auto cnt_table = S.format<unsigned int, TUPLE_SZ, 32>();
auto cnt_table = S.bit_cast_view<unsigned int, TUPLE_SZ, 32>();

simd<unsigned, TUPLE_SZ> sum;
#pragma unroll
Expand Down
12 changes: 6 additions & 6 deletions SYCL/ESIMD/Prefix_Local_sum3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#define TUPLE_SZ 2

#if TUPLE_SZ == 1
#define GATHER_SCATTER_MASK ESIMD_R_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::R
#elif TUPLE_SZ == 2
#define GATHER_SCATTER_MASK ESIMD_GR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::GR
#elif TUPLE_SZ == 4
#define GATHER_SCATTER_MASK ESIMD_ABGR_ENABLE
#define GATHER_SCATTER_MASK rgba_channel_mask::ABGR
#endif

#define LOG_ENTRIES 8
Expand Down Expand Up @@ -110,7 +110,7 @@ void cmk_acum_iterative(unsigned *buf, unsigned h_pos,
S += T;
}

auto cnt_table = S.format<unsigned int, 32, TUPLE_SZ>();
auto cnt_table = S.bit_cast_view<unsigned int, 32, TUPLE_SZ>();
// sum reduction for each bin
cnt_table.select<16, 1, TUPLE_SZ, 1>(0, 0) +=
cnt_table.select<16, 1, TUPLE_SZ, 1>(16, 0);
Expand Down Expand Up @@ -161,7 +161,7 @@ void cmk_acum_iterative_low(unsigned *buf, unsigned h_pos,
S += T;
}

auto cnt_table = S.format<unsigned int, 32, TUPLE_SZ>();
auto cnt_table = S.bit_cast_view<unsigned int, 32, TUPLE_SZ>();
// sum reduction for each bin
cnt_table.select<16, 1, TUPLE_SZ, 1>(0, 0) +=
cnt_table.select<16, 1, TUPLE_SZ, 1>(16, 0);
Expand Down Expand Up @@ -199,7 +199,7 @@ void cmk_acum_final(unsigned *buf, unsigned h_pos, unsigned int stride_elems,

S = gather4<unsigned int, 32, GATHER_SCATTER_MASK>(buf, element_offset, p);

auto cnt_table = S.format<unsigned int, TUPLE_SZ, 32>();
auto cnt_table = S.bit_cast_view<unsigned int, TUPLE_SZ, 32>();
cnt_table.column(0) += prev;
for (unsigned j = 0; j < TUPLE_SZ; j++) {
// step 1
Expand Down
2 changes: 1 addition & 1 deletion SYCL/ESIMD/Stencil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) {

simd<float, (HEIGHT + 10) * 32> vin;
// matrix HEIGHT+10 x 32
auto in = vin.format<float, HEIGHT + 10, 32>();
auto in = vin.bit_cast_view<float, HEIGHT + 10, 32>();

//
// rather than loading all data in
Expand Down
4 changes: 2 additions & 2 deletions SYCL/ESIMD/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ int main(int argc, char *argv[]) {
src = histogram.select<8, 1>(i);

#ifdef __SYCL_DEVICE_ONLY__
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, unsigned int, 8>(
bins, offset, src, 1);
flat_atomic<atomic_op::add, unsigned int, 8>(bins, offset, src,
1);
offset += 8 * sizeof(unsigned int);
#else
simd<unsigned int, 8> vals;
Expand Down
12 changes: 6 additions & 6 deletions SYCL/ESIMD/histogram_256_slm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
auto start_addr = ((unsigned int *)input_ptr) + start_off;
simd<uint, 32> data;
data.copy_from(start_addr);
auto in = data.format<uchar>();
auto in = data.bit_cast_view<uchar>();

#pragma unroll
for (int j = 0; j < BLOCK_WIDTH * sizeof(int); j += 16) {
// Accumulate local histogram for each pixel value
simd<uint, 16> dataOffset = in.select<16, 1>(j).read();
dataOffset *= sizeof(int);
slm_atomic<EsimdAtomicOpType::ATOMIC_INC, uint, 16>(dataOffset, 1);
slm_atomic<atomic_op::inc, uint, 16>(dataOffset, 1);
}
start_off += BLOCK_WIDTH;
}
Expand All @@ -61,10 +61,10 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
// Update global sum by atomically adding each local histogram
simd<uint, 16> local_histogram;
local_histogram = slm_load<uint32_t, 16>(slm_offset);
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, uint32_t, 8>(
output, slm_offset.select<8, 1>(0), local_histogram.select<8, 1>(0), 1);
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, uint32_t, 8>(
output, slm_offset.select<8, 1>(8), local_histogram.select<8, 1>(8), 1);
flat_atomic<atomic_op::add, uint32_t, 8>(output, slm_offset.select<8, 1>(0),
local_histogram.select<8, 1>(0), 1);
flat_atomic<atomic_op::add, uint32_t, 8>(output, slm_offset.select<8, 1>(8),
local_histogram.select<8, 1>(8), 1);
}

// This function calculates histogram of the image with the CPU.
Expand Down
12 changes: 6 additions & 6 deletions SYCL/ESIMD/histogram_256_slm_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
auto start_addr = ((unsigned int *)input_ptr) + start_off;
simd<uint, 32> data;
data.copy_from(start_addr);
auto in = data.format<uchar>();
auto in = data.bit_cast_view<uchar>();

#pragma unroll
for (int j = 0; j < BLOCK_WIDTH * sizeof(int); j += 16) {
// Accumulate local histogram for each pixel value
simd<uint, 16> dataOffset = in.select<16, 1>(j).read();
dataOffset *= sizeof(int);
slm_atomic<EsimdAtomicOpType::ATOMIC_INC, uint, 16>(dataOffset, 1);
slm_atomic<atomic_op::inc, uint, 16>(dataOffset, 1);
}
start_off += BLOCK_WIDTH;
}
Expand All @@ -62,10 +62,10 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
// Update global sum by atomically adding each local histogram
simd<uint, 16> local_histogram;
local_histogram = slm_load<uint32_t, 16>(slm_offset);
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, uint32_t, 8>(
output, slm_offset.select<8, 1>(0), local_histogram.select<8, 1>(0), 1);
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, uint32_t, 8>(
output, slm_offset.select<8, 1>(8), local_histogram.select<8, 1>(8), 1);
flat_atomic<atomic_op::add, uint32_t, 8>(output, slm_offset.select<8, 1>(0),
local_histogram.select<8, 1>(0), 1);
flat_atomic<atomic_op::add, uint32_t, 8>(output, slm_offset.select<8, 1>(8),
local_histogram.select<8, 1>(8), 1);
}

// This function calculates histogram of the image with the CPU.
Expand Down
12 changes: 6 additions & 6 deletions SYCL/ESIMD/histogram_256_slm_spec_2020.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
for (int y = 0; y < num_blocks; y++) {
auto start_addr = ((unsigned int *)input_ptr) + start_off;
auto data = block_load<uint, 32>(start_addr);
auto in = data.format<uchar>();
auto in = data.bit_cast_view<uchar>();

#pragma unroll
for (int j = 0; j < BLOCK_WIDTH * sizeof(int); j += 16) {
// Accumulate local histogram for each pixel value
simd<uint, 16> dataOffset = in.select<16, 1>(j).read();
dataOffset *= sizeof(int);
slm_atomic<EsimdAtomicOpType::ATOMIC_INC, uint, 16>(dataOffset, 1);
slm_atomic<atomic_op::inc, uint, 16>(dataOffset, 1);
}
start_off += BLOCK_WIDTH;
}
Expand All @@ -56,10 +56,10 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
// Update global sum by atomically adding each local histogram
simd<uint, 16> local_histogram;
local_histogram = slm_load<uint32_t, 16>(slm_offset);
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, uint32_t, 8>(
output, slm_offset.select<8, 1>(0), local_histogram.select<8, 1>(0), 1);
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, uint32_t, 8>(
output, slm_offset.select<8, 1>(8), local_histogram.select<8, 1>(8), 1);
flat_atomic<atomic_op::add, uint32_t, 8>(output, slm_offset.select<8, 1>(0),
local_histogram.select<8, 1>(0), 1);
flat_atomic<atomic_op::add, uint32_t, 8>(output, slm_offset.select<8, 1>(8),
local_histogram.select<8, 1>(8), 1);
}

// This function calculates histogram of the image with the CPU.
Expand Down
4 changes: 2 additions & 2 deletions SYCL/ESIMD/histogram_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ int main(int argc, char *argv[]) {
src = histogram.select<8, 1>(i);

#ifdef __SYCL_DEVICE_ONLY__
flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, unsigned int, 8>(
bins, offset, src, 1);
flat_atomic<atomic_op::add, unsigned int, 8>(bins, offset, src,
1);
offset += 8 * sizeof(unsigned int);
#else
simd<unsigned int, 8> vals;
Expand Down
6 changes: 3 additions & 3 deletions SYCL/ESIMD/histogram_raw_send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ int main(int argc, char *argv[]) {
src = histogram.select<8, 1>(i);

#ifdef __SYCL_DEVICE_ONLY__
// flat_atomic<EsimdAtomicOpType::ATOMIC_ADD, unsigned int,
// flat_atomic<atomic_op::add, unsigned int,
// 8>(bins, offset, src, 1);
atomic_write<EsimdAtomicOpType::ATOMIC_ADD, unsigned int, 8>(
bins, offset, src, 1);
atomic_write<atomic_op::add, unsigned int, 8>(bins, offset, src,
1);
offset += 8 * sizeof(unsigned int);
#else
simd<unsigned int, 8> vals;
Expand Down
Loading