Skip to content

Commit da69944

Browse files
committed
Add missing offset to if conditions in the hierarchical and scoped kernel matrix assembly kernels.
1 parent 596155e commit da69944

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

include/plssvm/backends/SYCL/kernel/cg_explicit/hierarchical/kernel_matrix_assembly.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class device_kernel_assembly {
8383
::sycl::private_memory<std::array<std::array<real_type, static_cast<std::size_t>(INTERNAL_BLOCK_SIZE)>, static_cast<std::size_t>(INTERNAL_BLOCK_SIZE)>, 2> temp{ group };
8484

8585
// only calculate the upper triangular matrix -> can't use get_local_id() since all work-items in a work-group must progress further
86-
if (group[1] >= group[0]) {
86+
if (group[1] + grid_y_offset_ >= group[0] + grid_x_offset_) {
8787
// initialize private temp matrix to zero
8888
group.parallel_for_work_item([&](::sycl::h_item<2> idx) {
8989
for (unsigned internal_i = 0; internal_i < INTERNAL_BLOCK_SIZE; ++internal_i) {

include/plssvm/backends/SYCL/kernel/cg_explicit/scoped/kernel_matrix_assembly.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class device_kernel_assembly {
8686
::sycl::require_private_mem<std::array<std::array<real_type, static_cast<std::size_t>(INTERNAL_BLOCK_SIZE)>, static_cast<std::size_t>(INTERNAL_BLOCK_SIZE)>>(), // temp
8787
[&](auto &data_i_cache, auto &data_j_cache, auto &temp) {
8888
// only calculate the upper triangular matrix -> can't use get_local_id() since all work-items in a work-group must progress further
89-
if (group[1] >= group[0]) {
89+
if (group[1] + grid_y_offset_ >= group[0] + grid_x_offset_) {
9090
// initialize private temp matrix to zero
9191
::sycl::distribute_items_and_wait(group, [&](::sycl::s_item<2> idx) {
9292
for (unsigned internal_i = 0; internal_i < INTERNAL_BLOCK_SIZE; ++internal_i) {

include/plssvm/backends/SYCL/kernel/cg_implicit/hierarchical/kernel_matrix_assembly_blas.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class device_kernel_assembly_symm {
126126
// implicit group barrier
127127

128128
// only calculate the upper triangular matrix -> can't use get_local_id() since all work-items in a work-group must progress further
129-
if (group[1] >= group[0]) {
129+
if (group[1] + grid_y_offset_ >= group[0] + grid_x_offset_) {
130130
//*************************************************************************//
131131
// inplace kernel matrix construction //
132132
//*************************************************************************//

include/plssvm/backends/SYCL/kernel/cg_implicit/scoped/kernel_matrix_assembly_blas.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class device_kernel_assembly_symm {
126126
});
127127

128128
// only calculate the upper triangular matrix -> can't use get_local_id() since all work-items in a work-group must progress further
129-
if (group[1] >= group[0]) {
129+
if (group[1] + grid_y_offset_ >= group[0] + grid_x_offset_) {
130130
//*************************************************************************//
131131
// inplace kernel matrix construction //
132132
//*************************************************************************//

0 commit comments

Comments
 (0)