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

[SYCL][ESIMD] - change in barrier and linear example #142

Merged
merged 1 commit into from
Feb 15, 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: 0 additions & 2 deletions SYCL/ESIMD/histogram_256_slm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
slm_offset *= sizeof(int);
simd<uint, 16> slm_data = 0;
slm_store<uint, 16>(slm_data, slm_offset);
esimd_fence(ESIMD_GLOBAL_COHERENT_FENCE);
esimd_barrier();

// Each thread handles NUM_BLOCKSxBLOCK_WIDTH pixel blocks
Expand All @@ -56,7 +55,6 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
}
start_off += BLOCK_WIDTH;
}
esimd_fence(ESIMD_GLOBAL_COHERENT_FENCE);
esimd_barrier();

// Update global sum by atomically adding each local histogram
Expand Down
2 changes: 0 additions & 2 deletions SYCL/ESIMD/histogram_256_slm_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
slm_offset *= sizeof(int);
simd<uint, 16> slm_data = 0;
slm_store<uint, 16>(slm_data, slm_offset);
esimd_fence(ESIMD_GLOBAL_COHERENT_FENCE);
esimd_barrier();

// Each thread handles NUM_BLOCKSxBLOCK_WIDTH pixel blocks
Expand All @@ -57,7 +56,6 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
}
start_off += BLOCK_WIDTH;
}
esimd_fence(ESIMD_GLOBAL_COHERENT_FENCE);
esimd_barrier();

// Update global sum by atomically adding each local histogram
Expand Down
20 changes: 9 additions & 11 deletions SYCL/ESIMD/linear/linear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,15 @@ 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 = 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);
m += in_float.select<6, 1, 24, 1>(0, 3);
m += in_float.select<6, 1, 24, 1>(0, 6);
m += in_float.select<6, 1, 24, 1>(1, 0);
m += in_float.select<6, 1, 24, 1>(1, 6);
m += in_float.select<6, 1, 24, 1>(2, 0);
m += in_float.select<6, 1, 24, 1>(2, 3);
m += in_float.select<6, 1, 24, 1>(2, 6);
m = in.select<6, 1, 24, 1>(1, 3);
m += in.select<6, 1, 24, 1>(0, 0);
m += in.select<6, 1, 24, 1>(0, 3);
m += in.select<6, 1, 24, 1>(0, 6);
m += in.select<6, 1, 24, 1>(1, 0);
m += in.select<6, 1, 24, 1>(1, 6);
m += in.select<6, 1, 24, 1>(2, 0);
m += in.select<6, 1, 24, 1>(2, 3);
m += in.select<6, 1, 24, 1>(2, 6);
m = m * 0.111f;

vout = vm;
Expand Down
1 change: 0 additions & 1 deletion SYCL/ESIMD/slm_barrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ void load_to_slm(uint grpSize, uint localId, uint slmOffset, char *addr,
vOffsets += (grpSize * 256);
}

esimd_fence(ESIMD_GLOBAL_COHERENT_FENCE);
esimd_barrier();
}

Expand Down