From 06a3902964d0fdcb20131cbf182184db2c1fd2b6 Mon Sep 17 00:00:00 2001 From: Nick Sarnie Date: Thu, 1 Aug 2024 10:59:57 -0400 Subject: [PATCH] [SYCL][ESIMD][E2E] Fix test warning about divide by zero (#14881) 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: https://github.com/intel/llvm/issues/14877 Signed-off-by: Sarnie, Nick --- sycl/test-e2e/ESIMD/lsc/Inputs/lsc_store_2d.hpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sycl/test-e2e/ESIMD/lsc/Inputs/lsc_store_2d.hpp b/sycl/test-e2e/ESIMD/lsc/Inputs/lsc_store_2d.hpp index 8910508475caf..05077633ad78f 100644 --- a/sycl/test-e2e/ESIMD/lsc/Inputs/lsc_store_2d.hpp +++ b/sycl/test-e2e/ESIMD/lsc/Inputs/lsc_store_2d.hpp @@ -40,20 +40,10 @@ template constexpr unsigned int getNextPowerOf2() { } template <> constexpr unsigned int getNextPowerOf2<0>() { return 0; } -// Compute the data size for 2d block load or store. -template -constexpr int get_lsc_block_2d_data_size() { - if (Transformed) - return roundUpNextMultiple() * - getNextPowerOf2() * NBlocks; - return Width * Height * NBlocks; -} - template (), + 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) {