tfel
Loading...
Searching...
No Matches
tfel::math::IndexingPoliciesCompatiblityCheckBase< IndexingPolicy1, IndexingPolicy2 > Struct Template Reference

a base class to compare indexing policies which provide default implementations. More...

#include </home/runner/work/tfel/tfel/include/TFEL/Math/Array/IndexingPolicies.hxx>

Inheritance diagram for tfel::math::IndexingPoliciesCompatiblityCheckBase< IndexingPolicy1, IndexingPolicy2 >:
tfel::math::IndexingPoliciesCompatiblityCheck< IndexingPolicy1, IndexingPolicy2 >

Static Public Member Functions

static TFEL_HOST_DEVICE constexpr bool performCompileTimeCheck ()
static TFEL_HOST_DEVICE constexpr bool haveTheSameMemoryLayout ()
static TFEL_HOST_DEVICE constexpr bool performRuntimeTimeCheck (const IndexingPolicy1 &, const IndexingPolicy2 &)

Detailed Description

template<typename IndexingPolicy1, typename IndexingPolicy2>
struct tfel::math::IndexingPoliciesCompatiblityCheckBase< IndexingPolicy1, IndexingPolicy2 >

a base class to compare indexing policies which provide default implementations.

Template Parameters
IndexingPolicy1first indexing policy
IndexingPolicy2second indexing policy
Note
the default implementations are very conservative. For example, the memory layout are reported to be different by default.

Member Function Documentation

◆ haveTheSameMemoryLayout()

template<typename IndexingPolicy1, typename IndexingPolicy2>
bool tfel::math::IndexingPoliciesCompatiblityCheckBase< IndexingPolicy1, IndexingPolicy2 >::haveTheSameMemoryLayout ( )
staticconstexpr
Returns
if the indexing policies have the same memory layouts.

Two indexing policies can be compatible (at compile-time and at runtime), i.e. one may transfer data from one indexing policy to another, but the memory layout of the data may differ. For example, one may assign a matrix stored in column-major format to a matrix having a row-major format.

◆ performCompileTimeCheck()

template<typename IndexingPolicy1, typename IndexingPolicy2>
bool tfel::math::IndexingPoliciesCompatiblityCheckBase< IndexingPolicy1, IndexingPolicy2 >::performCompileTimeCheck ( )
staticconstexpr
Returns
if the given indexing policies may a priori be compatible.

◆ performRuntimeTimeCheck()

template<typename IndexingPolicy1, typename IndexingPolicy2>
bool tfel::math::IndexingPoliciesCompatiblityCheckBase< IndexingPolicy1, IndexingPolicy2 >::performRuntimeTimeCheck ( const IndexingPolicy1 & p1,
const IndexingPolicy2 & p2 )
staticconstexpr
Returns
if the given policies are compatible at runtime time.
Precondition
this method is only meaningful if the compileTimeCheck method returns true.
Parameters
[in]p1first indexing policy
[in]p2second indexing policy
Note
This methods does nothing if both indexing policies have fixed size (i.e. known at compile-time).

The documentation for this struct was generated from the following files: