C++ pressio_data interface.
More...
#include <stdexcept>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <algorithm>
#include "pressio_data.h"
#include "libpressio_ext/cpp/dtype.h"
#include "std_compat/utility.h"
#include "std_compat/optional.h"
Go to the source code of this file.
|
template<class T > |
pressio_data_delete_fn | pressio_new_free_fn () |
|
size_t | data_size_in_elements (size_t dimensions, size_t const dims[]) |
|
size_t | data_size_in_bytes (pressio_dtype type, size_t const dimensions, size_t const dims[]) |
|
template<class ReturnType , class Function > |
ReturnType | pressio_data_for_each (pressio_data const &data, Function &&f) |
|
template<class ReturnType , class Function > |
ReturnType | pressio_data_for_each (pressio_data &data, Function &&f) |
|
template<class ReturnType , class Function > |
ReturnType | pressio_data_for_each (pressio_data const &data, pressio_data const &data2, Function &&f) |
|
template<class ReturnType , class Function > |
ReturnType | pressio_data_for_each (pressio_data &data, pressio_data &data2, Function &&f) |
|
C++ pressio_data interface.
◆ data_size_in_bytes()
size_t data_size_in_bytes |
( |
pressio_dtype |
type, |
|
|
size_t const |
dimensions, |
|
|
size_t const |
dims[] |
|
) |
| |
- Parameters
-
[in] | type | the dtype of the data object |
[in] | dimensions | the number of dimensions of the data object |
[in] | dims | the actual of dimensions of the data object |
- Returns
- the size of a data object in bytes
◆ data_size_in_elements()
size_t data_size_in_elements |
( |
size_t |
dimensions, |
|
|
size_t const |
dims[] |
|
) |
| |
- Parameters
-
[in] | dimensions | the number of dimensions of the data object |
[in] | dims | the actual of dimensions of the data object |
- Returns
- the size of a data object in elements
◆ pressio_data_for_each() [1/4]
template<class ReturnType , class Function >
ReturnType pressio_data_for_each |
( |
pressio_data & |
data, |
|
|
Function && |
f |
|
) |
| |
get beginning and end pointers for two input data values
- Parameters
-
[in] | data | first input data set |
[in] | f | templated function to call, it must return the same type regardless of the type of the inputs. it should have the signature template <class T> f(T* input_begin, T* input_end)
|
◆ pressio_data_for_each() [2/4]
template<class ReturnType , class Function >
get beginning and end pointers for two input data values
- Parameters
-
[in] | data | first input data set |
[in] | data2 | second input data set |
[in] | f | templated function to call, it must return the same type regardless of the type of the inputs. it should have the signature template <class T, class U> ReturnType f(T* input_begin, T* input_end, T* input2_begin) where U is some type
|
◆ pressio_data_for_each() [3/4]
template<class ReturnType , class Function >
ReturnType pressio_data_for_each |
( |
pressio_data const & |
data, |
|
|
Function && |
f |
|
) |
| |
get beginning and end pointers for two input data values
- Parameters
-
[in] | data | first input data set |
[in] | f | templated function to call, it must return the same type regardless of the type of the inputs. it should have the signature template <class T> f(T* input_begin, T* input_end)
|
◆ pressio_data_for_each() [4/4]
template<class ReturnType , class Function >
get beginning and end pointers for two input data values
- Parameters
-
[in] | data | first input data set |
[in] | data2 | second input data set |
[in] | f | templated function to call, it must return the same type regardless of the type of the inputs. it should have the signature template <class T, class U> ReturnType f(T* input_begin, T* input_end, T* input2_begin) where U is some type
|
◆ pressio_new_free_fn()
pressio_data_delete_fn for handling deleting data allocated with new T[];