MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_acc_impl

Function ggml_acc_impl

subprojects/llama.cpp/ggml/src/ggml.c:2074–2098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2072// ggml_acc
2073
2074static struct ggml_tensor * ggml_acc_impl(
2075 struct ggml_context * ctx,
2076 struct ggml_tensor * a,
2077 struct ggml_tensor * b,
2078 size_t nb1,
2079 size_t nb2,
2080 size_t nb3,
2081 size_t offset,
2082 bool inplace) {
2083 GGML_ASSERT(ggml_nelements(b) <= ggml_nelements(a));
2084 GGML_ASSERT(ggml_is_contiguous(a));
2085 GGML_ASSERT(a->type == GGML_TYPE_F32);
2086 GGML_ASSERT(b->type == GGML_TYPE_F32);
2087
2088 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
2089
2090 int32_t params[] = { nb1, nb2, nb3, offset, inplace ? 1 : 0 };
2091 ggml_set_op_params(result, params, sizeof(params));
2092
2093 result->op = GGML_OP_ACC;
2094 result->src[0] = a;
2095 result->src[1] = b;
2096
2097 return result;
2098}
2099
2100struct ggml_tensor * ggml_acc(
2101 struct ggml_context * ctx,

Callers 4

ggml_accFunction · 0.85
ggml_acc_inplaceFunction · 0.85
ggml_acc_or_setFunction · 0.85
ggml_compute_backwardFunction · 0.85

Calls 5

ggml_nelementsFunction · 0.85
ggml_is_contiguousFunction · 0.85
ggml_view_tensorFunction · 0.85
ggml_dup_tensorFunction · 0.85
ggml_set_op_paramsFunction · 0.85

Tested by

no test coverage detected