Skip to content

Commit

Permalink
give up and switch to c++17 (+1 squashed commits)
Browse files Browse the repository at this point in the history
Squashed commits:

[96cfbc48] give up and switch to c++17 (+5 squashed commit)

Squashed commit:

[19ac7c26] Revert "fixed incorrect number of params"

This reverts commit 5138872.

[45f730da] Revert "fix for c++17"

This reverts commit 050ba5f.

[5138872] fixed incorrect number of params

[8f1ee54] build latest vk shaders

[050ba5f] fix for c++17
  • Loading branch information
LostRuins committed Dec 13, 2024
1 parent 46d76d9 commit b7dfb55
Show file tree
Hide file tree
Showing 6 changed files with 718,202 additions and 194,702 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ endif
# Compile flags
#

# keep standard at C11 and C++11
# keep standard at C11 and C++17
CFLAGS =
CXXFLAGS =
ifdef KCPP_DEBUG
CFLAGS = -g -O0
CXXFLAGS = -g -O0
endif
CFLAGS += -I. -Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -I./include -I./include/CL -I./otherarch -I./otherarch/tools -I./otherarch/sdcpp -I./otherarch/sdcpp/thirdparty -I./include/vulkan -O3 -fno-finite-math-only -std=c11 -fPIC -DLOG_DISABLE_LOGS -D_GNU_SOURCE -DGGML_USE_CPU -DGGML_USE_CPU_AARCH64
CXXFLAGS += -I. -Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -I./common -I./include -I./include/CL -I./otherarch -I./otherarch/tools -I./otherarch/sdcpp -I./otherarch/sdcpp/thirdparty -I./include/vulkan -O3 -fno-finite-math-only -std=c++11 -fPIC -DLOG_DISABLE_LOGS -D_GNU_SOURCE -DGGML_USE_CPU -DGGML_USE_CPU_AARCH64
CXXFLAGS += -I. -Iggml/include -Iggml/src -Iggml/src/ggml-cpu -Iinclude -Isrc -I./common -I./include -I./include/CL -I./otherarch -I./otherarch/tools -I./otherarch/sdcpp -I./otherarch/sdcpp/thirdparty -I./include/vulkan -O3 -fno-finite-math-only -std=c++17 -fPIC -DLOG_DISABLE_LOGS -D_GNU_SOURCE -DGGML_USE_CPU -DGGML_USE_CPU_AARCH64
ifndef KCPP_DEBUG
CFLAGS += -DNDEBUG -s
CXXFLAGS += -DNDEBUG -s
Expand Down
13 changes: 2 additions & 11 deletions ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3838,9 +3838,7 @@ static int repack_iq4_nl_to_iq4_nl_4_bl(struct ggml_tensor * t, int interleave_b
GGML_UNUSED(data_size);
}

namespace ggml {
namespace cpu {
namespace aarch64 { //ggml::cpu::aarch64
namespace 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 @@ -4156,8 +4154,6 @@ 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 void flag_aarch_prepacked_quant(int type)
Expand Down Expand Up @@ -4260,9 +4256,7 @@ static size_t ggml_backend_cpu_aarch64_buffer_type_get_alignment(ggml_backend_bu
GGML_UNUSED(buft);
}

namespace ggml {
namespace cpu {
namespace aarch64 { //ggml::cpu::aarch64
namespace 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 @@ -4309,9 +4303,6 @@ 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: 1 addition & 3 deletions ggml/src/ggml-cpu/ggml-cpu-traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
#include "ggml-backend-impl.h"
#include "ggml-backend.h"

namespace ggml {
namespace cpu {
namespace ggml::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: 1 addition & 3 deletions ggml/src/ggml-cpu/ggml-cpu-traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ bool ggml_cpu_extra_work_size(int n_threads, const struct ggml_tensor * op, size
#ifdef __cplusplus
}

namespace ggml {
namespace cpu {
namespace ggml::cpu {
// register in tensor->extra
class tensor_traits {
public:
Expand All @@ -31,7 +30,6 @@ 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
Loading

0 comments on commit b7dfb55

Please sign in to comment.