diff example/Cuda/multiply.cu @ 1918:15e8c50ed570 draft

add cuda sample, not running
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Fri, 24 Jan 2014 07:16:26 +0900
parents
children d6e033734c12
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/Cuda/multiply.cu	Fri Jan 24 07:16:26 2014 +0900
@@ -0,0 +1,5 @@
+__global__ void multiply(int* A, int* B, int* C) {
+    int index = blockIdx.x * blockDim.x + threadIdx.x;
+    
+    C[index] = A[index] * B[index];
+}