浏览代码

tests/datawizard/in_place_partition.c: fix prototype for opencl kernel, and update error checking for main application

Nathalie Furmento 13 年之前
父节点
当前提交
6926180b3d
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. 4 3
      tests/datawizard/in_place_partition.c
  2. 2 2
      tests/datawizard/scal_opencl.cl

+ 4 - 3
tests/datawizard/in_place_partition.c

@@ -74,14 +74,15 @@ int main(int argc, char **argv)
 	starpu_data_unregister(handle);
 	starpu_shutdown();
 
+	ret = EXIT_SUCCESS;
 	for (i = 0; i < size; i++) {
 		if (foo[i] != i*2) {
-			fprintf(stderr,"value %d is %d instead of %d\n", i, foo[i], 2*i);
-			return EXIT_FAILURE;
+			FPRINTF(stderr,"value %d is %d instead of %d\n", i, foo[i], 2*i);
+			ret = EXIT_FAILURE;
 		}
 	}
 
-        return EXIT_SUCCESS;
+        return ret;
 
 enodev:
 	starpu_data_unregister(handle);

+ 2 - 2
tests/datawizard/scal_opencl.cl

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2011  Université Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -15,7 +15,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-__kernel void vector_mult_opencl(__global float* val, unsigned offset, unsigned nx)
+__kernel void vector_mult_opencl(__global unsigned* val, unsigned offset, unsigned nx)
 {
         const int i = get_global_id(0);
 	val = (__global void*) val + offset;