Commit b8cfa773 authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

header guard uniformization

parent ad4bd273
......@@ -26,7 +26,7 @@ template<class S> using ARNOLDI_IBDR = ArnoldiIBDR<HessIBDR, S>;
#ifdef FABULOUS_USE_CHAMELEON
template<class S> using ARNOLDI_CHAM_QR = ArnoldiDR<HessChamQR, S>;
template<class S> using ARNOLDI_CHAM_TL = ArnoldiDR<HessChamTLDR, S>;
#endif
#endif // FABULOUS_USE_CHAMELEON
inline Template<ARNOLDI_STD> arnoldi_std() { return Template<ARNOLDI_STD>{}; }
inline Template<ARNOLDI_QR> arnoldi_qr() { return Template<ARNOLDI_QR>{}; }
......@@ -39,7 +39,7 @@ inline Template<ARNOLDI_CHAM_QR> arnoldi_cham_qr()
{ return Template<ARNOLDI_CHAM_QR>{}; }
inline Template<ARNOLDI_CHAM_TL> arnoldi_cham_tl()
{ return Template<ARNOLDI_CHAM_TL>{}; }
#endif
#endif // FABULOUS_USE_CHAMELEON
std::ostream& operator<<(std::ostream &o, const Template<ARNOLDI_STD> &)
{
......@@ -78,9 +78,8 @@ std::ostream& operator<<(std::ostream &o, const Template<ARNOLDI_CHAM_TL> &)
return (o << "CHAM_TL");
}
#endif
#endif // FABULOUS_USE_CHAMELEON
};
}; // end namespace fabulous
#endif // FABULOUS_ALGO_TYPE_HPP
......@@ -5,7 +5,7 @@
#include <iostream>
namespace fabulous {
template< class S > class BGMRes;
template<class S> class BGMRes;
};
#include "fabulous/data/Block.hpp"
......@@ -20,7 +20,8 @@ namespace fabulous {
/**
* \brief %Block General Minimum Residual (%BGMRes) algorithm
*/
template< class S > class BGMRes
template< class S >
class BGMRes
{
public:
using value_type = typename Arithmetik<S>::value_type;
......@@ -206,8 +207,9 @@ public:
{
return _logger;
}
};
}; // namespace fabulous
}; // end class BGMRes
}; // end namespace fabulous
#endif // FABULOUS_BGMRES_HPP
#ifndef FABULOUS_EQUATION_HPP
#define FABULOUS_EQUATION_HPP
namespace fabulous {
template< class S > class BGMRes;
template<class Matrix, class S> class Equation;
};
#include "fabulous/utils/Arithmetic.hpp"
#include "fabulous/data/Block.hpp"
namespace fabulous {
template< class S > class BGMRes;
/**
* \brief Tuple container for A, X, B and epsilon
*/
......@@ -38,7 +41,8 @@ public:
_epsilon{epsilon, epsilon+Nepsilon}
{
}
};
}; // end class Equation
/**
* \brief Helper function to create Equation object
......@@ -51,6 +55,6 @@ inline Equation<Matrix, S> equation(
return Equation<Matrix,S>{A, X, B, epsilon};
}
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_EQUATION_HPP
......@@ -3,7 +3,7 @@
namespace fabulous {
template< class S > class BGMRes;
template<class S> class BGMRes;
/**
* \brief Hold parameters for BGMRES algorithm
......@@ -12,6 +12,7 @@ class Parameters
{
private:
template<class S> friend class BGMRes;
int _max_mvp; /*!< maximum number of matrix vector product */
int _max_space; /*!< maximum size of krylov search space */
public:
......
#ifndef FABULOUS_ARNOLDI_HPP
#define FABULOUS_ARNOLDI_HPP
#ifndef FABULOUS_ARNOLDI_DR_HPP
#define FABULOUS_ARNOLDI_DR_HPP
namespace fabulous {
template<template<class> class HESSENBERG, class S > class ArnoldiDR;
template< template<class> class HESSENBERG, class S > class ArnoldiDR;
};
#include "fabulous/data/Base.hpp"
......@@ -23,7 +23,7 @@ namespace fabulous {
*
* This class support DeflatedRestarting
*/
template<template<class> class HESSENBERG, class S >
template< template<class> class HESSENBERG, class S >
class ArnoldiDR
{
static_assert(
......@@ -283,4 +283,4 @@ public:
}; // namespace fabulous
#endif // FABULOUS_ARNOLDI_HPP
#endif // FABULOUS_ARNOLDI_DR_HPP
#ifndef FABULOUS_ARNOLDI_IB_DR_HPP
#define FABULOUS_ARNOLDI_IB_DR_HPP
inline void breakpoint() {}
namespace fabulous {
template<template<class> class HESSENBERG, class S> class ArnoldiIBDR;
};
......@@ -19,13 +17,11 @@ template<template<class> class HESSENBERG, class S> class ArnoldiIBDR;
namespace fabulous {
/**
* \brief %Arnoldi iterations with inexact breakdowns
*
* GELS kernel is used to solve the LeastSquare problem on the projected matrix
* \brief %Arnoldi iterations with Inexact Breakdowns and Deflated Restarting
*
* \warning This class does NOT support DeflatedRestarting (not implemented)
* the GELS kernel is used to solve the LeastSquare problem on the projected matrix
*/
template < template<class> class HESSENBERG, class S >
template< template<class> class HESSENBERG, class S >
class ArnoldiIBDR
{
static_assert(
......@@ -334,7 +330,6 @@ private:
restarter.save_WP(_WP);
}
breakpoint();
Block<S> U;
_nb_direction_kept = PR.decomposition_SVD(U, epsilon, inv_epsilon);
_nb_direction_discarded = _nbRHS - _nb_direction_kept;
......
#ifndef FABULOUS_BASE_HPP
#define FABULOUS_BASE_HPP
namespace fabulous {
template<class S> class Base;
};
......@@ -14,7 +13,8 @@ namespace fabulous {
/**
* \brief This class store the base of the spanned krylov space.
*/
template<class S> class Base : public Block<S>
template<class S>
class Base : public Block<S>
{
private:
int _nb_block; // id of current used block
......@@ -94,8 +94,9 @@ public:
Block V = sub_block(0, 0, get_nb_row(), len_Y);
LapackKernI::gemm(V, Y, VY, alpha, beta);
}
};
}; // namespace fabulous
}; // end class Base
}; // end namespace fabulous
#endif // FABULOUS_BASE_HPP
#ifndef FABULOUS_BLOCK_H
#define FABULOUS_BLOCK_H
#ifndef FABULOUS_BLOCK_HPP
#define FABULOUS_BLOCK_HPP
#include <memory>
#include <cstdint>
......@@ -38,8 +38,9 @@ namespace fabulous {
/**
* \brief Matrix storage: Lapack/FORTRAN style (Column major layout) 2D array of scalars
*/
template<class S> class Block {
template<class S>
class Block
{
protected:
int _m;
int _n;
......@@ -440,7 +441,7 @@ public:
return nb_krylov_direction;
}
};
}; // end class Block
template< class U >
std::ostream& operator<<(std::ostream &o, const Block<U> &b)
......@@ -451,5 +452,4 @@ std::ostream& operator<<(std::ostream &o, const Block<U> &b)
}; // namespace fabulous
#endif // FABULOUS_BLOCK_H
#endif // FABULOUS_BLOCK_HPP
......@@ -14,7 +14,8 @@ namespace fabulous {
*
* This use a cursor to know where P ends and W starts is needed.
*/
template< class S > class BlockWP : public Block<S>
template< class S >
class BlockWP : public Block<S>
{
private:
int _cursor; /**< number of vector in P part */
......@@ -150,9 +151,9 @@ public:
FABULOUS_DEBUG("CHECK_ORTHO WP["<<Color::green<<name<<Color::reset<<"]: (B^H*B - I) "
<<"Min="<<MM.first<<" Max="<<MM.second);
}
};
}; // end class BlockWP
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_BLOCK_WP_HPP
#ifndef FABULOUS_MORSE_DESC_H
#define FABULOUS_MORSE_DESC_H
#ifndef FABULOUS_MORSE_DESC_HPP
#define FABULOUS_MORSE_DESC_HPP
#include <memory>
#include <string>
......@@ -13,8 +13,8 @@ template<class> class morse_desc_impl;
};
#include "fabulous/utils/Chameleon.hpp"
#include "./TileMapper.hpp"
#include "fabulous/utils/Arithmetic.hpp"
#include "fabulous/data/TileMapper.hpp"
namespace fabulous {
......@@ -49,7 +49,8 @@ static int fabulous_desc_get_rankof(const MORSE_desc_t *D, int i, int j)
/**
* \brief Helper class to implement Pointer semantic of the MorseDesc class
*/
template <class U> class morse_desc_impl
template <class U>
class morse_desc_impl
{
private:
const TileMapper<U> &_pool;
......@@ -117,7 +118,7 @@ public:
{
return _pool.get_tile_size();
}
};
}; // end class morse_desc_impl
/**
* \brief Wrapper for MORSE_desc_t object
......@@ -125,7 +126,8 @@ public:
* This object has the semantic as a smart(reference counting)
* pointer and can be copied safely
*/
template<class U> class MorseDesc
template<class U>
class MorseDesc
{
private:
std::shared_ptr<morse_desc_impl<U>> _pimpl;
......@@ -139,8 +141,8 @@ public:
{
return _pimpl->get();
}
};
}; // end class MorseDesc
}; // end namespace fabulous;
#endif // FABULOUS_MORSE_DESC_H
#endif // FABULOUS_MORSE_DESC_HPP
#ifndef FABULOUS_TILE_MAPPER_H
#define FABULOUS_TILE_MAPPER_H
#ifndef FABULOUS_TILE_MAPPER_HPP
#define FABULOUS_TILE_MAPPER_HPP
#include <pthread.h>
#include <utility>
#include <memory>
#include <unordered_map>
#include <vector>
#include <cassert>
#include <pthread.h>
#include <morse.h>
namespace fabulous {
template <class> class TileMapper;
......@@ -17,7 +21,8 @@ namespace fabulous {
/**
* \brief Tile container for MorseDesc objects (base class)
*/
template <class S> class TileMapper
template <class S>
class TileMapper
{
protected:
std::vector<S> _buf; /**< the tiles buffer */
......@@ -59,7 +64,7 @@ public:
int get_block_tile_ratio() const { return _block_tile_ratio; }
virtual void* get_blk_addr(int it, int jt, int il, int jl) const = 0;
};
}; // end class TileMapper
/**
......@@ -84,7 +89,8 @@ public:
* and by its "inner coordinates". <br/> The inner coordinate systems is the same
* as the ClassicTileMapper coordinates system (DPLASMA/Chameleon style).
*/
template< class S > class HessenbergTileMapper : public TileMapper<S>
template< class S >
class HessenbergTileMapper : public TileMapper<S>
{
private:
using TileMapper<S>::_data;
......@@ -107,7 +113,7 @@ public:
int tile_lid = jl*_block_tile_ratio + il;
return _data + block_id*_block_bsize + tile_lid*_tile_bsize;
}
};
}; // end class HessenbergTileMapper
......@@ -134,7 +140,8 @@ public:
* and by its "inner coordinates". <br/> The inner coordinate systems is the same
* as the global coordinates system (DPLASMA/Chameleon style).
*/
template< class S> class ClassicTileMapper : public TileMapper<S>
template< class S>
class ClassicTileMapper : public TileMapper<S>
{
private:
using TileMapper<S>::_data;
......@@ -158,9 +165,8 @@ public:
int tile_lid = jl * _block_tile_ratio + il;
return _data + block_id*_block_bsize + tile_lid*_tile_bsize;
}
};
}; // end class ClassicTileMapper
}; // end namespace fabulous
};
#endif // FABULOUS_TILE_MAPPER_H
#endif // FABULOUS_TILE_MAPPER_HPP
#ifndef FABULOUS_MORSE_DESC_H
#define FABULOUS_MORSE_DESC_H
#ifndef FABULOUS_MORSE_DESC_HPP
#define FABULOUS_MORSE_DESC_HPP
#include <memory>
#include <string>
......@@ -195,4 +195,4 @@ public:
}; // end namespace experimental
}; // end namespace fabulous;
#endif // FABULOUS_MORSE_DESC_H
#endif // FABULOUS_MORSE_DESC_HPP
#ifndef FABULOUS_MORSE_DESC_H
#define FABULOUS_MORSE_DESC_H
#ifndef FABULOUS_MORSE_DESC_HPP
#define FABULOUS_MORSE_DESC_HPP
#include <memory>
#include <string>
......@@ -188,8 +188,7 @@ public:
inline operator const MORSE_desc_t*(){ return get(); }
};
}; // end namespace experimental
}; // end namespace fabulous;
#endif // FABULOUS_MORSE_DESC_H
#endif // FABULOUS_MORSE_DESC_HPP
#ifndef FABULOUS_MORSE_DESC_H
#define FABULOUS_MORSE_DESC_H
#ifndef FABULOUS_MORSE_DESC_HPP
#define FABULOUS_MORSE_DESC_HPP
#include <memory>
#include <string>
......@@ -193,4 +193,4 @@ public:
}; // end namespace experimental
}; // end namespace fabulous;
#endif // FABULOUS_MORSE_DESC_H
#endif // FABULOUS_MORSE_DESC_HPP
......@@ -14,6 +14,10 @@
#include <cassert>
#include <morse.h>
namespace fabulous {
template<class S> class HessChamQR;
};
#include "fabulous/utils/Arithmetic.hpp"
#include "fabulous/utils/Error.hpp"
#include "fabulous/utils/Chameleon.hpp"
......@@ -50,7 +54,9 @@ inline std::string make_quad_key(int i, int j, int m, int n)
*
* \note only the upper hessenberg block are allocated.
*/
template< class S > class HessChamQR {
template< class S >
class HessChamQR
{
private:
int _max_nb_iter;
int _mb; /**< maximum number of (big) block line (_nbRHSx_nbRHS) in hessenberg */
......@@ -348,10 +354,10 @@ public:
}
inline int get_nb_vect() const { return (_nb_block_col) * _nbRHS; }
};
}; // end class HessChamQR
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_USE_CHAMELEON
......
......@@ -26,7 +26,8 @@ namespace fabulous {
*
* @warning the whole matrix is allocated, its size is driven by the restart parameter.
*/
template< class S > class HessChamTLDR : public Block<S>
template< class S >
class HessChamTLDR : public Block<S>
{
public:
FABULOUS_INHERITS_BLOCK(S);
......@@ -182,12 +183,10 @@ public:
int get_nb_vect() const { return _nb_vect; }
int get_nb_hess_line() const { return _nb_vect + _nbRHS; }
};
}; // namespace fabulous
}; // end class HessChamTLDR
}; // end namespace fabulous
#endif // FABULOUS_USE_CHAMELEON
#endif // FABULOUS_HESS_STANDARD_HPP
#endif // FABULOUS_HESS_CHAM_TOPLEVEL_HPP
#ifndef FABULOUS_HESS_STANDARD_HPP
#define FABULOUS_HESS_STANDARD_HPP
#ifndef FABULOUS_HESS_DR_HPP
#define FABULOUS_HESS_DR_HPP
namespace fabulous {
template< class > class HessDR;
template<class S> class HessDR;
};
#include "fabulous/kernel/LapackInterface.hpp"
......@@ -23,7 +23,8 @@ namespace fabulous {
*
* @warning the whole matrix is allocated, its size is driven by the restart parameter.
*/
template< class S > class HessDR : public Block<S>
template< class S >
class HessDR : public Block<S>
{
public:
FABULOUS_INHERITS_BLOCK(S);
......@@ -184,9 +185,8 @@ public:
int get_nb_vect() const { return _nb_vect; }
int get_nb_hess_line() const { return _nb_vect + _nbRHS; }
};
}; // end class HessDR
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_HESS_STANDARD_HPP
#endif // FABULOUS_HESS_DR_HPP
......@@ -19,7 +19,8 @@ namespace fabulous {
* This hold the matrix denoted as \f$\mathscr{F}\f$ in the paper.
*
*/
template< class S > class HessIB : public Block<S>
template< class S >
class HessIB : public Block<S>
{
public:
FABULOUS_INHERITS_BLOCK(S);
......@@ -356,10 +357,9 @@ public:
}
void notify_orthogonalization_end() const {/*nop*/}
};
}; // namespace fabulous
}; // end class HessIB
}; // end namespace fabulous
#endif // FABULOUS_HESS_IB_HPP
......@@ -80,7 +80,7 @@ public:
*/
void init_lambda(const Block<S> &lambda)
{
//Check
// Check
if (lambda.get_nb_col() != _nbRHS)
FABULOUS_FATAL_ERROR("Lambda nb_col is wrong while initiating lambda in Hess\n");
if (lambda.get_nb_row() != _nbRHS + _nb_eigen_pair)
......
......@@ -27,7 +27,8 @@ namespace fabulous {
*
* \warning the whole matrix is allocated, its size is driven by the restart parameter.
*/
template<class S> class HessQR : public Block<S>
template<class S>
class HessQR : public Block<S>
{
public:
FABULOUS_INHERITS_BLOCK(S);
......@@ -213,9 +214,8 @@ public:
int get_nb_vect() const { return _nb_vect; }
};
}; // end class HessQR
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_HESS_QR_HPP
#ifndef FABULOUS_HESS_DR_QR_H
#define FABULOUS_HESS_DR_QR_H
#ifndef FABULOUS_HESS_QR_DR_HPP
#define FABULOUS_HESS_QR_DR_HPP
namespace fabulous {
template<class> class HessQRDR;
......@@ -288,9 +288,9 @@ public:
}
int get_nb_vect() const { return _nb_vect; }
};
}; // end class HessQRDR
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_HESS_DR_QR_H
#endif // FABULOUS_HESS_QR_DR_HPP
#ifndef FABULOUS_ALGORITHM_H
#define FABULOUS_ALGORITHM_H
#ifndef FABULOUS_ALGORITHM_HPP
#define FABULOUS_ALGORITHM_HPP
#include <cassert>
namespace fabulous {
struct Algorithm;
};
#include "fabulous/utils/Utils.hpp"
#include "fabulous/kernel/LapackInterface.hpp"
......@@ -11,7 +15,8 @@ namespace fabulous {
/**
* \brief methods that apply on Blocks (QR factorization)
*/
struct Algorithm {
struct Algorithm
{
public:
/**
......@@ -93,9 +98,8 @@ public:
}
LapackKernI::orgqr(M, N, N, Q.get_ptr(), LD, tau.data());
}
};
}; // end struct Algorithm
}; // namespace fabulous
}; // end namespace fabulous
#endif // FABULOUS_ALGORITHM_H
#endif // FABULOUS_ALGORITHM_HPP
......@@ -12,13 +12,14 @@ struct ChameleonKernI;
};
#include "fabulous/utils/Chameleon.hpp"
#include "fabulous/utils/Arithmetic.hpp"
namespace fabulous {
/**
* \brief Generic (templatized) wrappers for Chameleon (MORSE) kernels
*
* This is the interface for the '*_Tile_Async' method of chameleon.
* This is the interface for the '*_Tile_Async' functions of chameleon.
*/
struct ChameleonKernI
{
......@@ -111,7 +112,7 @@ struct ChameleonKernI
}
#pragma GCC diagnostic pop
}; // end class ChameleonKernI
}; // end struct ChameleonKernI
/*************************************/
/*************** GELS ****************/
......
......@@ -8,6 +8,7 @@ struct ChameleonKernTopLevelI;
};
#include "fabulous/utils/Error.hpp"
#include "fabulous/utils/Arithmetic.hpp"
namespace fabulous {
......@@ -43,7 +44,7 @@ struct ChameleonKernTopLevelI
}
#pragma GCC diagnostic pop
};
}; // end struct ChameleonKernTopLevelI
/*************************************/
/*************** GELS ****************/
......@@ -63,6 +64,6 @@ struct ChameleonKernTopLevelI
FABULOUS_ARITHMETIC_LIST(FABULOUS_SPECIALIZE_TL_CHAM_GELS);
}; // namespace fabulous;
}; // end namespace fabulous;
#endif // FABULOUS_CHAMELEON_INTERFACE_TOP_LEVEL_HPP
......@@ -243,7 +243,6 @@ struct LapackKernI
#pragma GCC diagnostic pop
}; // end class LapackKernI
}; // namespace fabulous
......
......@@ -10,12 +10,10 @@
#endif
#include "./LapackInterface.hpp"
#include "fabulous/utils/Arithmetic.hpp"
#include "fabulous/ext/lapacke.h"
namespace fabulous {
/********* LACPY **********/
#define FABULOUS_SPECIALIZE_LACPY(_1, type_, _3, _4, _5, _6, prefix_, ...) \
......
......@@ -14,7 +14,6 @@
#include "fabulous/ext/lapacke.h"
namespace fabulous {
/********* LACPY **********/
......@@ -467,6 +466,6 @@ inline int LapackKernI::ggev(int n,
FABULOUS_ARITHMETIC_LIST(FABULOUS_SPECIALIZE_TRSM);
};
}; // end namespace fabulous
#endif // FABULOUS_LAPACK_INTERFACE_WORK_HPP
#ifndef ARNOLDI_ORTHO_BLOCK_HPP
#define ARNOLDI_ORTHO_BLOCK_HPP
namespace fabulous {
template<class HESS> class OrthogonalizerBlockSTD;
};
#include "fabulous/utils/Traits.hpp"
#include "fabulous/data/Base.hpp"
#include "fabulous/data/Block.hpp"
......