Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <metal_stdlib>
- using namespace metal;
- kernel void addition_compute_function(constant int *arr1 [[ buffer(0) ]],
- constant int *arr2 [[ buffer(1) ]],
- constant int& myVal [[ buffer(3) ]],
- device int *resultArray [[ buffer(2) ]],
- uint index [[ thread_position_in_grid ]])
- {
- resultArray[index] = arr1[index] + arr2[index] + myVal;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement