Skip to content

Commit

Permalink
Fix MPS command buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertdelajonquieresonos authored and kali committed Dec 13, 2024
1 parent d6837f8 commit d47b6f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions metal/src/kernels/matmul/mps/api.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use foreign_types::{foreign_type, ForeignType};
use metal::mps::{Kernel, KernelRef};
use metal::{Buffer, Device, NSUInteger};
use metal::{Buffer, CommandBuffer, Device, NSUInteger};
use objc::runtime::Object;
use objc::{class, msg_send, sel, sel_impl};
use paste::paste;
Expand Down Expand Up @@ -277,8 +277,9 @@ impl MatrixMultiplicationRef {
right: Matrix,
result: Matrix,
) {
let cmd_buffer: CommandBuffer = command_buffer.as_ref().to_owned();
unsafe {
msg_send![self, encodeToCommandBuffer: command_buffer
msg_send![self, encodeToCommandBuffer: cmd_buffer
leftMatrix: left
rightMatrix: right
resultMatrix: result]
Expand Down Expand Up @@ -354,8 +355,9 @@ impl MatrixVectorMultiplicationRef {
right: Vector,
result: Vector,
) {
let cmd_buffer: CommandBuffer = command_buffer.as_ref().to_owned();
unsafe {
msg_send![self, encodeToCommandBuffer: command_buffer
msg_send![self, encodeToCommandBuffer: cmd_buffer
inputMatrix: left
inputVector: right
resultVector: result]
Expand Down

0 comments on commit d47b6f9

Please sign in to comment.