Commit 15a59c5f authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Debuging the CUDA linking.

parent 03332aa8
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ if( WITH_TEMPLATE_EXPLICIT_INSTANTIATION STREQUAL "yes" )
endif()   

if( WITH_CUDA STREQUAL "yes" )
   #AddCompilerFlag( "-DHAVE_NOT_CXX11 -U_GLIBCXX_ATOMIC_BUILTINS -U_GLIBCXX_USE_INT128 --relocatable-device-code=yes --device-c" )
   AddCompilerFlag( "-DHAVE_NOT_CXX11 -U_GLIBCXX_ATOMIC_BUILTINS -U_GLIBCXX_USE_INT128" )
else()
   AddCompilerFlag( "-std=gnu++0x" )
@@ -50,9 +49,8 @@ if( NOT WITH_CUDA STREQUAL "no" )
        set(BUILD_SHARED_LIBS ON)
        set(CUDA_SEPARABLE_COMPILATION ON)
        
        set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DHAVE_CUDA;--shared;--compiler-options -fPIC)
        set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DHAVE_CUDA)
        if( CUDA_ARCHITECTURE STREQUAL "2.0" )
            #set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-arch=compute_20;-code=sm_20;-DCUDA_ARCH=20)
            set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DCUDA_ARCH=20)            
        endif()    
        if( CUDA_ARCHITECTURE STREQUAL "2.1" )
+3 −4
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ set( tnl_CUDA__SOURCES ${tnl_generators_CUDA__SOURCES}
                 
if( BUILD_CUDA )
   CUDA_ADD_LIBRARY( tnl${debugExt}-${tnlVersion} SHARED ${tnl_CUDA__SOURCES}
                                                  OPTIONS -arch sm_20 )
                                                  OPTIONS -arch sm_20 -shared )
else( BUILD_CUDA )
   ADD_LIBRARY( tnl${debugExt}-${tnlVersion} SHARED 
                ${tnl_SOURCES} )
@@ -39,15 +39,14 @@ endif( BUILD_CUDA )
SET_TARGET_PROPERTIES( tnl${debugExt}-${tnlVersion} PROPERTIES 
                          SOVERSION 0 
                          VERSION ${tnlVersion} )
TARGET_LINK_LIBRARIES( tnl${debugExt}-${tnlVersion}  
                          ${BZIP2_LIBRARIES} )

INSTALL( TARGETS tnl${debugExt}-${tnlVersion} DESTINATION lib )

IF( BUILD_MPI )
   
   if( BUILD_CUDA )
      CUDA_ADD_LIBRARY( tnl-mpi${debugExt}-${tnlVersion} SHARED ${tnl_CUDA__SOURCES} 
                                                         OPTIONS -arch sm_20 )
                                                         OPTIONS -arch sm_20 -shared )
   else( BUILD_CUDA )
         ADD_LIBRARY( tnl-mpi${debugExt}-${tnlVersion} SHARED
                      ${tnl_SOURCES} )  
+2 −3
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@

#include <core/mfuncs.h>
#include <core/tnlAssert.h>
#include <legacy/core/tnlCudaSupport.h>
#include <core/tnlString.h>
#include <core/tnlObject.h>
#include <core/tnlHost.h>
@@ -212,7 +211,7 @@ bool tnlFile :: read( Type* buffer,
         {
            cerr << "Transfer of data from the CUDA device to the file " << this -> fileName
                 << " failed." << endl;
            checkCUDAError( __FILE__, __LINE__ );
            checkCudaDevice;
            free( host_buffer );
            return false;
         }
@@ -289,7 +288,7 @@ bool tnlFile :: write( const Type* buffer,
                            transfer * sizeof( Type ),
                            cudaMemcpyDeviceToHost ) != cudaSuccess )
            {
               checkCUDAError( __FILE__, __LINE__ );
               checkCudaDevice;
               cerr << "CUDA error." << endl;
               free( host_buffer );
               return false;
+0 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#ifndef TNLARRAYOPERATIONSHOST_IMPL_H_
#define TNLARRAYOPERATIONSHOST_IMPL_H_
#include <tnlConfig.h>
#include <core/tnlCuda.h>
#include <string.h>

template< typename Element, typename Index >