Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
14
third-party/vendor/metal/examples/compute/compute-argument-buffer.metal
vendored
Normal file
14
third-party/vendor/metal/examples/compute/compute-argument-buffer.metal
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct SumInput {
|
||||
device uint *data;
|
||||
volatile device atomic_uint *sum;
|
||||
};
|
||||
|
||||
kernel void sum(device SumInput& input [[ buffer(0) ]],
|
||||
uint gid [[ thread_position_in_grid ]])
|
||||
{
|
||||
atomic_fetch_add_explicit(input.sum, input.data[gid], memory_order_relaxed);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue