DFT-EFE
 
Loading...
Searching...
No Matches
dftefe::utils::DiscontiguousDataOperations< ValueType, memorySpace > Class Template Reference

#include <DiscontiguousDataOperations.h>

Public Types

using SizeTypeVector = utils::MemoryStorage< size_type, memorySpace >
 

Static Public Member Functions

static void copyFromDiscontiguousMemory (const ValueType *src, ValueType *dst, const size_type *discontIds, const size_type N, const size_type nComponents)
 Function to copy a source array x to a destination array y, where the source is accessed discontiguously but the destination is accessed contiguously. In other words, \( y[i] = x[d_i], i=0,1,2,\ldots,N-1\), where \(\{d_0, d_1, d_2, \ldots, d_{N-1}\}\) define a set of discontiguous indices for x. In practice, we extend the above to multi-component case, wherein both x and \y contain multiple-components for each index. We assume the components to be stored contiguously for each index. Thus, if there are \(C\) components, the function does \( y[i*C + j] = x[d_i*C + j], i=0,1,2,\ldots,N-1\) and \(j=0,1,2,\ldots,C-1\). More...
 
static void copyToDiscontiguousMemory (const ValueType *src, ValueType *dst, const size_type *discontIds, const size_type N, const size_type nComponents)
 Function to copy a source array x to a destination array y, where the source is accessed contiguously but the destination is accessed discontiguously. In other words, \( y[d_i] = x[i], i=0,1,2,\ldots,N-1\), where \(\{d_0, d_1, d_2, \ldots, d_{N-1}\}\) define a set of discontiguous indices for y. In practice, we extend the above to multi-component case, wherein both x and \y contain multiple-components for each index. We assume the components to be stored contiguously for each index. Thus, if there are \(C\) components, the function does \( y[d_i*C + j] = x[i*C + j], i=0,1,2,\ldots,N-1\) and \(j=0,1,2,\ldots,C-1\). More...
 
static void addToDiscontiguousMemory (const ValueType *src, ValueType *dst, const size_type *discontIds, const size_type N, const size_type nComponents)
 Function to add a source array x to a destination array y, where the source is accessed contiguously but the destination is accessed discontiguously. In other words, \( y[d_i] = y[d_i] + x[i], i=0,1,2,\ldots,N-1\), where \(\{d_0, d_1, d_2, \ldots, d_{N-1}\}\) define a set of discontiguous indices for y. In practice, we extend the above to multi-component case, wherein both x and \y contain multiple-components for each index. We assume the components to be stored contiguously for each index. Thus, if there are \(C\) components, the function does \( y[d_i*C + j] = y[d_i*C + j] + x[i*C + j], i=0,1,2,\ldots,N-1\) and \(j=0,1,2,\ldots,C-1\). More...
 

Member Typedef Documentation

◆ SizeTypeVector

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::utils::DiscontiguousDataOperations< ValueType, memorySpace >::SizeTypeVector = utils::MemoryStorage<size_type, memorySpace>

Member Function Documentation

◆ addToDiscontiguousMemory()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::DiscontiguousDataOperations< ValueType, memorySpace >::addToDiscontiguousMemory ( const ValueType *  src,
ValueType *  dst,
const size_type discontIds,
const size_type  N,
const size_type  nComponents 
)
static

Function to add a source array x to a destination array y, where the source is accessed contiguously but the destination is accessed discontiguously. In other words, \( y[d_i] = y[d_i] + x[i], i=0,1,2,\ldots,N-1\), where \(\{d_0, d_1, d_2, \ldots, d_{N-1}\}\) define a set of discontiguous indices for y. In practice, we extend the above to multi-component case, wherein both x and \y contain multiple-components for each index. We assume the components to be stored contiguously for each index. Thus, if there are \(C\) components, the function does \( y[d_i*C + j] = y[d_i*C + j] + x[i*C + j], i=0,1,2,\ldots,N-1\) and \(j=0,1,2,\ldots,C-1\).

Note
It assumes that y preallocated to a size that is atleast N (i.e., number of discontiguous indices)
Template Parameters
ValueTypethe type of the data to be copies (e.g., int, double, float, complex<double>, etc.)
memorySpaceMemory where both x and y reside (e.g., utils::MemorySpace::HOST, utils::MemorySpace::DEVICE, etc.)
Parameters
[in]srcPointer to the x array (source array)
[out]dstPointer to the y array (destination array)
[in]discontIdsPointer to array containing the discontiguous indices of the destination array ( \(d_i\)'s in the above description)
[in]NNon-negative integer specifying the number of discontiguous indices
[in]nComponentsNumber of components (i.e., \(C\) in the above description)
Note
The dst array is not allocated internally and hence must be pre-allocted appropriately. That is, dst[d_i*C + j] must be a valid memory access for all d_i's and j's
No size size consistency is performed on the src array and must be pre-allocated appropriately. That is, src[i*C + j] must be a valid memory access for all i's and j's
Here is the caller graph for this function:

◆ copyFromDiscontiguousMemory()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::DiscontiguousDataOperations< ValueType, memorySpace >::copyFromDiscontiguousMemory ( const ValueType *  src,
ValueType *  dst,
const size_type discontIds,
const size_type  N,
const size_type  nComponents 
)
static

Function to copy a source array x to a destination array y, where the source is accessed discontiguously but the destination is accessed contiguously. In other words, \( y[i] = x[d_i], i=0,1,2,\ldots,N-1\), where \(\{d_0, d_1, d_2, \ldots, d_{N-1}\}\) define a set of discontiguous indices for x. In practice, we extend the above to multi-component case, wherein both x and \y contain multiple-components for each index. We assume the components to be stored contiguously for each index. Thus, if there are \(C\) components, the function does \( y[i*C + j] = x[d_i*C + j], i=0,1,2,\ldots,N-1\) and \(j=0,1,2,\ldots,C-1\).

Template Parameters
ValueTypethe type of the data to be copies (e.g., int, double, float, complex<double>, etc.)
memorySpaceMemory where both x and y reside (e.g., utils::MemorySpace::HOST, utils::MemorySpace::DEVICE, etc.)
Parameters
[in]srcPointer to the x array (source array)
[out]dstPointer to the y array (destination array)
[in]discontIdsPointer to array containing the discontiguous indices of the source array ( \(d_i\)'s in the above description)
[in]NNon-negative integer specifying the number of discontiguous indices
[in]nComponentsNumber of components (i.e., \(C\) in the above description)
Note
The dst array is not allocated internally and hence must be pre-allocted appropriately. That is, dst[i*C + j] must be s a valid memory access for a i's and j's
No size size consistency is performed on the src array and hemce must be pre-allocated appropriately. That is, src[d_i*C + j] must be s a valid memory access for a d_i's and j's
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyToDiscontiguousMemory()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::DiscontiguousDataOperations< ValueType, memorySpace >::copyToDiscontiguousMemory ( const ValueType *  src,
ValueType *  dst,
const size_type discontIds,
const size_type  N,
const size_type  nComponents 
)
static

Function to copy a source array x to a destination array y, where the source is accessed contiguously but the destination is accessed discontiguously. In other words, \( y[d_i] = x[i], i=0,1,2,\ldots,N-1\), where \(\{d_0, d_1, d_2, \ldots, d_{N-1}\}\) define a set of discontiguous indices for y. In practice, we extend the above to multi-component case, wherein both x and \y contain multiple-components for each index. We assume the components to be stored contiguously for each index. Thus, if there are \(C\) components, the function does \( y[d_i*C + j] = x[i*C + j], i=0,1,2,\ldots,N-1\) and \(j=0,1,2,\ldots,C-1\).

Note
It assumes that y preallocated to a size that is atleast N (i.e., number of discontiguous indices)
Template Parameters
ValueTypethe type of the data to be copies (e.g., int, double, float, complex<double>, etc.)
memorySpaceMemory where both x and y reside (e.g., utils::MemorySpace::HOST, utils::MemorySpace::DEVICE, etc.)
Parameters
[in]srcPointer to the x array (source array)
[out]dstPointer to the y array (destination array)
[in]discontIdsPointer to array containing the discontiguous indices of the destination array ( \(d_i\)'s in the above description)
[in]NNon-negative integer specifying the number of discontiguous indices
[in]nComponentsNumber of components (i.e., \(C\) in the above description)
Note
The dst array is not allocated internally and hence must be pre-allocted appropriately. That is, dst[d_i*C + j] must be a valid memory access for all d_i's and j's
No size size consistency is performed on the src array and must be pre-allocated appropriately. That is, src[i*C + j] must be a valid memory access for all i's and j's
Here is the call graph for this function:
Here is the caller graph for this function:

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