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

[SYCL][ESIMD] use implicit type-conversion in examples #100

Merged
merged 2 commits into from
Jan 20, 2021
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
2 changes: 1 addition & 1 deletion SYCL/ESIMD/histogram_256_slm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
#pragma unroll
for (int j = 0; j < BLOCK_WIDTH * sizeof(int); j += 16) {
// Accumulate local histogram for each pixel value
auto dataOffset = convert<uint, uchar, 16>(in.select<16, 1>(j).read());
simd<uint, 16> dataOffset = in.select<16, 1>(j).read();
dataOffset *= sizeof(int);
slm_atomic<EsimdAtomicOpType::ATOMIC_INC, uint, 16>(dataOffset, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion SYCL/ESIMD/histogram_256_slm_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
#pragma unroll
for (int j = 0; j < BLOCK_WIDTH * sizeof(int); j += 16) {
// Accumulate local histogram for each pixel value
auto dataOffset = convert<uint, uchar, 16>(in.select<16, 1>(j).read());
simd<uint, 16> dataOffset = in.select<16, 1>(j).read();
dataOffset *= sizeof(int);
slm_atomic<EsimdAtomicOpType::ATOMIC_INC, uint, 16>(dataOffset, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion SYCL/ESIMD/histogram_raw_send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ESIMD_INLINE void atomic_write(T *bins, simd<unsigned, n> offset,
simd<T, n> src0, simd<ushort, n> pred) {
simd<T, n> oldDst;
simd<uintptr_t, n> vAddr(reinterpret_cast<uintptr_t>(bins));
simd<uintptr_t, n> vOffset = convert<uintptr_t>(offset);
simd<uintptr_t, n> vOffset = offset;
vAddr += vOffset;

uint32_t exDesc = 0x4C;
Expand Down
4 changes: 2 additions & 2 deletions SYCL/ESIMD/linear/linear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) {
in = media_block_load<unsigned char, 8, 32>(accInput, h_pos * 24,
v_pos * 6);

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

vout = convert<unsigned char>(vm);
vout = vm;

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