Loading src/core/arrays/tnlSharedArray.h +6 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,9 @@ class tnlHost; template< typename Element, typename Device, typename Index > class tnlArray; template< int Size, typename Element > class tnlStaticArray; template< typename Element, typename Device = tnlHost, typename Index = int > Loading @@ -46,6 +49,9 @@ class tnlSharedArray : public tnlObject void bind( tnlArray< Element, Device, Index >& array ); template< int Size > void bind( tnlStaticArray< Size, Element >& array ); void bind( tnlSharedArray< Element, Device, Index >& array ); void swap( tnlSharedArray< Element, Device, Index >& array ); Loading src/core/arrays/tnlStaticArray.h +39 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,16 @@ class tnlStaticArray #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ #endif Loading Loading @@ -130,6 +140,15 @@ class tnlStaticArray< 1, Element > #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ Loading Loading @@ -216,6 +235,16 @@ class tnlStaticArray< 2, Element > #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ #endif Loading Loading @@ -313,6 +342,16 @@ class tnlStaticArray< 3, Element > #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ #endif Loading src/implementation/core/arrays/tnlSharedArray_impl.h +13 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <iostream> #include <core/tnlFile.h> #include <core/arrays/tnlArray.h> #include <core/arrays/tnlStaticArray.h> #include <core/arrays/tnlArrayOperations.h> #include <core/mfuncs.h> #include <core/param-types.h> Loading Loading @@ -73,6 +74,16 @@ void tnlSharedArray< Element, Device, Index > :: bind( tnlArray< Element, Device this->data = array. getData(); }; template< typename Element, typename Device, typename Index > template< int Size > void tnlSharedArray< Element, Device, Index >::bind( tnlStaticArray< Size, Element >& array ) { this->size = Size; this->data = array.getData(); } template< typename Element, typename Device, typename Index > Loading src/implementation/core/arrays/tnlStaticArray1D_impl.h +18 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,24 @@ int tnlStaticArray< 1, Element >::getSize() const return size; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > Element* tnlStaticArray< 1, Element >::getData() { return data; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > const Element* tnlStaticArray< 1, Element >::getData() const { return data; } template< typename Element > #ifdef HAVE_CUDA __host__ __device__ Loading src/implementation/core/arrays/tnlStaticArray2D_impl.h +18 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,24 @@ int tnlStaticArray< 2, Element >::getSize() const return size; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > Element* tnlStaticArray< 2, Element >::getData() { return data; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > const Element* tnlStaticArray< 2, Element >::getData() const { return data; } template< typename Element > #ifdef HAVE_CUDA __host__ __device__ Loading Loading
src/core/arrays/tnlSharedArray.h +6 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,9 @@ class tnlHost; template< typename Element, typename Device, typename Index > class tnlArray; template< int Size, typename Element > class tnlStaticArray; template< typename Element, typename Device = tnlHost, typename Index = int > Loading @@ -46,6 +49,9 @@ class tnlSharedArray : public tnlObject void bind( tnlArray< Element, Device, Index >& array ); template< int Size > void bind( tnlStaticArray< Size, Element >& array ); void bind( tnlSharedArray< Element, Device, Index >& array ); void swap( tnlSharedArray< Element, Device, Index >& array ); Loading
src/core/arrays/tnlStaticArray.h +39 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,16 @@ class tnlStaticArray #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ #endif Loading Loading @@ -130,6 +140,15 @@ class tnlStaticArray< 1, Element > #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ Loading Loading @@ -216,6 +235,16 @@ class tnlStaticArray< 2, Element > #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ #endif Loading Loading @@ -313,6 +342,16 @@ class tnlStaticArray< 3, Element > #endif int getSize() const; #ifdef HAVE_CUDA __host__ __device__ #endif Element* getData(); #ifdef HAVE_CUDA __host__ __device__ #endif const Element* getData() const; #ifdef HAVE_CUDA __host__ __device__ #endif Loading
src/implementation/core/arrays/tnlSharedArray_impl.h +13 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <iostream> #include <core/tnlFile.h> #include <core/arrays/tnlArray.h> #include <core/arrays/tnlStaticArray.h> #include <core/arrays/tnlArrayOperations.h> #include <core/mfuncs.h> #include <core/param-types.h> Loading Loading @@ -73,6 +74,16 @@ void tnlSharedArray< Element, Device, Index > :: bind( tnlArray< Element, Device this->data = array. getData(); }; template< typename Element, typename Device, typename Index > template< int Size > void tnlSharedArray< Element, Device, Index >::bind( tnlStaticArray< Size, Element >& array ) { this->size = Size; this->data = array.getData(); } template< typename Element, typename Device, typename Index > Loading
src/implementation/core/arrays/tnlStaticArray1D_impl.h +18 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,24 @@ int tnlStaticArray< 1, Element >::getSize() const return size; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > Element* tnlStaticArray< 1, Element >::getData() { return data; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > const Element* tnlStaticArray< 1, Element >::getData() const { return data; } template< typename Element > #ifdef HAVE_CUDA __host__ __device__ Loading
src/implementation/core/arrays/tnlStaticArray2D_impl.h +18 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,24 @@ int tnlStaticArray< 2, Element >::getSize() const return size; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > Element* tnlStaticArray< 2, Element >::getData() { return data; } #ifdef HAVE_CUDA __host__ __device__ #endif template< typename Element > const Element* tnlStaticArray< 2, Element >::getData() const { return data; } template< typename Element > #ifdef HAVE_CUDA __host__ __device__ Loading