interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

branch master Branches Tags History

ggml / src / ggml-et / cmake / embed_one_kernel.cmake

15 lines · 517 bytes Raw Blame History
1# Inputs (via -D):
2# ELF_FILE - path to source .elf
3# OUT_FILE - path to output .cpp
4# VAR_NAME - C symbol base name (kernel name)
5
6file(READ "${ELF_FILE}" HEX HEX)
7string(LENGTH "${HEX}" HEX_LEN)
8math(EXPR SIZE "${HEX_LEN} / 2")
9string(REGEX REPLACE "(..)" "0x\\1," BYTES "${HEX}")
10
11file(WRITE "${OUT_FILE}"
12"// Auto-generated by embed_one_kernel.cmake. Do not edit.\n"
13"#include <cstdint>\n"
14"unsigned char ${VAR_NAME}_data[${SIZE}] = { ${BYTES} };\n"
15"extern const uint64_t ${VAR_NAME}_len = ${SIZE};\n")