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

Function ggml_compute_forward_log_f32

ggml.c:8022–8044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8020// ggml_compute_forward_log
8021
8022static void ggml_compute_forward_log_f32(
8023 const struct ggml_compute_params * params,
8024 const struct ggml_tensor * src0,
8025 struct ggml_tensor * dst) {
8026 GGML_ASSERT(params->ith == 0);
8027 GGML_ASSERT(ggml_are_same_shape(src0, dst));
8028
8029 if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) {
8030 return;
8031 }
8032
8033 const int n = ggml_nrows(src0);
8034 const int nc = src0->ne[0];
8035
8036 GGML_ASSERT( dst->nb[0] == sizeof(float));
8037 GGML_ASSERT(src0->nb[0] == sizeof(float));
8038
8039 for (int i = 0; i < n; i++) {
8040 ggml_vec_log_f32(nc,
8041 (float *) ((char *) dst->data + i*( dst->nb[1])),
8042 (float *) ((char *) src0->data + i*(src0->nb[1])));
8043 }
8044}
8045
8046static void ggml_compute_forward_log(
8047 const struct ggml_compute_params * params,

Callers 1

ggml_compute_forward_logFunction · 0.85

Calls 3

ggml_are_same_shapeFunction · 0.70
ggml_nrowsFunction · 0.70
ggml_vec_log_f32Function · 0.70

Tested by

no test coverage detected