Eigen::TensorSycl::internal Namespace Reference

Classes

struct  PacketWrapper
 
struct  TVPanelSize
 TVPanelSize, a template class used for setting the panel size required for launching General TensorVector contraction kernel on various hardware devices. More...
 
struct  TTPanelSize
 TTPanelSize, a template class used for setting the panel size required for launching General Tensor Tensor contraction kernel on various hardware devices. More...
 
struct  BlockProperties
 BlockProperties is a template class that provides different characteristic of a block of each Tensor processed by each workgroup. More...
 
struct  ThreadProperties
 ThreadProperties is a template class that provides each thread's properties within a workgroup. Please see the sycl-1.2.1 specification (https://www.khronos.org/registry/SYCL/specs/sycl-1.2.1.pdf) for the workgroup, work-items. More...
 
class  TensorContractionKernel
 TensorContractionKernel is a template class that provides Tensor -Tensor contraction operation. More...
 
struct  GeneralVectorTensor
 GeneralVectorTensor is a template class that provides Tensor -vector contraction operation, which is a special case of Tensor Tensor contraction. More...
 
struct  GeneralScalarContraction
 GeneralScalarContraction is a template class that provides the scalar value of Tensor -Tensor contraction operation, when all the dimensions are contracting dimensions. This Kernel reduces two tensors to an scalar. More...
 
struct  OpDefiner
 
struct  OpDefiner< Eigen::internal::MeanReducer< CoeffReturnType >, CoeffReturnType, Index, false >
 
struct  OpDefiner< Eigen::internal::MeanReducer< CoeffReturnType >, CoeffReturnType, Index, true >
 
struct  SecondStepFullReducer
 
class  FullReductionKernelFunctor
 
class  GenericNondeterministicReducer
 
struct  PartialReductionKernel
 
struct  SecondStepPartialReduction
 
struct  ReductionPannel
 
struct  PartialReducerLauncher
 
struct  ScanParameters
 
struct  ScanKernelFunctor
 
struct  ScanAdjustmentKernelFunctor
 
struct  ScanInfo
 
struct  SYCLAdjustBlockOffset
 
struct  ScanLauncher_impl
 

Enumerations

enum class  contraction_type { local , no_local }
 
enum class  data_source { global_mem , local_mem , private_mem }
 
enum class  reduction_dim { inner_most , outer_most }
 
enum class  scan_step { first , second }
 

Functions

template<bool PacketLoad, bool is_coalesced_layout, bool , typename PacketType , typename TensorMapper , typename StorageIndex >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< PacketLoad, PacketTyperead (const TensorMapper &tensorMapper, const StorageIndex &NCIndex, const StorageIndex &CIndex, const StorageIndex &ld)
 read, a template function used for loading the data from global memory. This function is used to guarantee coalesced and vectorized load whenever possible More...
 
template<bool PacketLoad, bool , bool IsRhs, typename PacketType , typename TensorMapper , typename StorageIndex >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<!PacketLoad, PacketTyperead (const TensorMapper &tensorMapper, const StorageIndex &NCIndex, const StorageIndex &CIndex, const StorageIndex &)
 read, special overload of read function, when the read access is not vectorized More...
 
template<typename StorageIndex , StorageIndex ld, data_source dt, typename PacketType , typename DataScalar >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< dt !=data_source::global_mem, void > write (PacketType &packet_data, DataScalar ptr)
 write, a template function used for storing the data to local memory. This function is used to guarantee coalesced and vectorized store whenever possible. More...
 
template<data_source dt, typename PacketType , typename DataScalar >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< Eigen::internal::unpacket_traits< PacketType >::size !=1 &&dt==data_source::global_mem, void > write (PacketType &packet_data, DataScalar *ptr)
 Overloading the write function for storing the data to global memory, when vectorization enabled This function is used to guarantee coalesced and vectorized store whenever possible. More...
 
template<data_source dt, typename PacketType , typename DataScalar >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< Eigen::internal::unpacket_traits< PacketType >::size==1 &&dt==data_source::global_mem, void > write (PacketType &packet_data, DataScalar *ptr)
 Overloading the write function for storing the data to global memory, when vectorization is disabled. More...
 
template<bool is_internal>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool check_boundary (bool)
 check_boundary: is used to check the edge condition for non-internal blocks. More...
 
template<>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool check_boundary< false > (bool cond)
 check_boundary: specialization of the check_boundary for non-internal blocks. More...
 

Enumeration Type Documentation

◆ contraction_type

◆ data_source

◆ reduction_dim

◆ scan_step

Function Documentation

◆ check_boundary()

template<bool is_internal>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool Eigen::TensorSycl::internal::check_boundary ( bool  )

check_boundary: is used to check the edge condition for non-internal blocks.

Template Parameters
is_internaldetermines if the block is internal
281  {
282  return true;
283 }

◆ check_boundary< false >()

check_boundary: specialization of the check_boundary for non-internal blocks.

Parameters
condtrue when the data is in range. Otherwise false
291  {
292  return cond;
293 }

◆ read() [1/2]

template<bool PacketLoad, bool , bool IsRhs, typename PacketType , typename TensorMapper , typename StorageIndex >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<!PacketLoad, PacketType> Eigen::TensorSycl::internal::read ( const TensorMapper &  tensorMapper,
const StorageIndex &  NCIndex,
const StorageIndex &  CIndex,
const StorageIndex &   
)
static

read, special overload of read function, when the read access is not vectorized

Template Parameters
PacketLoaddetermines if the each element of this tensor block should be loaded in a packet mode
Parameters
is_coalesced_layoutdetermines whether or not the Tensor data in a memory can be access coalesced and vectorized when possible. Coalesced memory access is a key factor in Kernel performance. When a tensor is 2d and the contracting dimension is 1, it is always possible to accessed tensor data coalesced and vectorized. This is the case when RHS(right hand side) Tensor is transposed or when LHS(left hand side) Tensor is not transposed.
Template Parameters
PacketTypedetermines the type of packet
TensorMapperdetermines the input tensor mapper type
StorageIndexdetermines the Index type
Parameters
tensorMapperis the input tensor
NCIndexis the non-contracting dim index
CIndexis the contracting dim index
193  {
194  const StorageIndex row = (IsRhs) ? CIndex : NCIndex;
195  const StorageIndex col = (IsRhs) ? NCIndex : CIndex;
196  return tensorMapper(row, col);
197 }
m col(1)
m row(1)

References col(), and row().

◆ read() [2/2]

template<bool PacketLoad, bool is_coalesced_layout, bool , typename PacketType , typename TensorMapper , typename StorageIndex >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<PacketLoad, PacketType> Eigen::TensorSycl::internal::read ( const TensorMapper &  tensorMapper,
const StorageIndex &  NCIndex,
const StorageIndex &  CIndex,
const StorageIndex &  ld 
)
static

read, a template function used for loading the data from global memory. This function is used to guarantee coalesced and vectorized load whenever possible

Template Parameters
PacketLoaddetermines if the each element of this tensor block should be loaded in a packet mode
Parameters
is_coalesced_layoutdetermines whether or not the Tensor data in a memory can be access coalesced and vectorized when possible. Coalesced memory access is a key factor in Kernel performance. When a tensor is 2d and the contracting dimension is 1, it is always possible to accessed tensor data coalesced and vectorized. This is the case when RHS(right hand side) Tensor is transposed or when LHS(left hand side) Tensor is not transposed.
Template Parameters
PacketTypedetermines the type of packet
TensorMapperdetermines the input tensor mapper type
StorageIndexdetermines the Index type
Parameters
tensorMapperis the input tensor
NCIndexis the non-contracting dim index
CIndexis the contracting dim index
ldis the leading dimension of the flattened tensor
163  {
164  const StorageIndex row = (is_coalesced_layout) ? NCIndex : CIndex;
165  const StorageIndex col = (is_coalesced_layout) ? CIndex : NCIndex;
166  return tensorMapper.get_tensor().template packet<Unaligned>(row + (col * ld));
167 }

References col(), and row().

Referenced by Eigen::TensorSycl::internal::GeneralVectorTensor< OutScalar, OutAccessor, VectorMapper, TensorMapper, StorageIndex, Properties, KFactor, Vectorizable, is_lhs_vec, IsFinal >::extract_block(), Eigen::TensorSycl::internal::TensorContractionKernel< OutScalar, LhsScalar, RhsScalar, OutAccessor, LhsMapper, RhsMapper, StorageIndex, Properties, TripleDim, Vectorizable, input_mapper_properties, IsFinal, contraction_tp >::extract_block(), AirwayReopeningProblem< ELEMENT >::parameter_study(), AirwayReopeningProblem< ELEMENT >::read(), ThermalSpecies< NormalForceSpecies >::read(), Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction >::read(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read(), Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read(), LiquidFilm< Particle >::read(), Thermal< Particle >::read(), AxisymmetricVibratingShellProblem< ELEMENT >::restart(), VibratingShellProblem< ELEMENT >::restart(), ElasticRingProblem< ELEMENT >::restart(), FSICollapsibleChannelProblem< ELEMENT >::restart(), OscRingNStProblem< ELEMENT >::restart(), RefineableUnsteadyHeatProblem< ELEMENT >::restart(), DiskShockWaveProblem< ELEMENT, TIMESTEPPER >::restart(), UnsteadyHeatProblem< ELEMENT >::restart(), simulate::runSimulations(), and simulateAWS::runSimulations().

◆ write() [1/3]

template<data_source dt, typename PacketType , typename DataScalar >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<Eigen::internal::unpacket_traits<PacketType>::size != 1 && dt == data_source::global_mem, void> Eigen::TensorSycl::internal::write ( PacketType packet_data,
DataScalar *  ptr 
)
static

Overloading the write function for storing the data to global memory, when vectorization enabled This function is used to guarantee coalesced and vectorized store whenever possible.

Template Parameters
data_sourcean enum value representing if the location of the data in a memory hierarchy.
PacketTypedetermines the type of packet
DataScalardetermines the output data type
Parameters
packet_datathe data to be written in the local memory
ptra pointer to the local memory
250  {
251  ::Eigen::internal::pstoreu<DataScalar, PacketType>(ptr, packet_data);
252 }

◆ write() [2/3]

template<data_source dt, typename PacketType , typename DataScalar >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<Eigen::internal::unpacket_traits<PacketType>::size == 1 && dt == data_source::global_mem, void> Eigen::TensorSycl::internal::write ( PacketType packet_data,
DataScalar *  ptr 
)
static

Overloading the write function for storing the data to global memory, when vectorization is disabled.

Template Parameters
data_sourcean enum value representing if the location of the data in a memory hierarchy.
PacketTypedetermines the type of packet
DataScalardetermines the output data type
Parameters
packet_datathe data to be written in the local memory
ptra pointer to the local memory
271  {
272  *ptr = packet_data;
273 }

◆ write() [3/3]

template<typename StorageIndex , StorageIndex ld, data_source dt, typename PacketType , typename DataScalar >
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t<dt != data_source::global_mem, void> Eigen::TensorSycl::internal::write ( PacketType packet_data,
DataScalar  ptr 
)
static

write, a template function used for storing the data to local memory. This function is used to guarantee coalesced and vectorized store whenever possible.

Template Parameters
StorageIndexdetermines the Index type
Parameters
ldis the leading dimension of the local memory. ld is a compile time value for the local memory
Template Parameters
data_sourcean enum value representing if the location of the data in a memory hierarchy.
PacketTypedetermines the type of packet
DataScalardetermines the output data type
Parameters
packet_datathe data to be written in the local memory
ptra pointer to the local memory
CIndexis the contracting dim index
222  {
225  for (int i = 0; i < PacketSize; i++) {
226  *ptr = PacketWrapper<PacketType, PacketSize>::scalarize(i, packet_data);
227  ptr += ld;
228  }
229 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_UNROLL_LOOP
Definition: Macros.h:1298
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
Definition: GenericPacketMath.h:134

References EIGEN_CONSTEXPR, EIGEN_UNROLL_LOOP, i, and Eigen::TensorSycl::internal::PacketWrapper< PacketReturnType, PacketSize >::scalarize().

Referenced by GranularJet::actionsBeforeTimeLoop(), statistics_while_running< T >::actionsBeforeTimeLoop(), SilbertPeriodic::add_flow_particles(), Eigen::TensorSycl::internal::TensorContractionKernel< OutScalar, LhsScalar, RhsScalar, OutAccessor, LhsMapper, RhsMapper, StorageIndex, Properties, TripleDim, Vectorizable, input_mapper_properties, IsFinal, contraction_tp >::extract_block(), simulate::mergeOutputFiles(), simulateAWS::mergeOutputFiles(), simulate::runSimulations(), simulateAWS::runSimulations(), ChutePeriodic::setupInitialConditions(), VariableBottom::setupInitialConditions(), Vreman::setupInitialConditions(), AxisymmetricHopper::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), CLiveStatistics< T >::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), SegregationPeriodic::setupInitialConditions(), CGPoint< Coordinates, Fields >::write(), ThermalSpecies< NormalForceSpecies >::write(), Interaction< NormalForceInteraction, FrictionForceInteraction, AdhesiveForceInteraction >::write(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write(), Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write(), LiquidFilm< Particle >::write(), and Thermal< Particle >::write().