changeset 1496:8b0911f58b70 draft

fix kernel param size
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 21 Aug 2012 17:34:21 +0900
parents 05505bd5c183
children ff842b2d5c23
files TaskManager/Gpu/GpuScheduler.cc TaskManager/test/GpuRunTest/twice.cl
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Gpu/GpuScheduler.cc	Thu Aug 16 23:35:25 2012 +0900
+++ b/TaskManager/Gpu/GpuScheduler.cc	Tue Aug 21 17:34:21 2012 +0900
@@ -69,13 +69,13 @@
                 int param = 0;
                 
                 cl_mem memobj = clCreateBuffer(context, CL_MEM_READ_WRITE, 
-                                               sizeof(nextTask->param(param))*nextTask->param_count, NULL, NULL);
+                                               sizeof(memaddr)*nextTask->param_count, NULL, NULL);
                 err |= clEnqueueWriteBuffer(command_queue, memobj, CL_TRUE, 0, 
-                                            sizeof(nextTask->param(param))*nextTask->param_count, 
-                                            nextTask->param(param), 0, NULL, NULL);
-                err |= clSetKernelArg(kernel,  param, sizeof(memaddr), memobj);
+                                            sizeof(memaddr)*nextTask->param_count, 
+                                            nextTask->param(0), 0, NULL, NULL);
+                err |= clSetKernelArg(kernel, param, sizeof(memaddr), memobj);
 
-
+                
                 for(int i=0;i<nextTask->inData_count;i++) {
                     cl_mem memobj = clCreateBuffer(context, CL_MEM_READ_WRITE, nextTask->inData(i)->size, NULL, NULL);
                     err |= clEnqueueWriteBuffer(command_queue, memobj, CL_TRUE, 0, 
--- a/TaskManager/test/GpuRunTest/twice.cl	Thu Aug 16 23:35:25 2012 +0900
+++ b/TaskManager/test/GpuRunTest/twice.cl	Tue Aug 21 17:34:21 2012 +0900
@@ -3,7 +3,7 @@
       __global int *input_data,
       __global int *output_data)
 {
-    long count = (long)data_count;
+    long count = (long)data_count[0];
 	for (int i = 0; i<count; i++) {
 	    output_data[i] = input_data[i] * 2;
 	}