瀏覽代碼

tests: test return value for starpu_opencl_load_opencl_from_file

Nathalie Furmento 13 年之前
父節點
當前提交
93b298df19

+ 2 - 1
tests/datawizard/gpu_register.c

@@ -52,7 +52,8 @@ int main(int argc, char **argv)
 		return STARPU_TEST_SKIPPED;
 
 #ifdef STARPU_USE_OPENCL
-	starpu_opencl_load_opencl_from_file("tests/datawizard/scal_opencl.cl", &opencl_program, NULL);
+	ret = starpu_opencl_load_opencl_from_file("tests/datawizard/scal_opencl.cl", &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
 	n = starpu_worker_get_count();

+ 2 - 1
tests/datawizard/in_place_partition.c

@@ -30,7 +30,8 @@ int main(int argc, char **argv)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_USE_OPENCL
-	starpu_opencl_load_opencl_from_file("tests/datawizard/scal_opencl.cl", &opencl_program, NULL);
+	ret = starpu_opencl_load_opencl_from_file("tests/datawizard/scal_opencl.cl", &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
 	n = starpu_worker_get_count();

+ 3 - 2
tests/datawizard/interfaces/bcsr/bcsr_opencl.c

@@ -24,7 +24,7 @@ static struct starpu_opencl_program opencl_program;
 void
 test_bcsr_opencl_func(void *buffers[], void *args)
 {
-	int id, devid;
+	int id, devid, ret;
 	int factor = *(int *) args;
 
         cl_int             err;
@@ -32,7 +32,8 @@ test_bcsr_opencl_func(void *buffers[], void *args)
 	cl_command_queue   queue;
 	cl_event           event;
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	uint32_t nnz = STARPU_BCSR_GET_NNZ(buffers[0]);
 	cl_mem nzval = (cl_mem)STARPU_BCSR_GET_NZVAL(buffers[0]);

+ 3 - 2
tests/datawizard/interfaces/block/block_opencl.c

@@ -24,7 +24,7 @@ static struct starpu_opencl_program opencl_program;
 void
 test_block_opencl_func(void *buffers[], void *args)
 {
-	int id, devid;
+	int id, devid, ret;
 	int factor = *(int *) args;
 
         cl_int             err;
@@ -32,7 +32,8 @@ test_block_opencl_func(void *buffers[], void *args)
 	cl_command_queue   queue;
 	cl_event           event;
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	int nx = STARPU_BLOCK_GET_NX(buffers[0]);
 	int ny = STARPU_BLOCK_GET_NY(buffers[0]);

+ 3 - 2
tests/datawizard/interfaces/csr/csr_opencl.c

@@ -24,7 +24,7 @@ static struct starpu_opencl_program opencl_program;
 void
 test_csr_opencl_func(void *buffers[], void *args)
 {
-	int id, devid;
+	int id, devid, ret;
 	int factor = *(int *) args;
 
         cl_int             err;
@@ -32,7 +32,8 @@ test_csr_opencl_func(void *buffers[], void *args)
 	cl_command_queue   queue;
 	cl_event           event;
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	uint32_t nnz = STARPU_CSR_GET_NNZ(buffers[0]);
 	cl_mem nzval = (cl_mem)STARPU_CSR_GET_NZVAL(buffers[0]);

+ 5 - 4
tests/datawizard/interfaces/matrix/matrix_opencl.c

@@ -23,7 +23,7 @@ static struct starpu_opencl_program matrix_program;
 
 void test_matrix_opencl_func(void *buffers[], void *args)
 {
-	int id, devid, factor;
+	int id, devid, factor, ret;
 	unsigned int n;
 
         cl_int             err;
@@ -33,9 +33,10 @@ void test_matrix_opencl_func(void *buffers[], void *args)
 	cl_context         context;
 	cl_mem             val, fail;
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION,
-					    &matrix_program,
-					    NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION,
+						  &matrix_program,
+						  NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	factor = *(int *)args;
 	n = STARPU_MATRIX_GET_NX(buffers[0]);

+ 8 - 4
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets_opencl.c

@@ -1,6 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
+ * Copyright (C) 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -13,8 +14,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #include <starpu.h>
 #include <starpu_opencl.h>
+#include "../../../helper.h"
 
 #define KERNEL_LOCATION "tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets_kernel.cl"
 static struct starpu_opencl_program opencl_conversion_program;
@@ -22,7 +25,7 @@ static struct starpu_opencl_program opencl_conversion_program;
 void cpu_to_opencl_opencl_func(void *buffers[], void *args)
 {
 	(void) args;
-	int id, devid;
+	int id, devid, ret;
         cl_int err;
 	cl_kernel kernel;
 	cl_command_queue queue;
@@ -35,9 +38,10 @@ void cpu_to_opencl_opencl_func(void *buffers[], void *args)
 	id = starpu_worker_get_id();
 	devid = starpu_worker_get_devid(id);
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION,
-					    &opencl_conversion_program,
-					    NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION,
+						  &opencl_conversion_program,
+						  NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	err = starpu_opencl_load_kernel(&kernel,
 					&queue,

+ 5 - 4
tests/datawizard/interfaces/multiformat/multiformat_opencl.c

@@ -23,7 +23,7 @@ static struct starpu_opencl_program multiformat_program;
 
 void test_multiformat_opencl_func(void *buffers[], void *args)
 {
-	int id, devid, factor;
+	int id, devid, factor, ret;
 	unsigned int n;
 
         cl_int             err;
@@ -33,9 +33,10 @@ void test_multiformat_opencl_func(void *buffers[], void *args)
 	cl_context         context;
 	cl_mem             val, fail;
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION,
-					    &multiformat_program,
-					    NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION,
+						  &multiformat_program,
+						  NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	factor = *(int *)args;
 	n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);

+ 2 - 0
tests/datawizard/interfaces/test_interfaces.h

@@ -16,6 +16,8 @@
 #ifndef TEST_INTERFACES_H
 #define TEST_INTERFACES_H
 
+#include "../../helper.h"
+
 struct test_config
 {
 	/* A pointer to a registered handle */

+ 3 - 2
tests/datawizard/interfaces/variable/variable_opencl.c

@@ -24,7 +24,7 @@ static struct starpu_opencl_program opencl_program;
 
 void test_variable_opencl_func(void *buffers[], void *args)
 {
-	int id, devid;
+	int id, devid, ret;
 	int factor = *(int *) args;
 
         cl_int             err;
@@ -32,7 +32,8 @@ void test_variable_opencl_func(void *buffers[], void *args)
 	cl_command_queue   queue;
 	cl_event           event;
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	cl_mem val = (cl_mem)STARPU_VARIABLE_GET_PTR(buffers[0]);
 

+ 3 - 2
tests/datawizard/interfaces/vector/test_vector_opencl.c

@@ -24,7 +24,7 @@ static struct starpu_opencl_program opencl_program;
 void
 test_vector_opencl_func(void *buffers[], void *args)
 {
-	int id, devid;
+	int id, devid, ret;
 	int factor = *(int *) args;
 
         cl_int             err;
@@ -32,7 +32,8 @@ test_vector_opencl_func(void *buffers[], void *args)
 	cl_command_queue   queue;
 	cl_event           event;
 
-	starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	ret = starpu_opencl_load_opencl_from_file(KERNEL_LOCATION, &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 	unsigned n = STARPU_VECTOR_GET_NX(buffers[0]);
 	cl_mem val = (cl_mem)STARPU_VECTOR_GET_DEV_HANDLE(buffers[0]);

+ 2 - 1
tests/datawizard/sync_and_notify_data.c

@@ -94,7 +94,8 @@ int main(int argc, char **argv)
 #endif
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("tests/datawizard/sync_and_notify_data_opencl_codelet.cl", &opencl_code, NULL);
+        ret = starpu_opencl_load_opencl_from_file("tests/datawizard/sync_and_notify_data_opencl_codelet.cl", &opencl_code, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
         starpu_vector_data_register(&v_handle, 0, (uintptr_t)v, VECTORSIZE, sizeof(unsigned));

+ 2 - 1
tests/datawizard/sync_and_notify_data_implicit.c

@@ -132,7 +132,8 @@ int main(int argc, char **argv)
 #endif
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("tests/datawizard/sync_and_notify_data_opencl_codelet.cl", &opencl_code, NULL);
+        ret = starpu_opencl_load_opencl_from_file("tests/datawizard/sync_and_notify_data_opencl_codelet.cl", &opencl_code, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
         starpu_vector_data_register(&v_handle, 0, (uintptr_t)v, VECTORSIZE, sizeof(unsigned));