Skip to content

Instantly share code, notes, and snippets.

@ericmjonas
Created January 17, 2011 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericmjonas/782290 to your computer and use it in GitHub Desktop.
Save ericmjonas/782290 to your computer and use it in GitHub Desktop.
__global__ void initialize_data(SuffStats * ss)
{
int fid = threadIdx.x; // + blockIdx.x * blockDim.x;
SuffStats * myss = &ss[fid]; // group * FEATUREN + fid];
float x = 0.0;
float y = 0.0;
int z = 0.0;
for(int i = 0; i < 1024; i++) {
//float dpval = data[i * FEATUREN + fid];
int group = 0; // assignvect[i];
x += i * FEATUREN + fid; // * FEATUREN + fid; // dpval;
y += i * FEATUREN;
z += fid;
}
myss->sampmean = x;
myss->allsampvar = y;
myss->dpcount = z;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment