| 13429 | // ggml_compute_forward_map_unary |
| 13430 | |
| 13431 | static void ggml_compute_forward_map_unary_f32( |
| 13432 | const struct ggml_compute_params * params, |
| 13433 | const struct ggml_tensor * src0, |
| 13434 | struct ggml_tensor * dst, |
| 13435 | const ggml_unary_op_f32_t fun) { |
| 13436 | GGML_ASSERT(ggml_are_same_shape(src0, dst)); |
| 13437 | |
| 13438 | if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { |
| 13439 | return; |
| 13440 | } |
| 13441 | |
| 13442 | const int n = ggml_nrows(src0); |
| 13443 | const int nc = src0->ne[0]; |
| 13444 | |
| 13445 | assert( dst->nb[0] == sizeof(float)); |
| 13446 | assert(src0->nb[0] == sizeof(float)); |
| 13447 | |
| 13448 | for (int i = 0; i < n; i++) { |
| 13449 | fun(nc, |
| 13450 | (float *) ((char *) dst->data + i*( dst->nb[1])), |
| 13451 | (float *) ((char *) src0->data + i*(src0->nb[1]))); |
| 13452 | } |
| 13453 | } |
| 13454 | |
| 13455 | static void ggml_compute_forward_map_unary( |
| 13456 | const struct ggml_compute_params * params, |
no test coverage detected