Commit 530d7bd0 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Added test for data transfer for tnlLongVectorCUDA.

Working on problem with .cu files compilation.
parent 670a3854
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -19,5 +19,4 @@ if BUILD_DBG
   pkgconfig_DATA += libtnl-dbg-$(VERSION).pc
endif


EXTRA_DIST = TODO create-config-description-parser
EXTRA_DIST = TODO create-config-description-parser cuda.mk
+27 −5
Original line number Diff line number Diff line
@@ -56,9 +56,7 @@ AC_ARG_WITH(cuda_libdir,
if test x$with_cuda = xyes;
then
  
   AC_CHECK_PROG(cuda,nvcc,"yes","no")
   NVCC="nvcc"
   AC_SUBST(NVCC)
   
   STORE_CXXFLAGS=$CXXFLAGS
   STORE_CPPFLAGS=$CPPFLAGS
   STORE_LDFLAGS=$LDFLAGS
@@ -80,7 +78,31 @@ then
   then
      AC_CHECK_LIB(cudart,cudaMalloc,HAVE_CUDA="yes",HAVE_CUDA="no")
   fi
   if test x$HAVE_CUDA = xyes;
   AC_CHECK_PROG(cuda,nvcc,"yes","no")
   AC_ARG_VAR([NVCC], [nvcc compiler to use])
   AC_PATH_PROG([NVCC], [nvcc], [no])
   working_nvcc=no
   if test "x$NVCC" != "xno";
   then
      AC_MSG_CHECKING([whether nvcc works])
      echo "" >> conftest.cu
      echo " __global__ void test_cuda() { " >> conftest.cu
      echo "  const int tid = threadIdx.x; " >> conftest.cu
      echo "  const int bid = blockIdx.x; " >> conftest.cu
      echo " __syncthreads(); " >> conftest.cu
      echo " }" >> conftest.cu
      
      if $NVCC $CXXFLAGS conftest.cu > /dev/null 2>&1 && test_whether_output_files_are_ok;
      then
         working_nvcc=yes
         AC_SUBST(NVCC)
      fi
      rm -f conftest.cu conftest.o conftest.what conftest.ever
      AC_MSG_RESULT([$working_nvcc])
   fi
   AM_CONDITIONAL([WORKING_NVCC], [test "x$working_nvcc" = "xyes"])
   
   if test x$HAVE_CUDA = xyes; # TODO: && test x$working_nvcc = xyes;
   then
      CUDA_LDFLAGS="$CUDA_LDFLAGS -lcudart"
   else

cuda.mk

0 → 100644
+3 −0
Original line number Diff line number Diff line
SUFFIXES = .cu
.cu.$(OBJEXT):
	$(NVCC) -c $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $ (CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -o $@ $<
 No newline at end of file
+6 −2
Original line number Diff line number Diff line
@@ -5,6 +5,10 @@ SUBDIRS = core \
          diff \
	       matrix



include  ${top_srcdir}/cuda.mk

lib_LTLIBRARIES = libtnl-0.1.la
libtnl_0_1_la_SOURCES =
# Dummy C++ source to cause C++ linking.
+8 −1
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@
#SUBDIRS = 
#endif

include  ${top_srcdir}/cuda.mk

EXTRA_DIST = tnlConfigDescriptionParser.y \
	         tnlConfigDescriptionScanner.l \
	         FlexLexer.h
@@ -87,11 +89,16 @@ libcore_tests_sources = tnlStringTester.cpp \
                        tnlStringTester.h \
                        tnlObjectTester.cpp \
                        tnlObjectTester.h \
                        tnlLongVectorCUDATester.cpp \
                        tnlLongVectorCUDATester.h
                        
#libcore_tests_objects = tnlLongVectorCUDATester.cpp



check_LTLIBRARIES = libcore-tests.la
libcore_tests_la_SOURCES = $(libcore_tests_sources)
#$(libcore_tests_la_OBJECTS) : $(libcore_tests_objects)

if BUILD_DBG
noinst_LTLIBRARIES += libcore-tests-dbg.la
Loading