Skip to content

Commit

Permalink
fix GGML_OP_COUNT, Metal build
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesGaessler committed Aug 17, 2024
1 parent d2c6553 commit ffcfa7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
20 changes: 0 additions & 20 deletions examples/mnist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,3 @@ target_link_libraries(${TEST_TARGET} PRIVATE ggml common mnist-common)
set(TEST_TARGET mnist-train)
add_executable(${TEST_TARGET} mnist-train.cpp)
target_link_libraries(${TEST_TARGET} PRIVATE ggml common mnist-common)

if (APPLE)
#
# mnist-mtl

find_library(FOUNDATION_LIBRARY Foundation REQUIRED)
find_library(METAL_FRAMEWORK Metal REQUIRED)
find_library(METALKIT_FRAMEWORK MetalKit REQUIRED)
find_library(METALPERFORMANCE_FRAMEWORK MetalPerformanceShaders REQUIRED)

set(TEST_TARGET mnist-mtl)
add_executable(${TEST_TARGET} main-mtl.cpp main-mtl.h main-mtl.m)
target_link_libraries(${TEST_TARGET} PRIVATE
ggml
${FOUNDATION_LIBRARY}
${METAL_FRAMEWORK}
${METALKIT_FRAMEWORK}
${METALPERFORMANCE_FRAMEWORK}
)
endif()
4 changes: 2 additions & 2 deletions src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,7 @@ static const char * GGML_OP_NAME[GGML_OP_COUNT] = {
"CROSS_ENTROPY_LOSS_BACK",
};

static_assert(GGML_OP_COUNT == 76, "GGML_OP_COUNT != 76");
static_assert(GGML_OP_COUNT == 78, "GGML_OP_COUNT != 78");

static const char * GGML_OP_SYMBOL[GGML_OP_COUNT] = {
"none",
Expand Down Expand Up @@ -2931,7 +2931,7 @@ static const char * GGML_OP_SYMBOL[GGML_OP_COUNT] = {
"cross_entropy_loss_back(x,y)",
};

static_assert(GGML_OP_COUNT == 76, "GGML_OP_COUNT != 76");
static_assert(GGML_OP_COUNT == 78, "GGML_OP_COUNT != 78");

static_assert(GGML_OP_POOL_COUNT == 2, "GGML_OP_POOL_COUNT != 2");

Expand Down

0 comments on commit ffcfa7e

Please sign in to comment.