#include <cs_mdspan.h>
Collaboration diagram for mdspan< T, N, L >:Public Member Functions | |
| CS_F_HOST_DEVICE | mdspan () |
| Default constructor method leading to "empty container". More... | |
| template<typename... Args> | |
| CS_F_HOST_DEVICE | mdspan (T *data, Args... indices) |
| Constructor method using only global size (works for N=1). More... | |
| CS_F_HOST_DEVICE | mdspan (T *data, const cs_lnum_t(&dims)[N]) |
| Constructor method using dimensions. More... | |
| CS_F_HOST_DEVICE | mdspan (const mdspan &other) |
| Constructor method using copy. May be a shallow copy. More... | |
| CS_F_HOST | mdspan (mdspan &&other) |
| Move constructor. More... | |
| CS_F_HOST_DEVICE | ~mdspan () |
| Desstructor method using dimensions. More... | |
| CS_F_HOST mdspan & | operator= (const mdspan &other) |
| Assignment operator. More... | |
| CS_F_HOST mdspan & | operator= (mdspan &&other) |
| CS_F_HOST_DEVICE T & | operator[] (cs_lnum_t i) |
| Overloaded [] operator to access the ith value (val[i]). More... | |
| CS_F_HOST_DEVICE T & | operator[] (cs_lnum_t i) const |
| Overloaded [] operator to access the ith value (val[i]). More... | |
| template<typename Id1 > | |
| CS_F_HOST_DEVICE std::enable_if_t< cs::always_true< Id1 >::value &&N==1, T & > | operator() (Id1 i) |
| Overloaded () operator to access the ith value (val[i]). More... | |
| template<typename Id1 > | |
| CS_F_HOST_DEVICE std::enable_if_t< cs::always_true< Id1 >::value &&N==1, T & > | operator() (Id1 i) const |
| Overloaded [] operator to access the ith value (val[i]). More... | |
| template<typename Id1 , typename Id2 > | |
| CS_F_HOST_DEVICE std::enable_if_t< cs::always_true< Id1, Id2 >::value &&N==2, T & > | operator() (Id1 i, Id2 j) |
| Overloaded () operator to access the (i,j)-th value couple. More... | |
| template<typename Id1 , typename Id2 > | |
| CS_F_HOST_DEVICE std::enable_if_t< cs::always_true< Id1, Id2 >::value &&N==2, T & > | operator() (Id1 i, Id2 j) const |
| Overloaded () operator to access the (i,j)-th value couple. More... | |
| template<typename... Args> | |
| CS_F_HOST_DEVICE std::enable_if_t< cs::always_true< Args... >::value &&(N!=2) &&(N!=1), T & > | operator() (Args... indices) |
| Overloaded () operator to access the (i,j,k)-th value tuple. More... | |
| template<typename... Args> | |
| CS_F_HOST_DEVICE std::enable_if_t< cs::always_true< Args... >::value &&(N!=2) &&(N!=1), T & > | operator() (Args... indices) const |
| Overloaded () operator to access the (i,j,k)-th value tuple. More... | |
| CS_F_HOST_DEVICE cs_lnum_t | size () |
| Getter for total size. More... | |
| CS_F_HOST_DEVICE cs_lnum_t | size () const |
| Getter for total size. More... | |
| CS_F_HOST_DEVICE cs_lnum_t | extent (int i) |
| Getter for extent along a given dimension. More... | |
| CS_F_HOST_DEVICE cs_lnum_t | extent (int i) const |
| Getter for extent along a given dimension. More... | |
| CS_F_HOST_DEVICE T * | data () |
| Getter for data raw pointer. More... | |
| template<typename U > | |
| CS_F_HOST_DEVICE U * | data () |
| Getter for data raw pointer with recast (casts T* to U*) More... | |
| template<typename... Args> | |
| CS_F_HOST_DEVICE mdspan< T, N-sizeof...(Args), L > | sub_view (Args... indices) |
| Getter for a subspan based on first dimension. More... | |
| template<typename... Args> | |
| CS_F_HOST_DEVICE T * | sub_array (Args... indices) |
| Get sub array based on index. More... | |
| CS_F_HOST void | set_to_val (T val, const cs_lnum_t n_vals=-1) |
| Set all values of the data array to a constant value. More... | |
| CS_F_HOST void | set_to_val (cs_dispatch_context &ctx, T val, const cs_lnum_t n_vals=-1) |
| Set all values of the data array to a constant value while providing a dispatch context. It is up to the call to synchronize the context after this call. More... | |
| CS_F_HOST void | set_to_val_on_subset (T val, const cs_lnum_t n_elts, const cs_lnum_t elt_ids[]) |
| Set subset of values of the data array to a constant value. More... | |
| CS_F_HOST void | set_to_val_on_subset (cs_dispatch_context &ctx, T val, const cs_lnum_t n_elts, const cs_lnum_t elt_ids[]) |
| Set a subset of values of the data array to a constant value while providing a dispatch context. It is up to the call to synchronize the context after this call. More... | |
| CS_F_HOST_DEVICE void | zero () |
| Set all values of the data array to 0. More... | |
| CS_F_HOST_DEVICE void | zero (cs_dispatch_context &ctx) |
| Set all values of the data array to 0. More... | |
| CS_F_HOST_DEVICE void | copy_data (T *data, const cs_lnum_t n_vals=-1) |
| Copy data from raw pointer, we suppose that data size is same as that of the array. More... | |
| CS_F_HOST_DEVICE void | copy_data (const T *data, const cs_lnum_t n_vals=-1) |
| Copy data from const raw pointer, we suppose that data size is same as that of the array. More... | |
| CS_F_HOST_DEVICE void | copy_data (mdspan &other, const cs_lnum_t n_vals=-1) |
| Copy data from another mdspan, we suppose that data size is same as that of the array. An assert test the sizes in debug. More... | |
| CS_F_HOST_DEVICE void | copy_data (cs_dispatch_context &ctx, T *data, const cs_lnum_t n_vals=-1) |
| Copy data from raw pointer, we suppose that data size is same as that of the array. A dispatch_context is provided, hence no implicit synchronization which should be done by the caller. More... | |
| CS_F_HOST_DEVICE void | copy_data (cs_dispatch_context &ctx, const T *data, const cs_lnum_t n_vals=-1) |
| Copy data from const raw pointer, we suppose that data size is same as that of the array. A dispatch_context is provided, hence no implicit synchronization which should be done by the caller. More... | |
| CS_F_HOST_DEVICE void | copy_data (cs_dispatch_context &ctx, mdspan &other, const cs_lnum_t n_vals=-1) |
| Copy data from another mdspan, we suppose that data size is same as that of the array. An assert test the sizes in debug. More... | |
Friends | |
| template<class _T_ , int _N_, layout _L_> | |
| class | array |
| CS_F_HOST friend void | swap (mdspan &first, mdspan &second) |
| Class swap operator used for assignment or move. More... | |
|
inline |
Default constructor method leading to "empty container".
|
inline |
Constructor method using only global size (works for N=1).
| [in] | data | data pointer (raw) |
| [in] | indices | total size of data (1D) |
|
inline |
Constructor method using dimensions.
| [in] | data | data pointer (raw) |
| [in] | dims | array of sizes along dimensions |
|
inline |
Constructor method using copy. May be a shallow copy.
Move constructor.
| [in] | other | reference to other instance |
|
inline |
Desstructor method using dimensions.
|
inline |
Copy data from const raw pointer, we suppose that data size is same as that of the array.
| [in] | data | Pointer to copy |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
|
inline |
Copy data from const raw pointer, we suppose that data size is same as that of the array. A dispatch_context is provided, hence no implicit synchronization which should be done by the caller.
| [in] | ctx | Reference to dispatch context |
| [in] | data | Pointer to copy |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
|
inline |
Copy data from another mdspan, we suppose that data size is same as that of the array. An assert test the sizes in debug.
| [in] | ctx | Reference to dispatch context |
| [in] | other | Reference to another mdspan object |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
|
inline |
Copy data from raw pointer, we suppose that data size is same as that of the array. A dispatch_context is provided, hence no implicit synchronization which should be done by the caller.
| [in] | ctx | Reference to dispatch context |
| [in] | data | Pointer to copy |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
|
inline |
Copy data from another mdspan, we suppose that data size is same as that of the array. An assert test the sizes in debug.
| [in] | other | Reference to another mdspan object |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
|
inline |
Copy data from raw pointer, we suppose that data size is same as that of the array.
| [in] | data | Pointer to copy |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
|
inline |
Getter for data raw pointer.
|
inline |
Getter for data raw pointer with recast (casts T* to U*)
| U | : data type used to cast T* into U* |
|
inline |
Getter for extent along a given dimension.
|
inline |
Getter for extent along a given dimension.
|
inline |
Overloaded () operator to access the (i,j,k)-th value tuple.
| [in] | indices | Input arguments (parameter pack) |
|
inline |
Overloaded () operator to access the (i,j,k)-th value tuple.
| [in] | indices | Input arguments (parameter pack) |
|
inline |
Overloaded () operator to access the ith value (val[i]).
| [in] | i | Index of value to get |
|
inline |
Overloaded [] operator to access the ith value (val[i]).
| [in] | i | Index of value to get |
|
inline |
Overloaded () operator to access the (i,j)-th value couple.
| [in] | i | Index along first dimension |
| [in] | j | Index along second dimension |
|
inline |
Overloaded () operator to access the (i,j)-th value couple.
| [in] | i | Index along first dimension |
| [in] | j | Index along second dimension |
|
inline |
Overloaded [] operator to access the ith value (val[i]).
| [in] | i | Index of value to get |
|
inline |
Overloaded [] operator to access the ith value (val[i]).
| [in] | i | Index of value to get |
|
inline |
Set all values of the data array to a constant value while providing a dispatch context. It is up to the call to synchronize the context after this call.
| ctx | Reference to dispatch context | |
| [in] | val | Value to set to entire data array. |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
Set all values of the data array to a constant value.
| [in] | val | Value to set to entire data array. |
| [in] | n_vals | Number of values to copy. If -1, default, we use array size |
|
inline |
Set a subset of values of the data array to a constant value while providing a dispatch context. It is up to the call to synchronize the context after this call.
| ctx | Reference to dispatch context | |
| [in] | val | Value to set to entire data array. |
| [in] | n_elts | Number of values to set. |
| [in] | elt_ids | list of ids in the subset or null (size:n_elts) |
|
inline |
Set subset of values of the data array to a constant value.
| [in] | val | Value to set to entire data array. |
| [in] | n_elts | Number of values to set. |
| [in] | elt_ids | list of ids in the subset or null (size:n_elts) |
|
inline |
Getter for total size.
|
inline |
Getter for total size.
|
inline |
Get sub array based on index.
| [in] | indices | Input arguments (parameter pack) |
|
inline |
Getter for a subspan based on first dimension.
| [in] | indices | Input arguments (parameter pack) |
|
inline |
Set all values of the data array to 0.
|
inline |
Set all values of the data array to 0.
| ctx | Reference to dispatch context |
|
friend |
Class swap operator used for assignment or move.
| [in] | first | reference to first instance to swap |
| [in] | second | reference to second instance to swap |