Skip to content

Instantly share code, notes, and snippets.

@full-of-foo
Created May 6, 2015 14:10
Show Gist options
  • Save full-of-foo/85ff9ee93913385c1d90 to your computer and use it in GitHub Desktop.
Save full-of-foo/85ff9ee93913385c1d90 to your computer and use it in GitHub Desktop.
void calculation(global float *A, global float *B, int n)
{
int i = get_global_id(0);
int j = get_global_id(1);
int k;
float value = 0.0;
for (k=0; k<n; k++)
value += A[j*n+k] * A[k*n+i];
B[j*n+i] = value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment