From eb4c6cb618bf272d3af24ef0e42edcdc73b7626f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Hanousek=20-=20bara?= <vithanousek@seznam.cz> Date: Tue, 24 May 2016 14:45:54 +0200 Subject: [PATCH] =?UTF-8?q?Nyni=20lze=20p=C5=99elo=C5=BEit=20cel=C3=A9=20T?= =?UTF-8?q?NL=20s=20ICPC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netbeans_run_debug_satanexperimental.sh | 2 +- src/core/arrays/tnlStaticArray.h | 4 ++-- src/core/arrays/tnlStaticArray1D_impl.h | 1 + src/core/arrays/tnlStaticArray2D_impl.h | 1 + src/core/arrays/tnlStaticArray3D_impl.h | 1 + src/core/arrays/tnlStaticArray_impl.h | 2 ++ src/core/tnlAssert.h | 3 +-- src/core/tnlDevice_Callable.h | 12 ++++++++---- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/netbeans_run_debug_satanexperimental.sh b/netbeans_run_debug_satanexperimental.sh index 3c5339bf1c..59ce5f99c1 100755 --- a/netbeans_run_debug_satanexperimental.sh +++ b/netbeans_run_debug_satanexperimental.sh @@ -66,7 +66,7 @@ mv ./initial.tnl init.tnl --discrete-solver euler \ --snapshot-period 0.0005 \ --final-time 0.1 \ - --time-step 0.000001 + --time-step 0.00005 ./tnl-view-dbg --mesh mesh.tnl \ --input-files *.tnl \ diff --git a/src/core/arrays/tnlStaticArray.h b/src/core/arrays/tnlStaticArray.h index cb6d83e24f..92d1429db5 100644 --- a/src/core/arrays/tnlStaticArray.h +++ b/src/core/arrays/tnlStaticArray.h @@ -374,9 +374,9 @@ class tnlStaticArray< 3, Element > }; -template< int Size, typename Element > +/*template< int Size, typename Element > ostream& operator << ( ostream& str, const tnlStaticArray< Size, Element >& a ); - +*/ #include <core/arrays/tnlStaticArray_impl.h> #include <core/arrays/tnlStaticArray1D_impl.h> #include <core/arrays/tnlStaticArray2D_impl.h> diff --git a/src/core/arrays/tnlStaticArray1D_impl.h b/src/core/arrays/tnlStaticArray1D_impl.h index fc6c17b8e2..2be7721fb6 100644 --- a/src/core/arrays/tnlStaticArray1D_impl.h +++ b/src/core/arrays/tnlStaticArray1D_impl.h @@ -194,6 +194,7 @@ void tnlStaticArray< 1, Element >::sort() } template< typename Element > +__device_callable__ ostream& tnlStaticArray< 1, Element >::write( ostream& str, const char* separator ) const { str << data[ 0 ]; diff --git a/src/core/arrays/tnlStaticArray2D_impl.h b/src/core/arrays/tnlStaticArray2D_impl.h index f7194dd8a3..0529026bf0 100644 --- a/src/core/arrays/tnlStaticArray2D_impl.h +++ b/src/core/arrays/tnlStaticArray2D_impl.h @@ -221,6 +221,7 @@ void tnlStaticArray< 2, Element >::sort() } template< typename Element > +__device_callable__ ostream& tnlStaticArray< 2, Element >::write( ostream& str, const char* separator ) const { str << data[ 0 ] << separator << data[ 1 ]; diff --git a/src/core/arrays/tnlStaticArray3D_impl.h b/src/core/arrays/tnlStaticArray3D_impl.h index b663fd24e2..013fd1b2c2 100644 --- a/src/core/arrays/tnlStaticArray3D_impl.h +++ b/src/core/arrays/tnlStaticArray3D_impl.h @@ -248,6 +248,7 @@ void tnlStaticArray< 3, Element >::sort() } template< typename Element > +__device_callable__ ostream& tnlStaticArray< 3, Element >::write( ostream& str, const char* separator ) const { str << data[ 0 ] << separator << data[ 1 ] << separator << data[ 2 ]; diff --git a/src/core/arrays/tnlStaticArray_impl.h b/src/core/arrays/tnlStaticArray_impl.h index fd613042e6..1714b3a83a 100644 --- a/src/core/arrays/tnlStaticArray_impl.h +++ b/src/core/arrays/tnlStaticArray_impl.h @@ -195,6 +195,7 @@ void tnlStaticArray< Size, Element >::sort() } template< int Size, typename Element > +__device_callable__ ostream& tnlStaticArray< Size, Element >::write( ostream& str, const char* separator ) const { for( int i = 0; i < Size - 1; i++ ) @@ -205,6 +206,7 @@ ostream& tnlStaticArray< Size, Element >::write( ostream& str, const char* separ template< int Size, typename Element > +__device_callable__ ostream& operator << ( ostream& str, const tnlStaticArray< Size, Element >& a ) { a.write( str, "," ); diff --git a/src/core/tnlAssert.h b/src/core/tnlAssert.h index 64c79512a5..78b3dd2509 100644 --- a/src/core/tnlAssert.h +++ b/src/core/tnlAssert.h @@ -22,8 +22,6 @@ * Debugging assert */ -#define NDEBUG - #ifndef NDEBUG @@ -65,6 +63,7 @@ ___tnl__assert_command; \ throw EXIT_FAILURE; \ } + #endif /* HAVE_CUDA */ #else /* #ifndef NDEBUG */ #define tnlAssert( ___tnl__assert_condition, ___tnl__assert_command ) diff --git a/src/core/tnlDevice_Callable.h b/src/core/tnlDevice_Callable.h index e8fee71d8e..c2db6dd56e 100644 --- a/src/core/tnlDevice_Callable.h +++ b/src/core/tnlDevice_Callable.h @@ -20,18 +20,22 @@ #else #define __cuda_callable__ #endif +*/ -//NEW, better __device_callable__ --used only with MIC touch code +//NEW, not implemented yet #ifdef HAVE_MIC #define __device_callable__ __attribute__((target(mic))) + #define __cuda_callable__ __attribute__((target(mic))) #elif HAVE_CUDA #define __device_callable__ __device__ __host__ + #define __cuda_callable__ __device__ __host__ #else #define __device_callable__ + #define __cuda_callable__ #endif -*/ -#define __cuda_callable__ __attribute__((target(mic))) -#define __device_callable__ __attribute__((target(mic))) + +//#define __cuda_callable__ __attribute__((target(mic))) +//#define __device_callable__ __attribute__((target(mic))) #endif /* TNLDEVICE_CALLABLE_H */ -- GitLab