fixed savedatafile bug, try remove unneeded old clblast code path

This commit is contained in:
Concedo
2025-04-03 19:11:27 +08:00
parent 103d60ed2c
commit 6e086bd309
2 changed files with 24 additions and 23 deletions
+22 -22
View File
@@ -57,28 +57,28 @@ static void apply_binary_op(const ggml_compute_params * params, ggml_tensor * ds
GGML_ASSERT(ggml_can_repeat(src1, src0) && ggml_are_same_shape(src0, dst));
#if defined(GGML_USE_CLBLAST)
//do we even need this? it seems like its actually slower than just CPU
const int ith = params->ith;
if (op == op_add && src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_F32 && src1->clblast_offload_gpu) {
// TODO: OpenCL kernel support full broadcast
static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");
GGML_ASSERT((src1->ne[0] == src0->ne[0]) && ggml_can_repeat(src1, src0));
if (ith == 0) {
ggml_cl_add(src0, src1, dst);
}
return;
}
if (op == op_mul && src0->type == GGML_TYPE_F32 && src1->clblast_offload_gpu) {
// TODO: OpenCL kernel support full broadcast
static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");
GGML_ASSERT((src1->ne[0] == src0->ne[0]) && ggml_can_repeat(src1, src0));
if (ith == 0) {
ggml_cl_mul(src0, src1, dst);
}
return;
}
#endif
// #if defined(GGML_USE_CLBLAST)
// //do we even need this? it seems like its actually slower than just CPU
// const int ith = params->ith;
// if (op == op_add && src0->type == GGML_TYPE_F32 && src1->type == GGML_TYPE_F32 && src1->clblast_offload_gpu) {
// // TODO: OpenCL kernel support full broadcast
// static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");
// GGML_ASSERT((src1->ne[0] == src0->ne[0]) && ggml_can_repeat(src1, src0));
// if (ith == 0) {
// ggml_cl_add(src0, src1, dst);
// }
// return;
// }
// if (op == op_mul && src0->type == GGML_TYPE_F32 && src1->clblast_offload_gpu) {
// // TODO: OpenCL kernel support full broadcast
// static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function");
// GGML_ASSERT((src1->ne[0] == src0->ne[0]) && ggml_can_repeat(src1, src0));
// if (ith == 0) {
// ggml_cl_mul(src0, src1, dst);
// }
// return;
// }
// #endif
GGML_TENSOR_BINARY_OP_LOCALS