MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_cl_can_mul_mat

Function ggml_cl_can_mul_mat

ggml-opencl.cpp:1806–1821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1804
1805
1806bool ggml_cl_can_mul_mat(const struct ggml_tensor * src0, const struct ggml_tensor * src1, struct ggml_tensor * dst) {
1807 const int64_t ne10 = src1->ne[0];
1808
1809 const int64_t ne0 = dst->ne[0];
1810 const int64_t ne1 = dst->ne[1];
1811
1812 // TODO: find the optimal values for these
1813 if ((src0->type == GGML_TYPE_F32 || src0->type == GGML_TYPE_F16 || ggml_is_quantized(src0->type)) &&
1814 src1->type == GGML_TYPE_F32 &&
1815 dst->type == GGML_TYPE_F32 &&
1816 ((ne0 >= 32 && ne1 >= 32 && ne10 >= 32) || src0->backend == GGML_BACKEND_GPU)) {
1817 return true;
1818 }
1819
1820 return false;
1821}
1822
1823static bool ggml_cl_mul_mat_use_f16(const struct ggml_tensor * src0, const struct ggml_tensor * src1, struct ggml_tensor * /* dst */) {
1824 // If device doesn't support FP16

Callers 5

ggml_get_n_tasksFunction · 0.70
ggml_graph_planFunction · 0.70
ggml_cl_mul_matFunction · 0.70

Calls 1

ggml_is_quantizedFunction · 0.70

Tested by

no test coverage detected