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/ggml-et-memops.cpp # 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 / ggml-et-memops.cpp` 36 lines ยท 1097 bytes Raw Blame History 1 #include "ggml-et-memops.h" 2 3 #include "ggml-et-kernels.h" 4 #include "ggml-impl.h" 5 6 // Kernel parameter structure for memset operation 7 struct memset_params { 8 uint32_t op_type; // GGML_ET_MEMOP_MEMSET 9 uint32_t value; // Value to set (extended to uint32_t for alignment) 10 void * dst_ptr; // Destination device pointer 11 size_t size; // Number of bytes to set 12 }; 13 14 bool ggml_et_memset(ggml_backend_et_device_context * dev_ctx, void * dst_ptr, uint8_t value, size_t size) { 15 if (!dev_ctx || !dst_ptr || size == 0) { 16 GGML_LOG_ERROR("ET: Invalid memset parameters\n"); 17 return false; 18 } 19 20 // Prepare kernel parameters 21 memset_params params; 22 params.op_type = GGML_ET_MEMOP_MEMSET; 23 params.value = value; 24 params.dst_ptr = dst_ptr; 25 params.size = size; 26 27 // Launch memops kernel (will lazy-load if not already loaded) 28 bool success = ggml_et_launch_kernel(dev_ctx, "memops", ¶ms, sizeof(params)); 29 30 if (!success) { 31 GGML_LOG_ERROR("ET: memset kernel launch failed\n"); 32 return false; 33 } 34 35 return true; 36 }