char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
082b326fc
char/aliceai-t5-moe
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 7struct memset_params { 8uint32_t op_type ;// GGML_ET_MEMOP_MEMSET 9uint32_t value ;// Value to set (extended to uint32_t for alignment) 10void * dst_ptr ;// Destination device pointer 11size_t size ;// Number of bytes to set 12}; 13 14bool ggml_et_memset (ggml_backend_et_device_context * dev_ctx ,void * dst_ptr ,uint8_t value ,size_t size ) { 15if (!dev_ctx || !dst_ptr || size == 0 ) { 16GGML_LOG_ERROR ("ET: Invalid memset parameters\n" ); 17return false; 18 } 19 20// Prepare kernel parameters 21memset_params params ; 22params .op_type = GGML_ET_MEMOP_MEMSET ; 23params .value = value ; 24params .dst_ptr = dst_ptr ; 25params .size = size ; 26 27// Launch memops kernel (will lazy-load if not already loaded) 28bool success = ggml_et_launch_kernel (dev_ctx ,"memops" ,& params ,sizeof (params )); 29 30if (!success ) { 31GGML_LOG_ERROR ("ET: memset kernel launch failed\n" ); 32return false; 33 } 34 35return true; 36}