Mercurial > hg > Game > Cerium
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]; }