unisa-hpc / sycl-bench

SYCL Benchmark Suite
BSD 3-Clause "New" or "Revised" License
56 stars 31 forks source link

Fix `gramschmidt` and `mvt` #50

Closed whitneywhtsang closed 1 year ago

whitneywhtsang commented 1 year ago

For gramschmidt, without the change in this PR, then A is actually not initialized, as the loop nest is never entered. It happens that elements of A are all zeros. In the kernels, when we do multiplication, reductions, etc on zeros, they will give us zeros. In the cpu code gramschmidt(), again loop nests are not entered, and elements of A continue to be zeros. End up we always verify even if we do nothing at all in the kernels.

For mvt, in the kernels x1 and x2 are calculated as x1[i] += a[{i, j}] * y1[j]; and x2[k] += a[{k, l}] * y2[l];, if elements of y1 and y2 are always zeros, then elements of x1 and x2 are always zeros too. Given that elements of x1 and x2 are initialized to zeros, it always verify even if we do nothing at all in the kernels. It is also missing the writeback trigger before verification.

Signed-off-by: Tsang, Whitney whitney.tsang@intel.com

bcosenza commented 1 year ago

Thanks for the fix! @lorenzo-carpentieri Wasn't this code already fixed? Did you forget to commit? Can you please take care?

@whitneywhtsang Thanks again, please let us know if you find any other bugs in the code.

bcosenza commented 1 year ago

Excellent, thank you