Skip to content

Commit b60d637

Browse files
committed
safe_div -> ceil_div
1 parent e8555ab commit b60d637

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ggml/src/ggml-sycl/common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ inline void ggml_sycl_op_bin_bcast(ggml_backend_sycl_context & ctx, const ggml_t
777777

778778
bool gpu_has_xmx(sycl::device &dev);
779779

780-
constexpr size_t safe_div(const size_t m, const size_t n) {
780+
constexpr size_t ceil_div(const size_t m, const size_t n) {
781781
return (m + n - 1) / n;
782782
}
783783

ggml/src/ggml-sycl/mmvq.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static void mul_mat_vec_q_reorder(const void * __restrict__ vx, const void * __r
2222
}
2323

2424
const int blocks_per_row = ncols / block_traits::qk;
25-
constexpr int blocks_per_subgroup = safe_div(block_traits::vdr_mmvq * WARP_SIZE, block_traits::qi);
25+
constexpr int blocks_per_subgroup = ceil_div(block_traits::vdr_mmvq * WARP_SIZE, block_traits::qi);
2626
constexpr int block_elements_per_subgroup = block_traits::qi / block_traits::vdr_mmvq;
2727

2828
static_assert(blocks_per_subgroup > 0);
@@ -536,7 +536,7 @@ static void mul_mat_vec_q_iq4_xs_q8_1(const void *__restrict__ vx,
536536
static void reorder_mul_mat_vec_q4_0_q8_1_sycl(const void * vx, const void * vy, float * dst, const int ncols,
537537
const int nrows, dpct::queue_ptr stream) {
538538
GGML_ASSERT(ncols % QK4_0 == 0);
539-
const int block_num_y = safe_div(nrows, GGML_SYCL_MMV_Y);
539+
const int block_num_y = ceil_div(nrows, GGML_SYCL_MMV_Y);
540540
constexpr size_t num_subgroups = 16;
541541
GGML_ASSERT(block_num_y % num_subgroups == 0);
542542

0 commit comments

Comments
 (0)