@@ -1463,18 +1463,6 @@ static void k_sum_rows_f32(const float * x, float * dst, const int ncols,
14631463 }
14641464}
14651465
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-
14781466template <typename Ti, typename To>
14791467static void pool2d_nchw_kernel (
14801468 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(
16001588 }
16011589}
16021590
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-
16161591static void sum_rows_f32_sycl (const float *x, float *dst, const int ncols,
16171592 const int nrows, queue_ptr stream) {
16181593 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 *
19051880 sum_rows_f32_sycl (src0_dd, dst_dd, ncols, nrows, main_stream);
19061881}
19071882
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-
19301883static void ggml_sycl_set_peer_access (const int n_tokens, int main_device) {
19311884 static bool peer_access_enabled = false ;
19321885
@@ -2848,10 +2801,6 @@ catch (sycl::exception const &exc) {
28482801 std::exit (1 );
28492802}
28502803
2851- static void ggml_sycl_clamp (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
2852- ggml_sycl_op_clamp (ctx, dst);
2853- }
2854-
28552804static void ggml_sycl_pool2d (ggml_backend_sycl_context & ctx, ggml_tensor * dst) {
28562805 ggml_sycl_op_pool2d (ctx, dst);
28572806}
0 commit comments