Mercurial > hg > Game > Cerium
annotate example/multiply/cuda/multiply.cu @ 1941:f19885ea776d draft
add wordcount for cuda. fix CudaScheduler. add makefile
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 04 Feb 2014 02:18:07 +0900 |
parents | 67e50779feb4 |
children | da22fc4db5b2 |
rev | line source |
---|---|
1927 | 1 extern "C" { |
1941
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1935
diff
changeset
|
2 __global__ void multi(long* params, float* A, float* B, float* C) { |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1935
diff
changeset
|
3 //int id = blockIdx.x * blockDim.x + threadIdx.x; |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1935
diff
changeset
|
4 long length = params[0]; |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1935
diff
changeset
|
5 for (int id = 0; id < length; id++) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1935
diff
changeset
|
6 C[id]=A[id]*B[id]; |
1927 | 7 } |
8 } |