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

Method gpu_matmul

cake-core/src/backends/vulkan/mod.rs:970–984  ·  view source on GitHub ↗
(
        &self,
        buf_a: &MappedBuffer,
        buf_b: &MappedBuffer,
        buf_b_f16: Option<&Arc<MappedBuffer>>,
        m: usize,
        k: usize,
        n: usize,
    )

Source from the content-addressed store, hash-verified

968 }
969
970 fn gpu_matmul(
971 &self,
972 buf_a: &MappedBuffer,
973 buf_b: &MappedBuffer,
974 buf_b_f16: Option<&Arc<MappedBuffer>>,
975 m: usize,
976 k: usize,
977 n: usize,
978 ) -> (Vec<f32>, MappedBuffer) {
979 if m == 1 {
980 self.gpu_gemv(buf_a, buf_b, buf_b_f16, k, n)
981 } else {
982 self.gpu_gemm(buf_a, buf_b, m, k, n)
983 }
984 }
985
986 fn tensor_matmul(&self, a: &Tensor, b: &Tensor) -> Result<Tensor> {
987 let a_dims = a.dims();

Callers 1

tensor_matmulMethod · 0.80

Calls 2

gpu_gemvMethod · 0.80
gpu_gemmMethod · 0.80

Tested by

no test coverage detected