| 1804 | |
| 1805 | |
| 1806 | bool 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 | |
| 1823 | static 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 |
no test coverage detected