MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_compute_forward_sqrt_f32

Function ggml_compute_forward_sqrt_f32

ggml.c:7980–8002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7978// ggml_compute_forward_sqrt
7979
7980static void ggml_compute_forward_sqrt_f32(
7981 const struct ggml_compute_params * params,
7982 const struct ggml_tensor * src0,
7983 struct ggml_tensor * dst) {
7984 assert(params->ith == 0);
7985 assert(ggml_are_same_shape(src0, dst));
7986
7987 if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
7988 return;
7989 }
7990
7991 const int n = ggml_nrows(src0);
7992 const int nc = src0->ne[0];
7993
7994 assert( dst->nb[0] == sizeof(float));
7995 assert(src0->nb[0] == sizeof(float));
7996
7997 for (int i = 0; i < n; i++) {
7998 ggml_vec_sqrt_f32(nc,
7999 (float *) ((char *) dst->data + i*( dst->nb[1])),
8000 (float *) ((char *) src0->data + i*(src0->nb[1])));
8001 }
8002}
8003
8004static void ggml_compute_forward_sqrt(
8005 const struct ggml_compute_params * params,

Callers 1

Calls 3

ggml_are_same_shapeFunction · 0.70
ggml_nrowsFunction · 0.70
ggml_vec_sqrt_f32Function · 0.70

Tested by

no test coverage detected