diff src/parallel_execution/CUDAtwice.cbc @ 316:54d203daf06b

CUDAtwice.cbc is called.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 15 Feb 2017 16:25:23 +0900
parents 1839586f5b41
children 054c47e6ca20
line wrap: on
line diff
--- a/src/parallel_execution/CUDAtwice.cbc	Wed Feb 15 12:34:19 2017 +0900
+++ b/src/parallel_execution/CUDAtwice.cbc	Wed Feb 15 16:25:23 2017 +0900
@@ -18,7 +18,7 @@
     checkCudaErrors(cuMemAlloc(&devLoopCounter, sizeof(LoopCounter)));
 
     //twiceカーネルが定義されてなければそれをロードする
-    checkCudaErrors(cuModuleLoad(&context->module, "CUDAtwice.ptx"));
+    checkCudaErrors(cuModuleLoad(&context->module, "c/CUDAtwice.ptx"));
     checkCudaErrors(cuModuleGetFunction(&context->function, context->module, "twice"));
 printf("CUdA Exe 2\n");
 
@@ -38,7 +38,9 @@
     //結果を取ってくるコマンドを入力する
     //コマンドの終了待ちを行う   
     checkCudaErrors(cuMemcpyDtoH(array->array, devA, array->size));
+
     // wait for stream
+    checkCudaErrors(cuCtxSynchronize());
 }
 
 __code CUDAtwice(struct Context* context, struct LoopCounter* loopCounter, int index, int prefix, int* array, struct Context* workerContext) {