changeset 1695:9c065614561f draft

fix multiply
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Mon, 30 Sep 2013 18:54:36 +0900
parents 1755ae347fce
children e8ded21ac9a2
files example/multiply/Makefile.gpu example/multiply/gpu/Multi.cl example/multiply/main.cc
diffstat 3 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/example/multiply/Makefile.gpu	Tue Sep 24 17:14:51 2013 +0900
+++ b/example/multiply/Makefile.gpu	Mon Sep 30 18:54:36 2013 +0900
@@ -5,11 +5,10 @@
 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
 OBJS = $(SRCS:.cc=.o)
 
-GPU_TASK_DIR = gpu
-TASK_DIR  = ppe
+TASK_DIR  = gpu
 TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
 TASK_SRCS_EXCLUDE = 
-TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) $(wildcard $(GPU_TASK_DIR)/*.cc)
+TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
 TASK_OBJS = $(TASK_SRCS:.cc=.o)
 
 LIBS += `sdl-config --libs` -lGpuManager -framework opencl
--- a/example/multiply/gpu/Multi.cl	Tue Sep 24 17:14:51 2013 +0900
+++ b/example/multiply/gpu/Multi.cl	Mon Sep 30 18:54:36 2013 +0900
@@ -1,9 +1,7 @@
 __kernel void
-multi(__global const void *params,__global const float *A, __global const float*B, __global float *C,int param0,int param1)
+multi(__global const void *params,__global const float *A, __global const float*B, __global float *C)
 {
-    if (param0 ==256 && param1 == 512) {
-        int i=get_global_id(0);
+    int i=get_global_id(0);
 
-        C[i]=A[i]*B[i];
-    }
+    C[i]=A[i]*B[i];
 }
--- a/example/multiply/main.cc	Tue Sep 24 17:14:51 2013 +0900
+++ b/example/multiply/main.cc	Mon Sep 30 18:54:36 2013 +0900
@@ -72,7 +72,7 @@
     C = new float[length];
     for(int i=0; i<length; i++) {
         A[i]=(float)(i+1000);
-        B[i]=(float)i/10.f;
+        B[i]=(float)(i+1)/10.f;
     }
 
     // set ND_RANGE parameter