diff example/multiply/cuda/multiply.cu @ 1927:4eefec26e3e2 draft

add file
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Fri, 31 Jan 2014 07:15:07 +0900
parents
children 67e50779feb4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/multiply/cuda/multiply.cu	Fri Jan 31 07:15:07 2014 +0900
@@ -0,0 +1,6 @@
+extern "C" {
+    __global__ void multi(float* A, float* B, float* C) {
+        int id = blockIdx.x * blockDim.x + threadIdx.x;
+        C[id]=A[id]*B[id];
+    }
+}