Commit 15dc3870 authored by Vít Hanousek's avatar Vít Hanousek
Browse files

Neurčity stav, kdy bylo hotové tnlArray a začal jsem pracovat na tnlvector,...

Neurčity stav, kdy  bylo hotové tnlArray a začal jsem pracovat na tnlvector, ale zjistil jsemm, že nejde přeložit znovu celý projekt. toto je jen záloha pro návrat.
parent 8ebe5966
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ endif()
# set Debug/Release options
set( CMAKE_CXX_FLAGS "-std=c++11" )
set( CMAKE_CXX_FLAGS_DEBUG "-g" )
set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG" )
set( CMAKE_CXX_FLAGS_RELEASE "-O0 -march=native -DNDEBUG" )
#set( CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG -ftree-vectorizer-verbose=1 -ftree-vectorize -fopt-info-vec-missed -funroll-loops" )
# pass -rdynamic only in Debug mode
set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "" )
@@ -54,7 +54,7 @@ set( CMAKE_SHARED_LIBRARY_LINK_C_FLAGS_RELEASE "" )
get_filename_component( CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME )
if( CXX_COMPILER_NAME MATCHES "icpc" )
   message( "Intel compiler detected..."    )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ICPC ")
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_ICPC -ww2568 -wd2571")	
endif()

#####
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ WITH_TESTS="yes"

WITH_CUDA_ARCH="auto"
WITH_CUBLAS="no"
WITH_TEMPLATE_INSTANTIATION="yes"
WITH_TEMPLATE_INSTANTIATION="no"
INSTANTIATE_LONG_INT="no"
INSTANTIATE_INT="yes"
INSTANTIATE_LONG_DOUBLE="no"
+1 −0
Original line number Diff line number Diff line
@@ -187,5 +187,6 @@ template< typename Element, typename Device, typename Index >
ostream& operator << ( ostream& str, const tnlArray< Element, Device, Index >& v );

#include <core/arrays/tnlArray_impl.h>
//#include <core/arrays/tnlArrayMIC_impl.h>

#endif /* TNLARRAY_H_ */
+75 −74
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include <core/tnlString.h>
#include <core/tnlFile.h>
#include <core/tnlDevice_Callable.h>

//! Aliases for the coordinates
// TODO: Remove this - it is here only because of some legact code
@@ -33,57 +34,57 @@ class tnlStaticArray
   typedef int     IndexType;
   enum { size = Size };

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray();

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element v[ Size ] );

   //! This sets all vector components to v
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element& v );

   //! Copy constructor
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const tnlStaticArray< Size, Element >& v );

   static tnlString getType();

   __cuda_callable__
   __device_callable__
   inline int getSize() const;

   __cuda_callable__
   __device_callable__
   inline Element* getData();

   __cuda_callable__
   __device_callable__
   inline const Element* getData() const;

   __cuda_callable__
   __device_callable__
   inline const Element& operator[]( int i ) const;

   __cuda_callable__
   __device_callable__
   inline Element& operator[]( int i );

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< Size, Element >& operator = ( const tnlStaticArray< Size, Element >& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< Size, Element >& operator = ( const Array& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator == ( const Array& array ) const;

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator != ( const Array& array ) const;
         
   template< typename OtherElement >
   __cuda_callable__
   __device_callable__
   operator tnlStaticArray< Size, OtherElement >() const;

   __cuda_callable__
   __device_callable__
   inline void setValue( const ElementType& val );

   bool save( tnlFile& file ) const;
@@ -107,64 +108,64 @@ class tnlStaticArray< 1, Element >
   typedef int     IndexType;
   enum { size = 1 };

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray();

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element v[ size ] );

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element& v );

   //! Copy constructor
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const tnlStaticArray< size, Element >& v );

   static tnlString getType();

   __cuda_callable__
   __device_callable__
   inline int getSize() const;

   __cuda_callable__
   __device_callable__
   inline Element* getData();

   __cuda_callable__
   __device_callable__
   inline const Element* getData() const;

   __cuda_callable__
   __device_callable__
   inline const Element& operator[]( int i ) const;

   __cuda_callable__
   __device_callable__
   inline Element& operator[]( int i );

   //! Returns the first coordinate
   __cuda_callable__
   __device_callable__
   inline Element& x();

   //! Returns the first coordinate
   __cuda_callable__
   __device_callable__
   inline const Element& x() const;

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< 1, Element >& operator = ( const tnlStaticArray< 1, Element >& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< 1, Element >& operator = ( const Array& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator == ( const Array& array ) const;

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator != ( const Array& array ) const;
   
   template< typename OtherElement >
   __cuda_callable__
   __device_callable__
   operator tnlStaticArray< 1, OtherElement >() const;   

   __cuda_callable__
   __device_callable__
   inline
   void setValue( const ElementType& val );

@@ -188,76 +189,76 @@ class tnlStaticArray< 2, Element >
   typedef int     IndexType;
   enum { size = 2 };

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray();

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element v[ size ] );

   //! This sets all vector components to v
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element& v );

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element& v1, const Element& v2 );

   //! Copy constructor
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const tnlStaticArray< size, Element >& v );

   static tnlString getType();

   __cuda_callable__
   __device_callable__
   inline int getSize() const;

   __cuda_callable__
   __device_callable__
   inline Element* getData();

   __cuda_callable__
   __device_callable__
   inline const Element* getData() const;

   __cuda_callable__
   __device_callable__
   inline const Element& operator[]( int i ) const;

   __cuda_callable__
   __device_callable__
   inline Element& operator[]( int i );

   //! Returns the first coordinate
   __cuda_callable__
   __device_callable__
   inline Element& x();

   //! Returns the first coordinate
   __cuda_callable__
   __device_callable__
   inline const Element& x() const;

   //! Returns the second coordinate
   __cuda_callable__
   __device_callable__
   inline Element& y();

   //! Returns the second coordinate
   __cuda_callable__
   __device_callable__
   inline const Element& y() const;

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< 2, Element >& operator = ( const tnlStaticArray< 2, Element >& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< 2, Element >& operator = ( const Array& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator == ( const Array& array ) const;

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator != ( const Array& array ) const;
   
   template< typename OtherElement >
   __cuda_callable__
   __device_callable__
   operator tnlStaticArray< 2, OtherElement >() const;   
   
   __cuda_callable__
   __device_callable__
   inline void setValue( const ElementType& val );

   bool save( tnlFile& file ) const;
@@ -280,84 +281,84 @@ class tnlStaticArray< 3, Element >
   typedef int     IndexType;
   enum { size = 3 };

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray();

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element v[ size ] );

   //! This sets all vector components to v
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element& v );

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const Element& v1, const Element& v2, const Element& v3 );

   //! Copy constructor
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray( const tnlStaticArray< size, Element >& v );

   static tnlString getType();

   __cuda_callable__
   __device_callable__
   inline int getSize() const;

   __cuda_callable__
   __device_callable__
   inline Element* getData();

   __cuda_callable__
   __device_callable__
   inline const Element* getData() const;

   __cuda_callable__
   __device_callable__
   inline const Element& operator[]( int i ) const;

   __cuda_callable__
   __device_callable__
   inline Element& operator[]( int i );

   //! Returns the first coordinate
   __cuda_callable__
   __device_callable__
   inline Element& x();

   //! Returns the first coordinate
   __cuda_callable__
   __device_callable__
   inline const Element& x() const;

   //! Returns the second coordinate
   __cuda_callable__
   __device_callable__
   inline Element& y();

   //! Returns the second coordinate
   __cuda_callable__
   __device_callable__
   inline const Element& y() const;

   //! Returns the third coordinate
   __cuda_callable__
   __device_callable__
   inline Element& z();

   //! Returns the third coordinate
   __cuda_callable__
   __device_callable__
   inline const Element& z() const;

   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< 3, Element >& operator = ( const tnlStaticArray< 3, Element >& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline tnlStaticArray< 3, Element >& operator = ( const Array& array );

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator == ( const Array& array ) const;

   template< typename Array >
   __cuda_callable__
   __device_callable__
   inline bool operator != ( const Array& array ) const;
   
   template< typename OtherElement >
   __cuda_callable__
   __device_callable__
   operator tnlStaticArray< 3, OtherElement >() const;

   __cuda_callable__
   __device_callable__
   inline void setValue( const ElementType& val );

   bool save( tnlFile& file ) const;
+15 −15
Original line number Diff line number Diff line
@@ -21,13 +21,13 @@
#include <core/param-types.h>

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline tnlStaticArray< Size, Element >::tnlStaticArray()
{
};

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline tnlStaticArray< Size, Element >::tnlStaticArray( const Element v[ Size ] )
{
   for( int i = 0; i < Size; i++ )
@@ -35,7 +35,7 @@ inline tnlStaticArray< Size, Element >::tnlStaticArray( const Element v[ Size ]
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline tnlStaticArray< Size, Element >::tnlStaticArray( const Element& v )
{
   for( int i = 0; i < Size; i++ )
@@ -43,7 +43,7 @@ inline tnlStaticArray< Size, Element >::tnlStaticArray( const Element& v )
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline tnlStaticArray< Size, Element >::tnlStaticArray( const tnlStaticArray< Size, Element >& v )
{
   for( int i = 0; i < Size; i++ )
@@ -61,28 +61,28 @@ tnlString tnlStaticArray< Size, Element >::getType()
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline int tnlStaticArray< Size, Element >::getSize() const
{
   return size;
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline Element* tnlStaticArray< Size, Element >::getData()
{
   return data;
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline const Element* tnlStaticArray< Size, Element >::getData() const
{
   return data;
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline const Element& tnlStaticArray< Size, Element >::operator[]( int i ) const
{
   tnlAssert( i >= 0 && i < size,
@@ -91,7 +91,7 @@ inline const Element& tnlStaticArray< Size, Element >::operator[]( int i ) const
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline Element& tnlStaticArray< Size, Element >::operator[]( int i )
{
   tnlAssert( i >= 0 && i < size,
@@ -100,7 +100,7 @@ inline Element& tnlStaticArray< Size, Element >::operator[]( int i )
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline tnlStaticArray< Size, Element >& tnlStaticArray< Size, Element >::operator = ( const tnlStaticArray< Size, Element >& array )
{
   for( int i = 0; i < size; i++ )
@@ -110,7 +110,7 @@ inline tnlStaticArray< Size, Element >& tnlStaticArray< Size, Element >::operato

template< int Size, typename Element >
   template< typename Array >
__cuda_callable__
__device_callable__
inline tnlStaticArray< Size, Element >& tnlStaticArray< Size, Element >::operator = ( const Array& array )
{
   for( int i = 0; i < size; i++ )
@@ -120,7 +120,7 @@ inline tnlStaticArray< Size, Element >& tnlStaticArray< Size, Element >::operato

template< int Size, typename Element >
   template< typename Array >
__cuda_callable__
__device_callable__
inline bool tnlStaticArray< Size, Element >::operator == ( const Array& array ) const
{
   if( ( int ) size != ( int ) Array::size )
@@ -133,7 +133,7 @@ inline bool tnlStaticArray< Size, Element >::operator == ( const Array& array )

template< int Size, typename Element >
   template< typename Array >
__cuda_callable__
__device_callable__
inline bool tnlStaticArray< Size, Element >::operator != ( const Array& array ) const
{
   return ! this->operator == ( array );
@@ -141,7 +141,7 @@ inline bool tnlStaticArray< Size, Element >::operator != ( const Array& array )

template< int Size, typename Element >
   template< typename OtherElement >
__cuda_callable__
__device_callable__
tnlStaticArray< Size, Element >::
operator tnlStaticArray< Size, OtherElement >() const
{
@@ -152,7 +152,7 @@ operator tnlStaticArray< Size, OtherElement >() const
}

template< int Size, typename Element >
__cuda_callable__
__device_callable__
inline void tnlStaticArray< Size, Element >::setValue( const ElementType& val )
{
   for( int i = 0; i < Size; i++ )
Loading