annotate example/fft/gpu/norm.cl @ 1835:144e573b030b draft

fix fft
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Fri, 20 Dec 2013 03:00:32 +0900
parents 2c3adce7eb40
children
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
1835
144e573b030b fix fft
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1673
diff changeset
7 long n = param[0];
1673
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 }