Skip to content

Commit 0aa9325

Browse files
committed
use logical operators keywords and ceil_div
1 parent 9959855 commit 0aa9325

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ggml/src/ggml-sycl/binbcast.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ template <float (*bin_op)(const float, const float)> struct bin_bcast_sycl {
125125
std::size_t num_dst_elements = static_cast<std::size_t>(ne0) * static_cast<std::size_t>(ne1) *
126126
static_cast<std::size_t>(ne2) * static_cast<std::size_t>(ne3);
127127
std::size_t local_range = 256;
128-
std::size_t global_range = ((num_dst_elements + local_range - 1) / local_range) * local_range;
128+
std::size_t global_range = ceil_div(num_dst_elements, local_range) * local_range;
129129

130130
bool needs_broadcasting = check_bcast_required({ ne00, ne01, ne02, ne03 }, { ne0, ne1, ne2, ne3 }) ||
131131
check_bcast_required({ ne10, ne11, ne12, ne13 }, { ne0, ne1, ne2, ne3 });
132-
bool all_contiguous = src0_is_contiguous && src1_is_contiguous && dst_is_contiguous;
132+
bool all_contiguous = src0_is_contiguous and src1_is_contiguous and dst_is_contiguous;
133133

134-
if (not needs_broadcasting && all_contiguous) {
134+
if (not needs_broadcasting and all_contiguous) {
135135
stream->submit([&](sycl::handler & cgh) {
136136
cgh.parallel_for(sycl::nd_range<1>({ global_range }, { local_range }), [=](sycl::nd_item<1> it) {
137137
k_bin_bcast_contiguous<bin_op>(src0_dd, src1_dd, dst_dd, num_dst_elements, it);

0 commit comments

Comments
 (0)