Browse Source

- additional test case to check StarPU omp support initialization/finalization inside the process constructor/destructor

Olivier Aumage 11 years ago
parent
commit
c67baef29e
3 changed files with 51 additions and 3 deletions
  1. 7 3
      tests/Makefile.am
  2. 0 0
      tests/openmp/init_exit_01.c
  3. 44 0
      tests/openmp/init_exit_02.c

+ 7 - 3
tests/Makefile.am

@@ -219,7 +219,8 @@ noinst_PROGRAMS =				\
 	microbenchs/redundant_buffer		\
 	microbenchs/local_pingpong		\
 	microbenchs/matrix_as_vector		\
-	openmp/init_exit			\
+	openmp/init_exit_01			\
+	openmp/init_exit_02			\
 	openmp/environment			\
 	overlap/overlap				\
 	overlap/gpu_concurrency			\
@@ -431,8 +432,11 @@ main_subgraph_repeat_regenerate_tag_SOURCES +=		\
 	main/increment.cu
 endif
 
-openmp_init_exit_SOURCES = 	\
-	openmp/init_exit.c
+openmp_init_exit_01_SOURCES = 	\
+	openmp/init_exit_01.c
+
+openmp_init_exit_02_SOURCES = 	\
+	openmp/init_exit_02.c
 
 openmp_environment_SOURCES = 	\
 	openmp/environment.c

tests/openmp/init_exit.c → tests/openmp/init_exit_01.c


+ 44 - 0
tests/openmp/init_exit_02.c

@@ -0,0 +1,44 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2014  Inria
+ *
+ * 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
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#include <starpu.h>
+#include "../helper.h"
+#include <stdio.h>
+
+#if !defined(STARPU_OPENMP)
+int main(int argc, char **argv)
+{
+	return STARPU_TEST_SKIPPED;
+}
+#else
+__attribute__((constructor))
+static void omp_constructor(void)
+{
+	int ret = starpu_omp_init();
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_omp_init");
+}
+
+__attribute__((destructor))
+static void omp_destructor(void)
+{
+	starpu_omp_shutdown();
+}
+
+int
+main (int argc, char *argv[]) {
+	return 0;
+}
+#endif