| 13472 | // ggml_compute_forward_map_binary |
| 13473 | |
| 13474 | static void ggml_compute_forward_map_binary_f32( |
| 13475 | const struct ggml_compute_params * params, |
| 13476 | const struct ggml_tensor * src0, |
| 13477 | const struct ggml_tensor * src1, |
| 13478 | struct ggml_tensor * dst, |
| 13479 | const ggml_binary_op_f32_t fun) { |
| 13480 | assert(params->ith == 0); |
| 13481 | assert(ggml_are_same_shape(src0, src1) && ggml_are_same_shape(src0, dst)); |
| 13482 | |
| 13483 | if (params->type == GGML_TASK_INIT || params->type == GGML_TASK_FINALIZE) { |
| 13484 | return; |
| 13485 | } |
| 13486 | |
| 13487 | const int n = ggml_nrows(src0); |
| 13488 | const int nc = src0->ne[0]; |
| 13489 | |
| 13490 | assert( dst->nb[0] == sizeof(float)); |
| 13491 | assert(src0->nb[0] == sizeof(float)); |
| 13492 | assert(src1->nb[0] == sizeof(float)); |
| 13493 | |
| 13494 | for (int i = 0; i < n; i++) { |
| 13495 | fun(nc, |
| 13496 | (float *) ((char *) dst->data + i*( dst->nb[1])), |
| 13497 | (float *) ((char *) src0->data + i*(src0->nb[1])), |
| 13498 | (float *) ((char *) src1->data + i*(src1->nb[1]))); |
| 13499 | } |
| 13500 | } |
| 13501 | |
| 13502 | static void ggml_compute_forward_map_binary( |
| 13503 | const struct ggml_compute_params * params, |
no test coverage detected