diff src/parallel_execution/examples/twice/CUDAtwice.cu @ 438:7679093bdd72

Work CUDAtwice
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Mon, 06 Nov 2017 00:11:43 +0900
parents 764c92c3b181
children
line wrap: on
line diff
--- a/src/parallel_execution/examples/twice/CUDAtwice.cu	Sat Nov 04 08:30:25 2017 +0900
+++ b/src/parallel_execution/examples/twice/CUDAtwice.cu	Mon Nov 06 00:11:43 2017 +0900
@@ -1,7 +1,12 @@
 extern "C" {
-    __global__ void twice(int* array, int* prefixPtr) {
+    struct Array {
+        int prefix;
+        int* array;
+    } Array;
+
+    __global__ void twice(int* array, struct Array* inputArray) {
         int i = 0;
-        int prefix = *prefixPtr;
+        int prefix = inputArray->prefix;
 C_twice:
         if (i < prefix) {
             array[i+(blockIdx.x*blockDim.x+threadIdx.x)*prefix] = array[i+(blockIdx.x*blockDim.x+threadIdx.x)*prefix]*2;