Skip to content

Commit

Permalink
[SYCL][ESIMD][E2E] Fix test warning about divide by zero (intel#14881)
Browse files Browse the repository at this point in the history
The problem was this was a runtime `if` and not `if constexpr`. This
function was copy-pasted from the ESIMD headers, and the headers one was
already fixed to be `if constexpr`, so just use that.

Closes: intel#14877

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
  • Loading branch information
sarnex committed Aug 1, 2024
1 parent 21f7f4e commit 06a3902
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions sycl/test-e2e/ESIMD/lsc/Inputs/lsc_store_2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,10 @@ template <unsigned int N> constexpr unsigned int getNextPowerOf2() {
}
template <> constexpr unsigned int getNextPowerOf2<0>() { return 0; }

// Compute the data size for 2d block load or store.
template <typename T, int NBlocks, int Height, int Width, bool Transposed,
bool Transformed>
constexpr int get_lsc_block_2d_data_size() {
if (Transformed)
return roundUpNextMultiple<Height, 4 / sizeof(T)>() *
getNextPowerOf2<Width>() * NBlocks;
return Width * Height * NBlocks;
}

template <int case_num, typename T, uint32_t Groups, uint32_t Threads,
int BlockWidth, int BlockHeight = 1,
int N = get_lsc_block_2d_data_size<T, 1u, BlockHeight, BlockWidth,
false, false>(),
int N = __ESIMD_DNS::get_lsc_block_2d_data_size<
T, 1u, BlockHeight, BlockWidth, false, false>(),
cache_hint L1H = cache_hint::none, cache_hint L2H = cache_hint::none>
bool test(unsigned SurfaceWidth, unsigned SurfaceHeight, unsigned SurfacePitch,
int X, int Y) {
Expand Down

0 comments on commit 06a3902

Please sign in to comment.