| 8590 | // ggml_compute_forward_abs |
| 8591 | |
| 8592 | static void ggml_compute_forward_abs_f32( |
| 8593 | const struct ggml_compute_params * params, |
| 8594 | const struct ggml_tensor * src0, |
| 8595 | struct ggml_tensor * dst) { |
| 8596 | assert(params->ith == 0); |
| 8597 | assert(ggml_are_same_shape(src0, dst)); |
| 8598 | |
| 8599 | if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { |
| 8600 | return; |
| 8601 | } |
| 8602 | |
| 8603 | const int n = ggml_nrows(src0); |
| 8604 | const int nc = src0->ne[0]; |
| 8605 | |
| 8606 | assert(dst->nb[0] == sizeof(float)); |
| 8607 | assert(src0->nb[0] == sizeof(float)); |
| 8608 | |
| 8609 | for (int i = 0; i < n; i++) { |
| 8610 | ggml_vec_abs_f32(nc, |
| 8611 | (float *) ((char *) dst->data + i*( dst->nb[1])), |
| 8612 | (float *) ((char *) src0->data + i*(src0->nb[1]))); |
| 8613 | } |
| 8614 | } |
| 8615 | |
| 8616 | static void ggml_compute_forward_abs( |
| 8617 | const struct ggml_compute_params * params, |
no test coverage detected