Loading Documentation/Examples/ObjectExample_getType.cpp +7 −20 Original line number Diff line number Diff line #include <iostream> #include <TNL/param-types.h> #include <TNL/TypeInfo.h> #include <TNL/Object.h> #include <TNL/Devices/Host.h> #include <TNL/Devices/Cuda.h> Loading @@ -13,24 +13,12 @@ class MyArray : public Object { public: using HostType = MyArray< Value, Devices::Host >; static String getType() { return "MyArray< " + TNL::getType< Value >() + ", " + TNL::getType< Device >() + " >"; } String getTypeVirtual() const { return getType(); } static String getSerializationType() { return HostType::getType(); return "MyArray< " + TNL::getType< Value >() + ", " + getType< Devices::Host >() + " >"; } String getSerializationTypeVirtual() const virtual String getSerializationTypeVirtual() const override { return getSerializationType(); } Loading @@ -47,11 +35,11 @@ int main() Object* cudaArrayPtr = &cudaArray; // Object types cout << "HostArray type is " << HostArray::getType() << endl; cout << "hostArrayPtr type is " << hostArrayPtr->getTypeVirtual() << endl; cout << "HostArray type is " << getType< HostArray >() << endl; cout << "hostArrayPtr type is " << getType( *hostArrayPtr ) << endl; cout << "CudaArray type is " << CudaArray::getType() << endl; cout << "cudaArrayPtr type is " << cudaArrayPtr->getTypeVirtual() << endl; cout << "CudaArray type is " << getType< CudaArray >() << endl; cout << "cudaArrayPtr type is " << getType( *cudaArrayPtr ) << endl; // Object serialization types cout << "HostArray serialization type is " << HostArray::getSerializationType() << endl; Loading @@ -60,4 +48,3 @@ int main() cout << "CudaArray serialization type is " << CudaArray::getSerializationType() << endl; cout << "cudaArrayPtr serialization type is " << cudaArrayPtr->getSerializationTypeVirtual() << endl; } src/Benchmarks/BLAS/spmv.h +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ benchmarkSpMV( Benchmark & benchmark, CudaVector deviceVector, deviceVector2; // create benchmark group const std::vector< String > parsedType = parseObjectType( HostMatrix::getType() ); const std::vector< String > parsedType = parseObjectType( getType< HostMatrix >() ); #ifdef HAVE_CUDA benchmark.createHorizontalGroup( parsedType[ 0 ], 2 ); #else Loading src/Benchmarks/HeatEquation/BenchmarkLaplace.h +0 −6 Original line number Diff line number Diff line Loading @@ -33,8 +33,6 @@ class BenchmarkLaplace< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, Real, In typedef Functions::MeshFunction< MeshType > MeshFunctionType; enum { Dimension = MeshType::getMeshDimension() }; static String getType(); template< typename MeshFunction, typename MeshEntity > __cuda_callable__ Real operator()( const MeshFunction& u, Loading Loading @@ -81,8 +79,6 @@ class BenchmarkLaplace< Meshes::Grid< 2,MeshReal, Device, MeshIndex >, Real, Ind typedef Functions::MeshFunction< MeshType > MeshFunctionType; enum { Dimension = MeshType::getMeshDimension() }; static String getType(); template< typename MeshFunction, typename MeshEntity > __cuda_callable__ Real operator()( const MeshFunction& u, Loading Loading @@ -144,8 +140,6 @@ class BenchmarkLaplace< Meshes::Grid< 3,MeshReal, Device, MeshIndex >, Real, Ind typedef Functions::MeshFunction< MeshType > MeshFunctionType; enum { Dimension = MeshType::getMeshDimension() }; static String getType(); template< typename MeshFunction, typename MeshEntity > __cuda_callable__ Real operator()( const MeshFunction& u, Loading src/Benchmarks/HeatEquation/BenchmarkLaplace_impl.h +0 −45 Original line number Diff line number Diff line Loading @@ -4,21 +4,6 @@ /**** * 1D problem */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, typename Index > String BenchmarkLaplace< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, Real, Index >:: getType() { return String( "BenchmarkLaplace< " ) + MeshType::getType() + ", " + TNL::getType< Real >() + ", " + TNL::getType< Index >() + " >"; } template< typename MeshReal, typename Device, typename MeshIndex, Loading Loading @@ -108,21 +93,6 @@ setMatrixElements( const RealType& time, /**** * 2D problem */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, typename Index > String BenchmarkLaplace< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, Real, Index >:: getType() { return String( "BenchmarkLaplace< " ) + MeshType::getType() + ", " + TNL::getType< Real >() + ", " + TNL::getType< Index >() + " >"; } template< typename MeshReal, typename Device, typename MeshIndex, Loading Loading @@ -288,21 +258,6 @@ setMatrixElements( const RealType& time, /**** * 3D problem */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, typename Index > String BenchmarkLaplace< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, Real, Index >:: getType() { return String( "BenchmarkLaplace< " ) + MeshType::getType() + ", " + TNL::getType< Real >() + ", " + TNL::getType< Index >() + " >"; } template< typename MeshReal, typename Device, typename MeshIndex, Loading src/Benchmarks/HeatEquation/HeatEquationBenchmarkProblem.h +0 −2 Original line number Diff line number Diff line Loading @@ -41,8 +41,6 @@ class HeatEquationBenchmarkProblem: HeatEquationBenchmarkProblem(); static String getType(); String getPrologHeader() const; void writeProlog( Logger& logger, Loading Loading
Documentation/Examples/ObjectExample_getType.cpp +7 −20 Original line number Diff line number Diff line #include <iostream> #include <TNL/param-types.h> #include <TNL/TypeInfo.h> #include <TNL/Object.h> #include <TNL/Devices/Host.h> #include <TNL/Devices/Cuda.h> Loading @@ -13,24 +13,12 @@ class MyArray : public Object { public: using HostType = MyArray< Value, Devices::Host >; static String getType() { return "MyArray< " + TNL::getType< Value >() + ", " + TNL::getType< Device >() + " >"; } String getTypeVirtual() const { return getType(); } static String getSerializationType() { return HostType::getType(); return "MyArray< " + TNL::getType< Value >() + ", " + getType< Devices::Host >() + " >"; } String getSerializationTypeVirtual() const virtual String getSerializationTypeVirtual() const override { return getSerializationType(); } Loading @@ -47,11 +35,11 @@ int main() Object* cudaArrayPtr = &cudaArray; // Object types cout << "HostArray type is " << HostArray::getType() << endl; cout << "hostArrayPtr type is " << hostArrayPtr->getTypeVirtual() << endl; cout << "HostArray type is " << getType< HostArray >() << endl; cout << "hostArrayPtr type is " << getType( *hostArrayPtr ) << endl; cout << "CudaArray type is " << CudaArray::getType() << endl; cout << "cudaArrayPtr type is " << cudaArrayPtr->getTypeVirtual() << endl; cout << "CudaArray type is " << getType< CudaArray >() << endl; cout << "cudaArrayPtr type is " << getType( *cudaArrayPtr ) << endl; // Object serialization types cout << "HostArray serialization type is " << HostArray::getSerializationType() << endl; Loading @@ -60,4 +48,3 @@ int main() cout << "CudaArray serialization type is " << CudaArray::getSerializationType() << endl; cout << "cudaArrayPtr serialization type is " << cudaArrayPtr->getSerializationTypeVirtual() << endl; }
src/Benchmarks/BLAS/spmv.h +1 −1 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ benchmarkSpMV( Benchmark & benchmark, CudaVector deviceVector, deviceVector2; // create benchmark group const std::vector< String > parsedType = parseObjectType( HostMatrix::getType() ); const std::vector< String > parsedType = parseObjectType( getType< HostMatrix >() ); #ifdef HAVE_CUDA benchmark.createHorizontalGroup( parsedType[ 0 ], 2 ); #else Loading
src/Benchmarks/HeatEquation/BenchmarkLaplace.h +0 −6 Original line number Diff line number Diff line Loading @@ -33,8 +33,6 @@ class BenchmarkLaplace< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, Real, In typedef Functions::MeshFunction< MeshType > MeshFunctionType; enum { Dimension = MeshType::getMeshDimension() }; static String getType(); template< typename MeshFunction, typename MeshEntity > __cuda_callable__ Real operator()( const MeshFunction& u, Loading Loading @@ -81,8 +79,6 @@ class BenchmarkLaplace< Meshes::Grid< 2,MeshReal, Device, MeshIndex >, Real, Ind typedef Functions::MeshFunction< MeshType > MeshFunctionType; enum { Dimension = MeshType::getMeshDimension() }; static String getType(); template< typename MeshFunction, typename MeshEntity > __cuda_callable__ Real operator()( const MeshFunction& u, Loading Loading @@ -144,8 +140,6 @@ class BenchmarkLaplace< Meshes::Grid< 3,MeshReal, Device, MeshIndex >, Real, Ind typedef Functions::MeshFunction< MeshType > MeshFunctionType; enum { Dimension = MeshType::getMeshDimension() }; static String getType(); template< typename MeshFunction, typename MeshEntity > __cuda_callable__ Real operator()( const MeshFunction& u, Loading
src/Benchmarks/HeatEquation/BenchmarkLaplace_impl.h +0 −45 Original line number Diff line number Diff line Loading @@ -4,21 +4,6 @@ /**** * 1D problem */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, typename Index > String BenchmarkLaplace< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, Real, Index >:: getType() { return String( "BenchmarkLaplace< " ) + MeshType::getType() + ", " + TNL::getType< Real >() + ", " + TNL::getType< Index >() + " >"; } template< typename MeshReal, typename Device, typename MeshIndex, Loading Loading @@ -108,21 +93,6 @@ setMatrixElements( const RealType& time, /**** * 2D problem */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, typename Index > String BenchmarkLaplace< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, Real, Index >:: getType() { return String( "BenchmarkLaplace< " ) + MeshType::getType() + ", " + TNL::getType< Real >() + ", " + TNL::getType< Index >() + " >"; } template< typename MeshReal, typename Device, typename MeshIndex, Loading Loading @@ -288,21 +258,6 @@ setMatrixElements( const RealType& time, /**** * 3D problem */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, typename Index > String BenchmarkLaplace< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, Real, Index >:: getType() { return String( "BenchmarkLaplace< " ) + MeshType::getType() + ", " + TNL::getType< Real >() + ", " + TNL::getType< Index >() + " >"; } template< typename MeshReal, typename Device, typename MeshIndex, Loading
src/Benchmarks/HeatEquation/HeatEquationBenchmarkProblem.h +0 −2 Original line number Diff line number Diff line Loading @@ -41,8 +41,6 @@ class HeatEquationBenchmarkProblem: HeatEquationBenchmarkProblem(); static String getType(); String getPrologHeader() const; void writeProlog( Logger& logger, Loading