Skip to content

Commit bab2b3b

Browse files
committed
Remove guard before kernel launch and refactor
1 parent 74a5fc8 commit bab2b3b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ggml/src/ggml-sycl/set_rows.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static void set_rows_sycl(
6060
const sycl::range<3> block_size(1, rows_per_block, threads_per_row);
6161
const sycl::range<3> grid_size(ne03, ne02, (ne01 + rows_per_block - 1) / rows_per_block);
6262

63-
if (ne01 > 0 && ne00 > 0) {
6463
sycl_parallel_for(
6564
stream,
6665
sycl::nd_range<3>(grid_size * block_size, block_size),
@@ -76,7 +75,6 @@ static void set_rows_sycl(
7675
);
7776
}
7877
);
79-
}
8078
}
8179

8280

@@ -96,7 +94,7 @@ void ggml_sycl_op_set_rows(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
9694
switch (dst->type) {
9795
case GGML_TYPE_F32:
9896
set_rows_sycl<float, float>(
99-
(const char *)dst->src[0]->data, src1_dd, (char *)dst->data,
97+
(const char *)src0->data, src1_dd, (char *)dst->data,
10098
ne00, ne01, ne02, ne03,
10199
ne11, ne12,
102100
nb01, nb02, nb03,
@@ -109,7 +107,7 @@ void ggml_sycl_op_set_rows(ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
109107
case GGML_TYPE_F16:
110108
dpct::has_capability_or_fail(stream->get_device(), { sycl::aspect::fp16 });
111109
set_rows_sycl<float, sycl::half>(
112-
(const char *)dst->src[0]->data, src1_dd, (char *)dst->data,
110+
(const char *)src0->data, src1_dd, (char *)dst->data,
113111
ne00, ne01, ne02, ne03,
114112
ne11, ne12,
115113
nb01, nb02, nb03,

0 commit comments

Comments
 (0)