| 8674 | // ggml_compute_forward_neg |
| 8675 | |
| 8676 | static void ggml_compute_forward_neg_f32( |
| 8677 | const struct ggml_compute_params * params, |
| 8678 | const struct ggml_tensor * src0, |
| 8679 | struct ggml_tensor * dst) { |
| 8680 | assert(params->ith == 0); |
| 8681 | assert(ggml_are_same_shape(src0, dst)); |
| 8682 | |
| 8683 | if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { |
| 8684 | return; |
| 8685 | } |
| 8686 | |
| 8687 | const int n = ggml_nrows(src0); |
| 8688 | const int nc = src0->ne[0]; |
| 8689 | |
| 8690 | assert(dst->nb[0] == sizeof(float)); |
| 8691 | assert(src0->nb[0] == sizeof(float)); |
| 8692 | |
| 8693 | for (int i = 0; i < n; i++) { |
| 8694 | ggml_vec_neg_f32(nc, |
| 8695 | (float *) ((char *) dst->data + i*( dst->nb[1])), |
| 8696 | (float *) ((char *) src0->data + i*(src0->nb[1]))); |
| 8697 | } |
| 8698 | } |
| 8699 | |
| 8700 | static void ggml_compute_forward_neg( |
| 8701 | const struct ggml_compute_params * params, |
no test coverage detected