MCPcopy Create free account
hub / github.com/evilsocket/cake / upload_uncached

Method upload_uncached

cake-core/src/backends/vulkan/mod.rs:660–675  ·  view source on GitHub ↗
(&self, data: &[f32])

Source from the content-addressed store, hash-verified

658 }
659
660 fn upload_uncached(&self, data: &[f32]) -> MappedBuffer {
661 let bytes = (data.len() * 4) as u64;
662 let key = BufferPool::bucket(bytes);
663 let mut alloc_guard = self.allocator.lock().unwrap();
664 let alloc = alloc_guard.as_mut().unwrap();
665 let buf = Self::alloc_mapped_buffer(
666 &self.vk_device,
667 alloc,
668 key,
669 vk::BufferUsageFlags::STORAGE_BUFFER,
670 self.uma_memory_type,
671 )
672 .expect("failed to allocate upload buffer");
673 buf.write_f32(data);
674 buf
675 }
676
677 // ── Tensor helpers ───────────────────────────────────────────────
678

Callers 1

tensor_matmulMethod · 0.80

Calls 1

write_f32Method · 0.80

Tested by

no test coverage detected