annotate example/fft/gpu/norm.cl @ 1673:2c3adce7eb40 draft

fix fft on gpu
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Thu, 18 Jul 2013 17:16:43 +0900
parents
children 144e573b030b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1673
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 __kernel void
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 norm(__constant long *param, __global float2 *in_x, __global float2 *out_x)
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 {
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 unsigned long gid = (unsigned long)get_global_id(0);
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 unsigned long nid = (unsigned long)get_global_id(1);
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 long n = param[3];
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 out_x[nid*n+gid].x = in_x[nid*n+gid].x / (float)n;
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 out_x[nid*n+gid].y = in_x[nid*n+gid].y / (float)n;
2c3adce7eb40 fix fft on gpu
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 }