MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / ggml_compute_forward_add

Function ggml_compute_forward_add

external/ggml/src/ggml-cpu/ops.cpp:654–699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652
653 // unquantize row from src0 to temp buffer
654 dequantize_row_q(src0_row, wdata, ne00);
655 // add src1
656 ggml_vec_acc_f32(ne00, wdata, src1_row);
657 // quantize row to dst
658 if (quantize_row_q != NULL) {
659 quantize_row_q(wdata, dst_row, ne00);
660 } else {
661 memcpy(dst_row, wdata, ne0*nb0);
662 }
663 }
664}
665
666void ggml_compute_forward_add(
667 const ggml_compute_params * params,
668 ggml_tensor * dst) {
669
670 const ggml_tensor * src0 = dst->src[0];
671
672 switch (src0->type) {
673 case GGML_TYPE_F32:
674 case GGML_TYPE_F16:
675 case GGML_TYPE_BF16:
676 {
677 ggml_compute_forward_add_non_quantized(params, dst);
678 } break;
679 case GGML_TYPE_Q1_0:
680 case GGML_TYPE_Q4_0:
681 case GGML_TYPE_Q4_1:
682 case GGML_TYPE_Q5_0:
683 case GGML_TYPE_Q5_1:
684 case GGML_TYPE_Q8_0:
685 case GGML_TYPE_MXFP4:
686 case GGML_TYPE_NVFP4:
687 case GGML_TYPE_Q2_K:
688 case GGML_TYPE_Q3_K:
689 case GGML_TYPE_Q4_K:
690 case GGML_TYPE_Q5_K:
691 case GGML_TYPE_Q6_K:
692 case GGML_TYPE_TQ1_0:
693 case GGML_TYPE_TQ2_0:
694 case GGML_TYPE_TQ2_1:
695 case GGML_TYPE_IQ2_XXS:
696 case GGML_TYPE_IQ2_XS:
697 case GGML_TYPE_IQ3_XXS:
698 case GGML_TYPE_IQ1_S:
699 case GGML_TYPE_IQ1_M:
700 case GGML_TYPE_IQ4_NL:
701 case GGML_TYPE_IQ4_XS:
702 case GGML_TYPE_IQ3_S:

Callers 2

ggml_compute_forwardFunction · 0.85
compute_forwardMethod · 0.85

Tested by

no test coverage detected