Imporive support for Map alignment and alignment retrieval
See merge request oss/rotgen!15
This commit is contained in:
parent
73cf7c832b
commit
84626f6896
12 changed files with 1345 additions and 48 deletions
|
|
@ -7,7 +7,6 @@
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <rotgen/detail/static_info.hpp>
|
|
||||||
#include <rotgen/concepts.hpp>
|
#include <rotgen/concepts.hpp>
|
||||||
|
|
||||||
#if !defined(ROTGEN_FORCE_DYNAMIC)
|
#if !defined(ROTGEN_FORCE_DYNAMIC)
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,32 @@
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <rotgen/common/export.hpp>
|
#include <rotgen/common/export.hpp>
|
||||||
|
#include <rotgen/detail/spy.hpp>
|
||||||
|
|
||||||
namespace rotgen
|
namespace rotgen
|
||||||
{
|
{
|
||||||
using Index = std::ptrdiff_t;
|
using Index = std::ptrdiff_t;
|
||||||
|
|
||||||
|
inline constexpr std::ptrdiff_t default_alignment = []()
|
||||||
|
{
|
||||||
|
constexpr auto w = spy::simd_instruction_set.width;
|
||||||
|
return w == -1 ? 0 : w / 8;
|
||||||
|
}();
|
||||||
|
|
||||||
|
inline constexpr int Dynamic = -1;
|
||||||
|
inline constexpr int Infinity = -1;
|
||||||
|
inline constexpr int AutoAlign = 0;
|
||||||
|
inline constexpr int ColMajor = 0;
|
||||||
|
inline constexpr int RowMajor = 1;
|
||||||
|
inline constexpr int DontAlign = 2;
|
||||||
|
|
||||||
|
inline constexpr int Unaligned = 0;
|
||||||
|
inline constexpr int Aligned8 = 8;
|
||||||
|
inline constexpr int Aligned16 = 16;
|
||||||
|
inline constexpr int Aligned32 = 32;
|
||||||
|
inline constexpr int Aligned64 = 64;
|
||||||
|
inline constexpr int Aligned128 = 128;
|
||||||
|
inline constexpr int Aligned = default_alignment;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(ROTGEN_MAX_SIZE) && defined(ROTGEN_ENABLE_EXPRESSION_TEMPLATES)
|
#if !defined(ROTGEN_MAX_SIZE) && defined(ROTGEN_ENABLE_EXPRESSION_TEMPLATES)
|
||||||
|
|
@ -81,15 +103,16 @@ namespace rotgen
|
||||||
inline std::ostream& setup_summary(std::ostream& os)
|
inline std::ostream& setup_summary(std::ostream& os)
|
||||||
{
|
{
|
||||||
detail::dynamic_info(os);
|
detail::dynamic_info(os);
|
||||||
|
os << " * Default alignment: " << default_alignment << " bytes." << std::endl;
|
||||||
if(!is_forcing_dynamic_status)
|
if(!is_forcing_dynamic_status)
|
||||||
{
|
{
|
||||||
if constexpr(use_expression_templates)
|
if constexpr(use_expression_templates)
|
||||||
os << "[ROTGEN] - Expression templates : Enabled." << std::endl;
|
os << " * Expression templates : Enabled." << std::endl;
|
||||||
else
|
else
|
||||||
os << "[ROTGEN] - Expression templates : Disabled." << std::endl;
|
os << " * Expression templates : Disabled." << std::endl;
|
||||||
|
|
||||||
if constexpr(rotgen::max_static_size)
|
if constexpr(rotgen::max_static_size)
|
||||||
os << "[ROTGEN] - Static/Dynamic mode with maximum size: " << rotgen::max_static_size << std::endl;
|
os << " * Static/Dynamic mode with maximum size: " << rotgen::max_static_size << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
|
|
|
||||||
1307
include/rotgen/detail/spy.hpp
Normal file
1307
include/rotgen/detail/spy.hpp
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,27 +0,0 @@
|
||||||
//==================================================================================================
|
|
||||||
/*
|
|
||||||
ROTGEN - Runtime Overlay for Eigen
|
|
||||||
Copyright : CODE RECKONS
|
|
||||||
SPDX-License-Identifier: BSL-1.0
|
|
||||||
*/
|
|
||||||
//==================================================================================================
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace rotgen
|
|
||||||
{
|
|
||||||
struct matrix_static_info
|
|
||||||
{
|
|
||||||
int rows = -1;
|
|
||||||
int cols = -1;
|
|
||||||
int options = 0;
|
|
||||||
int max_rows = -1;
|
|
||||||
int max_cols = -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline constexpr int Dynamic = -1;
|
|
||||||
inline constexpr int Infinity = -1;
|
|
||||||
inline constexpr int AutoAlign = 0;
|
|
||||||
inline constexpr int ColMajor = 0;
|
|
||||||
inline constexpr int RowMajor = 1;
|
|
||||||
inline constexpr int DontAlign = 2;
|
|
||||||
}
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
namespace rotgen
|
namespace rotgen
|
||||||
{
|
{
|
||||||
template<typename Ref, int Options = ColMajor, typename Stride = rotgen::stride>
|
template<typename Ref, int Options = Unaligned, typename Stride = rotgen::stride>
|
||||||
class map : public find_map<Ref>
|
class map : public find_map<Ref>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <rotgen/detail/static_info.hpp>
|
|
||||||
#include <Eigen/Dense>
|
#include <Eigen/Dense>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <rotgen/detail/static_info.hpp>
|
|
||||||
#include <Eigen/Dense>
|
#include <Eigen/Dense>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
@ -31,7 +30,7 @@ namespace rotgen
|
||||||
using map_type = typename compute_map_type<Ref,Options,isConst>::type;
|
using map_type = typename compute_map_type<Ref,Options,isConst>::type;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Ref, int Options = ColMajor, typename Stride = stride>
|
template<typename Ref, int Options = Unaligned, typename Stride = stride>
|
||||||
class map : private detail::map_type<std::remove_const_t<Ref>, Options, std::is_const_v<Ref>>
|
class map : private detail::map_type<std::remove_const_t<Ref>, Options, std::is_const_v<Ref>>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <rotgen/detail/static_info.hpp>
|
|
||||||
#include <Eigen/Dense>
|
#include <Eigen/Dense>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <rotgen/detail/generators.hpp>
|
#include <rotgen/detail/generators.hpp>
|
||||||
#include <rotgen/detail/static_info.hpp>
|
|
||||||
#include <rotgen/config.hpp>
|
#include <rotgen/config.hpp>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
||||||
using data_type = Eigen::Map<base_type const,Eigen::ColMajor,stride_type>;
|
using data_type = Eigen::Map<base_type const,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
||||||
using data_type = Eigen::Map<base_type const,Eigen::RowMajor,stride_type>;
|
using data_type = Eigen::Map<base_type const,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
||||||
using data_type = Eigen::Map<base_type,Eigen::ColMajor,stride_type>;
|
using data_type = Eigen::Map<base_type,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
@ -120,7 +120,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
using base_type = Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
||||||
using data_type = Eigen::Map<base_type,Eigen::RowMajor,stride_type>;
|
using data_type = Eigen::Map<base_type,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
@ -134,7 +134,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
||||||
using data_type = Eigen::Map<base_type const,Eigen::ColMajor,stride_type>;
|
using data_type = Eigen::Map<base_type const,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
@ -147,7 +147,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
||||||
using data_type = Eigen::Map<base_type const,Eigen::RowMajor,stride_type>;
|
using data_type = Eigen::Map<base_type const,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::ColMajor>;
|
||||||
using data_type = Eigen::Map<base_type,Eigen::ColMajor,stride_type>;
|
using data_type = Eigen::Map<base_type,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
@ -173,7 +173,7 @@ namespace rotgen
|
||||||
{
|
{
|
||||||
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
using stride_type = Eigen::Stride<Eigen::Dynamic,Eigen::Dynamic>;
|
||||||
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
using base_type = Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor>;
|
||||||
using data_type = Eigen::Map<base_type,Eigen::RowMajor,stride_type>;
|
using data_type = Eigen::Map<base_type,Eigen::Unaligned,stride_type>;
|
||||||
|
|
||||||
data_type data;
|
data_type data;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace rotgen::detail
|
||||||
{
|
{
|
||||||
ROTGEN_EXPORT std::ostream& dynamic_info(std::ostream& os)
|
ROTGEN_EXPORT std::ostream& dynamic_info(std::ostream& os)
|
||||||
{
|
{
|
||||||
if constexpr(rotgen::is_forcing_dynamic_status) return os << "[ROTGEN] - Fully Dynamic mode" << std::endl;
|
if constexpr(rotgen::is_forcing_dynamic_status) return os << "[ROTGEN] - Fully Dynamic mode with:" << std::endl;
|
||||||
else return os << "[ROTGEN] - Flexible mode with" << std::endl;
|
else return os << "[ROTGEN] - Flexible mode with:" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
#define TTS_CUSTOM_DRIVER_FUNCTION rotgen_main
|
#define TTS_CUSTOM_DRIVER_FUNCTION rotgen_main
|
||||||
#include "tts.hpp"
|
#include "tts.hpp"
|
||||||
#include "unit/common/references.hpp"
|
#include "unit/common/references.hpp"
|
||||||
#include <rotgen/detail/static_info.hpp>
|
|
||||||
#include <rotgen/config.hpp>
|
#include <rotgen/config.hpp>
|
||||||
#include <rotgen/concepts.hpp>
|
#include <rotgen/concepts.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue