Skip to content

Commit e654008

Browse files
author
Gitty Burstein
committed
sycl(SET): re-apply post-rebase; revert manual docs/ops.md; style cleanups
1 parent efe2701 commit e654008

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

docs/ops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Legend:
8585
| RWKV_WKV6 ||||||||||
8686
| RWKV_WKV7 ||||||||||
8787
| SCALE || 🟡 ||||||||
88-
| SET ||||||| |||
88+
| SET ||||||| |||
8989
| SET_ROWS ||| 🟡 | 🟡 | 🟡 | 🟡 | 🟡 | 🟡 ||
9090
| SGN |||| 🟡 | 🟡 || 🟡 |||
9191
| SIGMOID |||| 🟡 | 🟡 | 🟡 | 🟡 | 🟡 ||

ggml/src/ggml-sycl/element_wise.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#include "ggml-sycl/presets.hpp"
33
#include "ggml.h"
44
#include "element_wise.hpp"
5-
#include <cstring>
6-
5+
#include <cstring>
76
#define SYCL_GLOBAL_ID_LOOP(K, ITEM) \
87
for (auto i = ITEM.get_global_id(0); i < (size_t)K; i += ITEM.get_global_range(0))
98

@@ -939,8 +938,7 @@ static inline void ggml_sycl_op_set(ggml_backend_sycl_context & ctx, ggml_tensor
939938
#else
940939
GGML_ASSERT(dst->type == GGML_TYPE_F32 || dst->type == GGML_TYPE_I32);
941940
#endif
942-
const size_t ts = ggml_type_size(dst->type);
943-
941+
const size_t ts = ggml_type_size(dst->type);
944942
dpct::queue_ptr q = ctx.stream();
945943
{
946944
const bool same_type = (src0->type == dst->type);
@@ -1003,9 +1001,8 @@ static inline void ggml_sycl_op_set(ggml_backend_sycl_context & ctx, ggml_tensor
10031001
void *p_dst = dst->data;
10041002

10051003
const size_t sb0 = src1->nb[0], sb1 = src1->nb[1], sb2 = src1->nb[2], sb3 = src1->nb[3];
1006-
const size_t db0 = dst->nb[0];
1004+
const size_t db0 = dst->nb[0];
10071005
const int64_t ne0 = src1->ne[0], ne1 = src1->ne[1], ne2 = src1->ne[2], ne3 = src1->ne[3];
1008-
10091006
if (ggml_is_contiguous(src1) && db0 == ts) {
10101007
const size_t row_bytes = (size_t) ne0 * ts;
10111008
const char *s_base = (const char*) p_src1;
@@ -1028,11 +1025,10 @@ static inline void ggml_sycl_op_set(ggml_backend_sycl_context & ctx, ggml_tensor
10281025
}
10291026
}
10301027
} else {
1031-
1028+
10321029
const size_t N = (size_t) (ne0 * ne1 * ne2 * ne3);
10331030
const size_t WG = 256;
10341031
const size_t NG = ((N + WG - 1) / WG) * WG;
1035-
10361032
const size_t ge0 = (size_t) ne0;
10371033
const size_t ge1 = ge0 * (size_t) ne1;
10381034
const size_t ge2 = ge1 * (size_t) ne2;

0 commit comments

Comments
 (0)