Przeglądaj źródła

starpufft: move directory from examples/ to main directory and enable test suite on make check

Nathalie Furmento 13 lat temu
rodzic
commit
9ec55dd785

+ 6 - 1
Makefile.am

@@ -34,11 +34,16 @@ if COND_OPT
 SUBDIRS += tests/opt examples/opt
 endif
 
-
 if BUILD_GCC_PLUGIN
 SUBDIRS += gcc-plugin
 endif
 
+if STARPU_HAVE_FFTW
+if STARPU_HAVE_FFTWF
+SUBDIRS += starpufft
+endif
+endif
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libstarpu.pc libstarpu1.0.pc
 if USE_MPI

+ 3 - 3
configure.ac

@@ -1470,12 +1470,12 @@ AC_OUTPUT([
 	libstarpu1.0.pc
 	libstarpumpi.pc
 	libstarpumpi1.0.pc
+	starpufft/Makefile
+	starpufft/libstarpufft.pc
+	starpufft/libstarpufft1.0.pc
 	examples/Makefile
         examples/opt/Makefile
-	examples/starpufft/Makefile
 	examples/stencil/Makefile
-	examples/starpufft/libstarpufft.pc
-	examples/starpufft/libstarpufft1.0.pc
 	tests/Makefile
         tests/opt/Makefile
 	doc/Makefile

examples/starpufft/.gitignore → starpufft/.gitignore


+ 1 - 0
examples/starpufft/Makefile.am

@@ -87,6 +87,7 @@ test_LDADD = libstarpufft-@STARPU_EFFECTIVE_VERSION@.la $(top_builddir)/src/libs
 endif
 endif
 
+TESTS = $(check_PROGRAMS)
 
 
 #check_PROGRAMS += test_threads testf_threads

examples/starpufft/cuda_kernels.cu → starpufft/cuda_kernels.cu


examples/starpufft/cudaf_kernels.cu → starpufft/cudaf_kernels.cu


examples/starpufft/cudax_kernels.cu → starpufft/cudax_kernels.cu


examples/starpufft/cudax_kernels.h → starpufft/cudax_kernels.h


examples/starpufft/double.h → starpufft/double.h


examples/starpufft/float.h → starpufft/float.h


examples/starpufft/libstarpufft.pc.in → starpufft/libstarpufft.pc.in


examples/starpufft/libstarpufft1.0.pc.in → starpufft/libstarpufft1.0.pc.in


examples/starpufft/starpufft.c → starpufft/starpufft.c


examples/starpufft/starpufft.h → starpufft/starpufft.h


examples/starpufft/starpufft_common.c → starpufft/starpufft_common.c


examples/starpufft/starpufftf.c → starpufft/starpufftf.c


examples/starpufft/starpufftx.c → starpufft/starpufftx.c


examples/starpufft/starpufftx1d.c → starpufft/starpufftx1d.c


examples/starpufft/starpufftx2d.c → starpufft/starpufftx2d.c


examples/starpufft/test.c → starpufft/test.c


examples/starpufft/test_threads.c → starpufft/test_threads.c


examples/starpufft/testf.c → starpufft/testf.c


examples/starpufft/testf_threads.c → starpufft/testf_threads.c


+ 14 - 9
examples/starpufft/testx.c

@@ -63,10 +63,15 @@ static void check_fftw(STARPUFFT(complex) *out, STARPUFFT(complex) *out_fftw, in
 	fprintf(stderr, "relative maximum difference %g\n", relmaxdiff);
 	double relavgdiff = (tot / size) / sqrt(norm);
 	fprintf(stderr, "relative average difference %g\n", relavgdiff);
-	if (!strcmp(TYPE, "f") && (relmaxdiff > 1e-8 || relavgdiff > 1e-8))
+	if (!strcmp(TYPE, "f") && (relmaxdiff > 1e-8 || relavgdiff > 1e-8)) {
+		fprintf(stderr, "Failure: Difference too big (TYPE f)\n");
 		exit(EXIT_FAILURE);
+	}
 	if (!strcmp(TYPE, "") && (relmaxdiff > 1e-16 || relavgdiff > 1e-16))
+	{
+		fprintf(stderr, "Failure: Difference too big\n");
 		exit(EXIT_FAILURE);
+	}
 }
 #endif
 
@@ -119,16 +124,16 @@ int main(int argc, char *argv[])
 #endif
 	double timing;
 
-	if (argc < 2 || argc > 3)
-	{
-		fprintf(stderr,"need one or two size of vector\n");
-		exit(EXIT_FAILURE);
-	}
-
 	ret = starpu_init(NULL);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	if (argc == 2)
+	if (argc == 1)
+	{
+		n = 42;
+		/* 1D */
+		size = n;
+	}
+	else if (argc == 2)
 	{
 		n = atoi(argv[1]);
 
@@ -165,7 +170,7 @@ int main(int argc, char *argv[])
 	STARPUFFT(complex) *out_cuda = STARPUFFT(malloc)(size * sizeof(*out_cuda));
 #endif
 
-	if (argc == 2)
+	if (argc <= 2)
 	{
 		plan = STARPUFFT(plan_dft_1d)(n, SIGN, 0);
 #ifdef STARPU_HAVE_FFTW

examples/starpufft/testx_threads.c → starpufft/testx_threads.c