Skip to content

Commit 10653d6

Browse files
replace the magic nunber 768 by max work group size to support iGPU
1 parent 2943210 commit 10653d6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ggml/src/ggml-sycl/add-id.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ void ggml_sycl_add_id(ggml_backend_sycl_context& ctx, ggml_tensor* dst) {
5555
const int32_t* src2_d = (const int32_t*)src2->data;
5656
float* dst_d = (float*)dst->data;
5757

58-
int threads = std::min((int)ne00, 768); // cols
58+
const unsigned int max_work_group_size = ggml_sycl_info().max_work_group_sizes[ctx.device];
59+
assert(work_group_size % (WARP_SIZE * WARP_SIZE) == 0);
60+
61+
int threads = std::min((unsigned int)ne00, max_work_group_size); // cols
62+
5963
ctx.stream()->parallel_for(
6064
sycl::nd_range<3>(
6165
sycl::range<3>(1, ne02, ne01) * sycl::range<3>(1, 1, threads),

0 commit comments

Comments
 (0)