Skip to content

Instantly share code, notes, and snippets.

View ohad7's full-sized avatar

Ohad Serfaty ohad7

View GitHub Profile
@jrprice
jrprice / kernel.metal
Last active August 6, 2020 09:29
Comparison of trivial vector addition in Metal and OpenCL
#include <metal_stdlib>
using namespace metal;
kernel void vecadd(const device float *a [[buffer(0)]],
const device float *b [[buffer(1)]],
device float *c [[buffer(2)]],
uint i [[thread_position_in_grid]])
{
c[i] = c[i] + a[i] + b[i];
}