| 8632 | // ggml_compute_forward_sgn |
| 8633 | |
| 8634 | static void ggml_compute_forward_sgn_f32( |
| 8635 | const struct ggml_compute_params * params, |
| 8636 | const struct ggml_tensor * src0, |
| 8637 | struct ggml_tensor * dst) { |
| 8638 | assert(params->ith == 0); |
| 8639 | assert(ggml_are_same_shape(src0, dst)); |
| 8640 | |
| 8641 | if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { |
| 8642 | return; |
| 8643 | } |
| 8644 | |
| 8645 | const int n = ggml_nrows(src0); |
| 8646 | const int nc = src0->ne[0]; |
| 8647 | |
| 8648 | assert(dst->nb[0] == sizeof(float)); |
| 8649 | assert(src0->nb[0] == sizeof(float)); |
| 8650 | |
| 8651 | for (int i = 0; i < n; i++) { |
| 8652 | ggml_vec_sgn_f32(nc, |
| 8653 | (float *) ((char *) dst->data + i*( dst->nb[1])), |
| 8654 | (float *) ((char *) src0->data + i*(src0->nb[1]))); |
| 8655 | } |
| 8656 | } |
| 8657 | |
| 8658 | static void ggml_compute_forward_sgn( |
| 8659 | const struct ggml_compute_params * params, |
no test coverage detected