MCPcopy Create free account
hub / github.com/andrewkchan/deepseek.cpp / allocateAlignedArray

Function allocateAlignedArray

src/test.cpp:209–216  ·  view source on GitHub ↗

Helper function to allocate aligned memory

Source from the content-addressed store, hash-verified

207
208// Helper function to allocate aligned memory
209float* allocateAlignedArray(size_t N) {
210 // Allocate aligned memory (64-byte alignment for AVX-512)
211 void* ptr = nullptr;
212 if (posix_memalign(&ptr, 64, N * sizeof(float)) != 0) {
213 throw std::bad_alloc();
214 }
215 return static_cast<float*>(ptr);
216}
217
218void mem_bench() {
219 constexpr size_t N_THREADS = 32;

Callers 1

mem_benchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected