@@ -1463,18 +1463,6 @@ static void k_sum_rows_f32(const float * x, float * dst, const int ncols,
1463
1463
}
1464
1464
}
1465
1465
1466
- static void clamp_f32 (const float * x, float * dst, const float min, const float max, const int k,
1467
- const sycl::nd_item<3 > &item_ct1) {
1468
- const int i = item_ct1.get_local_range (2 ) * item_ct1.get_group (2 ) +
1469
- item_ct1.get_local_id (2 );
1470
-
1471
- if (i >= k) {
1472
- return ;
1473
- }
1474
-
1475
- dst[i] = x[i] < min ? min : (x[i] > max ? max : x[i]);
1476
- }
1477
-
1478
1466
template <typename Ti, typename To>
1479
1467
static void pool2d_nchw_kernel (
1480
1468
const int ih, const int iw, const int oh, const int ow,
@@ -1600,19 +1588,6 @@ static void ggml_mul_mat_vec_nc_f16_f32_sycl(
1600
1588
}
1601
1589
}
1602
1590
1603
- static void clamp_f32_sycl (const float *x, float *dst, const float min,
1604
- const float max, const int k,
1605
- queue_ptr stream) {
1606
- const int num_blocks = (k + SYCL_CLAMP_BLOCK_SIZE - 1 ) / SYCL_CLAMP_BLOCK_SIZE;
1607
- stream->parallel_for (
1608
- sycl::nd_range<3 >(sycl::range<3 >(1 , 1 , num_blocks) *
1609
- sycl::range<3 >(1 , 1 , SYCL_CLAMP_BLOCK_SIZE),
1610
- sycl::range<3 >(1 , 1 , SYCL_CLAMP_BLOCK_SIZE)),
1611
- [=](sycl::nd_item<3 > item_ct1) {
1612
- clamp_f32 (x, dst, min, max, k, item_ct1);
1613
- });
1614
- }
1615
-
1616
1591
static void sum_rows_f32_sycl (const float *x, float *dst, const int ncols,
1617
1592
const int nrows, queue_ptr stream) {
1618
1593
const sycl::range<3 > block_dims (1 , 1 , WARP_SIZE);
@@ -1905,28 +1880,6 @@ inline void ggml_sycl_op_sum_rows(ggml_backend_sycl_context & ctx, ggml_tensor *
1905
1880
sum_rows_f32_sycl (src0_dd, dst_dd, ncols, nrows, main_stream);
1906
1881
}
1907
1882
1908
- inline void ggml_sycl_op_clamp (ggml_backend_sycl_context & ctx, ggml_tensor *dst) {
1909
-
1910
- GGML_ASSERT (dst->src [0 ]->type == GGML_TYPE_F32);
1911
- GGML_ASSERT (dst->type == GGML_TYPE_F32);
1912
- GGML_ASSERT (!ggml_backend_buffer_is_sycl_split (dst->buffer ));
1913
-
1914
- float min;
1915
- float max;
1916
- memcpy (&min, dst->op_params , sizeof (float ));
1917
- memcpy (&max, (float *) dst->op_params + 1 , sizeof (float ));
1918
- const dpct::queue_ptr main_stream = ctx.stream ();
1919
- const float * src0_dd = static_cast <const float *>(dst->src [0 ]->data );
1920
- float * dst_dd = static_cast <float *>(dst->data );
1921
-
1922
- clamp_f32_sycl (src0_dd, dst_dd, min, max, ggml_nelements (dst->src [0 ]), main_stream);
1923
- /*
1924
- DPCT1010:88: SYCL uses exceptions to report errors and does not use the
1925
- error codes. The call was replaced with 0. You need to rewrite this code.
1926
- */
1927
- SYCL_CHECK (0 );
1928
- }
1929
-
1930
1883
static void ggml_sycl_set_peer_access (const int n_tokens, int main_device) {
1931
1884
static bool peer_access_enabled = false ;
1932
1885
@@ -2848,10 +2801,6 @@ catch (sycl::exception const &exc) {
2848
2801
std::exit (1 );
2849
2802
}
2850
2803
2851
- static void ggml_sycl_clamp (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
2852
- ggml_sycl_op_clamp (ctx, dst);
2853
- }
2854
-
2855
2804
static void ggml_sycl_pool2d (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
2856
2805
ggml_sycl_op_pool2d (ctx, dst);
2857
2806
}
0 commit comments