Browse Source

fix merge

Nathalie Furmento 5 years ago
parent
commit
f2bc040749

+ 36 - 1
examples/Makefile.am

@@ -207,6 +207,7 @@ STARPU_EXAMPLES +=				\
 	api/matrix_data_interface		\
 	api/multiformat_data_interface		\
 	api/variable_data_interface		\
+	api/vector_data_interface		\
 	api/void_data_interface
 
 if !STARPU_SIMGRID
@@ -223,6 +224,8 @@ STARPU_EXAMPLES +=				\
 	basic_examples/task_insert_color	\
 	mlr/mlr					\
 	cpp/incrementer_cpp			\
+	cpp/add_vectors				\
+	cpp/add_vectors_interface		\
 	filters/fvector				\
 	filters/fblock				\
 	filters/fmatrix				\
@@ -270,6 +273,11 @@ if !STARPU_SIMGRID
 STARPU_EXAMPLES +=				\
 	scheduler/dummy_sched
 
+if STARPU_HAVE_CXX11
+STARPU_EXAMPLES +=	\
+	cpp/add_vectors_cpp11
+endif
+
 if STARPU_HAVE_F77
 if STARPU_HAVE_F77_H
 STARPU_EXAMPLES +=				\
@@ -282,7 +290,15 @@ endif
 
 if STARPU_HAVE_FC
 if !STARPU_SANITIZE
-
+STARPU_EXAMPLES +=				\
+	fortran90/f90_example			\
+	native_fortran/nf_vector		\
+	native_fortran/nf_matrix		\
+	native_fortran/nf_example		\
+	native_fortran/nf_dynbuf		\
+	native_fortran/nf_varbuf		\
+	native_fortran/nf_sched_ctx		\
+	native_fortran/nf_partition
 endif
 endif
 endif
@@ -388,10 +404,14 @@ basic_examples_vector_scal_SOURCES =		\
 
 if STARPU_HAVE_ICC
 if STARPU_CROSS_COMPILING
+basic_examples_vector_scal_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(basic_examples_vector_scal_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 else
 basic_examples_vector_scal_SOURCES +=		\
 	basic_examples/vector_scal_cpu_icc.icc
+basic_examples_vector_scal_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(ICC) $(basic_examples_vector_scal_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 endif
+else
+basic_examples_vector_scal_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) $(basic_examples_vector_scal_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 endif
 
 if STARPU_USE_CUDA
@@ -902,6 +922,21 @@ cpp_incrementer_cpp_SOURCES += \
 	incrementer/incrementer_kernels_opencl.c
 endif
 
+###########################
+# C++ Add vectors example #
+###########################
+
+cpp_add_vectors_SOURCES	=	\
+	cpp/add_vectors.cpp
+
+cpp_add_vectors_interface_SOURCES	=	\
+	cpp/add_vectors_interface.cpp
+
+if STARPU_HAVE_CXX11
+cpp_add_vectors_cpp11_SOURCES	=	\
+	cpp/add_vectors_cpp11.cpp
+endif
+
 #######################
 # Incrementer example #
 #######################

+ 34 - 0
examples/cpp/Makefile_add_vectors.mk

@@ -0,0 +1,34 @@
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2016-2020  Université de Bordeaux, CNRS (LaBRI UMR 5800), 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.
+#
+PROG = add_vectors
+
+SRCCXX = add_vectors.cpp
+
+CXX = g++
+
+CXXFLAGS = -g -DPRINT_OUTPUT $(shell pkg-config --cflags starpu-1.3)
+LDLIBS =  $(shell pkg-config --libs starpu-1.3)
+
+OBJS = $(SRCCXX:%.cpp=%.o)
+
+.phony: all clean
+all: $(PROG)
+
+$(PROG): $(OBJS)
+	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+
+clean:
+	rm -fv *.o $(PROG)

+ 34 - 0
examples/cpp/Makefile_add_vectors_cpp11.mk

@@ -0,0 +1,34 @@
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2016-2020  Université de Bordeaux, CNRS (LaBRI UMR 5800), 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.
+#
+PROG = add_vectors_cpp11
+
+SRCCXX = add_vectors_cpp11.cpp
+
+CXX = g++
+
+CXXFLAGS = -g -std=c++11 -DPRINT_OUTPUT $(shell pkg-config --cflags starpu-1.3)
+LDLIBS =  $(shell pkg-config --libs starpu-1.3)
+
+OBJS = $(SRCCXX:%.cpp=%.o)
+
+.phony: all clean
+all: $(PROG)
+
+$(PROG): $(OBJS)
+	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+
+clean:
+	rm -fv *.o $(PROG)

+ 6 - 1
examples/cpp/incrementer_cpp.cpp

@@ -49,7 +49,12 @@ int main(int argc, char **argv)
 	unsigned i;
 	unsigned niter = 50;
 
-	ret = starpu_init(NULL);
+	struct starpu_conf conf;
+	starpu_conf_init(&conf);
+	conf.nmic = 0;
+	conf.nmpi_ms = 0;
+
+	ret = starpu_init(&conf);
 	if (ret == -ENODEV) return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 

+ 25 - 0
tests/main/increment_opencl.c

@@ -0,0 +1,25 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2019                                     CNRS
+ *
+ * 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>
+
+void opencl_host_increment(void *descr[], void *_args)
+{
+	(void)_args;
+	unsigned *var = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
+
+	//	cuda_increment<<<1,1, 0, starpu_cuda_get_local_stream()>>>(var);
+}