Skip to content

Commit

Permalink
fix cmake failing to build with c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Dec 12, 2024
1 parent c11bafb commit 0772ec3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
13 changes: 11 additions & 2 deletions ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3821,7 +3821,9 @@ static int repack_iq4_nl_to_iq4_nl_4_bl(struct ggml_tensor * t, int interleave_b
GGML_UNUSED(data_size);
}

namespace ggml::cpu::aarch64 {
namespace ggml {
namespace cpu {
namespace aarch64 { //ggml::cpu::aarch64
// repack
template <typename BLOC_TYPE, int64_t INTER_SIZE, int64_t NB_COLS>
int repack(struct ggml_tensor *, const void *, size_t);
Expand Down Expand Up @@ -4137,6 +4139,8 @@ static const tensor_traits<block_q4_0, 8, 8> q4_0_8x8_q8_0;
// instance for IQ4
static const tensor_traits<block_iq4_nl, 4, 4> iq4_nl_4x4_q8_0;

}
}
} // namespace ggml::cpu::aarch64

static const ggml::cpu::tensor_traits * ggml_aarch64_get_optimal_repack_type(const struct ggml_tensor * cur) {
Expand Down Expand Up @@ -4210,7 +4214,9 @@ static size_t ggml_backend_cpu_aarch64_buffer_type_get_alignment(ggml_backend_bu
GGML_UNUSED(buft);
}

namespace ggml::cpu::aarch64 {
namespace ggml {
namespace cpu {
namespace aarch64 { //ggml::cpu::aarch64
class extra_buffer_type : ggml::cpu::extra_buffer_type {
bool supports_op(ggml_backend_dev_t, const struct ggml_tensor * op) override {
if ( op->op == GGML_OP_MUL_MAT &&
Expand Down Expand Up @@ -4257,6 +4263,9 @@ class extra_buffer_type : ggml::cpu::extra_buffer_type {
return nullptr;
}
};

}
}
} // namespace ggml::cpu::aarch64

ggml_backend_buffer_type_t ggml_backend_cpu_aarch64_buffer_type(void) {
Expand Down
4 changes: 3 additions & 1 deletion ggml/src/ggml-cpu/ggml-cpu-traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#include "ggml-backend-impl.h"
#include "ggml-backend.h"

namespace ggml::cpu {
namespace ggml {
namespace cpu {
tensor_traits::~tensor_traits() {}

extra_buffer_type::~extra_buffer_type() {}
}
} // namespace ggml::cpu

bool ggml_cpu_extra_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * op) {
Expand Down
4 changes: 3 additions & 1 deletion ggml/src/ggml-cpu/ggml-cpu-traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ bool ggml_cpu_extra_work_size(int n_threads, const struct ggml_tensor * op, size
#ifdef __cplusplus
}

namespace ggml::cpu {
namespace ggml {
namespace cpu {
// register in tensor->extra
class tensor_traits {
public:
Expand All @@ -30,6 +31,7 @@ class extra_buffer_type {
virtual bool supports_op(ggml_backend_dev_t dev, const struct ggml_tensor * op) = 0;
virtual tensor_traits * get_tensor_traits(const struct ggml_tensor * op) = 0;
};
}
} // namespace ggml::cpu

// implemented in ggml-cpu.cpp.
Expand Down

0 comments on commit 0772ec3

Please sign in to comment.