浏览代码

Fix test with only opencl

Samuel Thibault 13 年之前
父节点
当前提交
d083734f5b

+ 4 - 1
tests/datawizard/handle_to_pointer.c

@@ -19,6 +19,7 @@
 
 #include <starpu.h>
 #include <stdlib.h>
+#include "../helper.h"
 
 static void cpu_task(void **buffers, void *args)
 {
@@ -99,10 +100,12 @@ int main(int argc, char *argv[])
 	STARPU_ASSERT(starpu_handle_to_pointer(handle, 0) == NULL);
 
 	/* Pass the handle to a task.  */
-	starpu_insert_task(&cl,
+	err = starpu_insert_task(&cl,
 			   STARPU_W, handle,
 			   STARPU_VALUE, &count, sizeof(count),
 			   0);
+	if (err == -ENODEV)
+		return STARPU_TEST_SKIPPED;
 
 	/* Acquire the handle, forcing a local allocation.  */
 	starpu_data_acquire(handle, STARPU_R);

+ 3 - 1
tests/datawizard/lazy_allocation.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010  Université de Bordeaux 1
+ * Copyright (C) 2010-2011  Université de Bordeaux 1
  *
  * 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
@@ -120,6 +120,8 @@ int main(int argc, char **argv)
 	starpu_vector_data_register(&v_handle, (uint32_t)-1, (uintptr_t)NULL, VECTORSIZE, sizeof(char));
 
 	ret = starpu_insert_task(&memset_cl, STARPU_W, v_handle, 0);
+	if (ret == -ENODEV)
+		return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_insert_task");
 
         ret = starpu_task_wait_for_all();

+ 3 - 1
tests/datawizard/mpi_like.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010  Université de Bordeaux 1
+ * Copyright (C) 2010-2011  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -79,6 +79,8 @@ static void increment_handle(struct thread_data *thread_data)
 	task->detach = 0;
 
 	int ret = starpu_task_submit(task);
+	if (ret == -ENODEV)
+		exit(STARPU_TEST_SKIPPED);
 	STARPU_ASSERT(!ret);
 
 	ret = starpu_task_wait(task);

+ 3 - 1
tests/datawizard/mpi_like_async.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010  Université de Bordeaux 1
+ * Copyright (C) 2010-2011  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -92,6 +92,8 @@ static void increment_handle_async(struct thread_data *thread_data)
 	task->destroy = 1;
 
 	int ret = starpu_task_submit(task);
+	if (ret == -ENODEV)
+		exit(STARPU_TEST_SKIPPED);
 	STARPU_ASSERT(!ret);
 }
 

+ 2 - 0
tests/perfmodels/non_linear_regression_based.c

@@ -70,6 +70,8 @@ static void test_memset(int nelems)
 		task->buffers[0].mode = STARPU_W;
 
 		int ret = starpu_task_submit(task);
+		if (ret == -ENODEV)
+			exit(STARPU_TEST_SKIPPED);
 		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 	}
 

+ 2 - 0
tests/perfmodels/regression_based.c

@@ -88,6 +88,8 @@ static void test_memset(int nelems, struct starpu_codelet *codelet)
 		task->handles[0] = handle;
 
 		int ret = starpu_task_submit(task);
+		if (ret == -ENODEV)
+			exit(STARPU_TEST_SKIPPED);
 		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 	}