Demo entry 1487302

AOS

   

Submitted by anonymous on Apr 22, 2015 at 01:37
Language: CUDA. Code size: 290 Bytes.

struct pt {
  int x;
  int y;
};    

__global__
void aos_kernel(int n_pts, struct pt *p) {
  int tid = blockIdx.x * blockDim.x + threadIdx.x;
  int nthreads = blockDim.x * gridDim.x;

  for(int i = tid; i < n_pts; i += nthreads) {
    p[i].x = i;
    p[i].y = i * 10;
  }
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).