Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-et/cmake/embed_one_kernel.cmake # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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 6 file(READ "${ELF_FILE}" HEX HEX) 7 string(LENGTH "${HEX}" HEX_LEN) 8 math(EXPR SIZE "${HEX_LEN} / 2") 9 string(REGEX REPLACE "(..)" "0x\\1," BYTES "${HEX}") 10 11 file(WRITE "${OUT_FILE}" 12 "// Auto-generated by embed_one_kernel.cmake. Do not edit.\n" 13 "#include \n" 14 "unsigned char ${VAR_NAME}_data[${SIZE}] = { ${BYTES} };\n" 15 "extern const uint64_t ${VAR_NAME}_len = ${SIZE};\n")