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

Commit e2ea274

Browse files
author
Gang Chen
authored
[SYCL][ESIMD] use implicit type-conversion in examples (#100)
Signed-off-by: Gang Y Chen <[email protected]>
1 parent 2eb1bbc commit e2ea274

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

SYCL/ESIMD/histogram_256_slm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
5151
#pragma unroll
5252
for (int j = 0; j < BLOCK_WIDTH * sizeof(int); j += 16) {
5353
// Accumulate local histogram for each pixel value
54-
auto dataOffset = convert<uint, uchar, 16>(in.select<16, 1>(j).read());
54+
simd<uint, 16> dataOffset = in.select<16, 1>(j).read();
5555
dataOffset *= sizeof(int);
5656
slm_atomic<EsimdAtomicOpType::ATOMIC_INC, uint, 16>(dataOffset, 1);
5757
}

SYCL/ESIMD/histogram_256_slm_spec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
5151
#pragma unroll
5252
for (int j = 0; j < BLOCK_WIDTH * sizeof(int); j += 16) {
5353
// Accumulate local histogram for each pixel value
54-
auto dataOffset = convert<uint, uchar, 16>(in.select<16, 1>(j).read());
54+
simd<uint, 16> dataOffset = in.select<16, 1>(j).read();
5555
dataOffset *= sizeof(int);
5656
slm_atomic<EsimdAtomicOpType::ATOMIC_INC, uint, 16>(dataOffset, 1);
5757
}

SYCL/ESIMD/histogram_raw_send.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ESIMD_INLINE void atomic_write(T *bins, simd<unsigned, n> offset,
6969
simd<T, n> src0, simd<ushort, n> pred) {
7070
simd<T, n> oldDst;
7171
simd<uintptr_t, n> vAddr(reinterpret_cast<uintptr_t>(bins));
72-
simd<uintptr_t, n> vOffset = convert<uintptr_t>(offset);
72+
simd<uintptr_t, n> vOffset = offset;
7373
vAddr += vOffset;
7474

7575
uint32_t exDesc = 0x4C;

SYCL/ESIMD/linear/linear.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int main(int argc, char *argv[]) {
105105
in = media_block_load<unsigned char, 8, 32>(accInput, h_pos * 24,
106106
v_pos * 6);
107107

108-
simd<float, 8 * 32> vin_float = convert<float>(vin);
108+
simd<float, 8 * 32> vin_float = vin;
109109
auto in_float = vin_float.format<float, 8, 32>();
110110
m = in_float.select<6, 1, 24, 1>(1, 3);
111111
m += in_float.select<6, 1, 24, 1>(0, 0);
@@ -118,7 +118,7 @@ int main(int argc, char *argv[]) {
118118
m += in_float.select<6, 1, 24, 1>(2, 6);
119119
m = m * 0.111f;
120120

121-
vout = convert<unsigned char>(vm);
121+
vout = vm;
122122

123123
media_block_store<unsigned char, 6, 24>(accOutput, h_pos * 24,
124124
v_pos * 6, out);

0 commit comments

Comments
 (0)