Skip to content

Commit

Permalink
Example Metal implementation for batch_inverse (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarnesino committed Jan 3, 2025
1 parent 36b17ac commit 2e73e8d
Show file tree
Hide file tree
Showing 7 changed files with 395 additions and 0 deletions.
106 changes: 106 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cfg-if = "1.0.0"
educe.workspace = true
hex.workspace = true
itertools.workspace = true
metal = "0.30"
num-traits.workspace = true
rand = { version = "0.8.5", default-features = false, features = ["small_rng"] }
starknet-crypto = "0.6.2"
Expand Down
Binary file not shown.
10 changes: 10 additions & 0 deletions crates/prover/src/core/backend/metal/batch_inverse.metal
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <metal_stdlib>

using namespace metal;

kernel void add_arrays(const device float* in1 [[buffer(0)]],
const device float* in2 [[buffer(1)]],
device float* result [[buffer(2)]],
uint id [[thread_position_in_grid]]) {
result[id] = in1[id] + in2[id];
}
Binary file not shown.
Loading

0 comments on commit 2e73e8d

Please sign in to comment.