Created
July 21, 2015 13:19
-
-
Save g2384/710d41bad0c63b1c28d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__kernel void Livermorec_hydro_fragment_soap(__global float* x, __global float* y, __global float* z){ | |
int i = get_global_id(0); | |
int j = get_global_id(1); | |
int k = get_global_id(2); | |
int index = i + j * 2048 + k * 2048; | |
//int index = i + j*width +k*width*height; | |
x[index] = y[index] + z[index]; | |
/* | |
// ILP2 | |
int i = get_global_id(0); | |
int j = get_global_id(1); | |
int k = get_global_id(2); | |
int index = i + j * 2048 + k * 2048; | |
float zi = z[index]; | |
float yi = y[index]; | |
int stride = get_global_size(0); | |
int j2 = index + stride; | |
float zj = z[j2]; | |
float yj = y[j2]; | |
float xi=yi+zi; | |
float xj=yj+zj; | |
x[index]=xi; | |
x[j2] = xj; | |
/* | |
int i = get_global_id(0); | |
int stride = get_global_size(0); | |
int j=i+stride; | |
x[i]=y[i]+z[i]; | |
x[j]=y[j]+z[j]; | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment