GPU Workshop Sample Code
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Macros
Pages
simpleMatlab
myfun.cu
Go to the documentation of this file.
1
4
5
__global__
void
6
myfun
(
float
* z,
const
float
* x,
const
float
* y,
int
n
,
int
m ) {
7
int
tid = blockIdx.x*blockDim.x+threadIdx.x;
8
int
nthreads = blockDim.x*gridDim.x;
9
10
for
(
int
i=tid; i<
n
; i+=nthreads) {
11
z[i] = x[i] + y[i];
12
}
13
}
14
15
16
17
Generated on Sun Jul 14 2013 17:09:40 for GPU Workshop Sample Code by
1.8.4