libpressio 0.93.0
Loading...
Searching...
No Matches
Classes | Functions
data.h File Reference

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"
Include dependency graph for data.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pressio_data
 

Functions

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)
 

Detailed Description

C++ pressio_data interface.

Function Documentation

◆ data_size_in_bytes()

size_t data_size_in_bytes ( pressio_dtype  type,
size_t const  dimensions,
size_t const  dims[] 
)
Parameters
[in]typethe dtype of the data object
[in]dimensionsthe number of dimensions of the data object
[in]dimsthe 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]dimensionsthe number of dimensions of the data object
[in]dimsthe 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]datafirst input data set
[in]ftemplated 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 >
ReturnType pressio_data_for_each ( pressio_data data,
pressio_data data2,
Function &&  f 
)

get beginning and end pointers for two input data values

Parameters
[in]datafirst input data set
[in]data2second input data set
[in]ftemplated 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]datafirst input data set
[in]ftemplated 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 >
ReturnType pressio_data_for_each ( pressio_data const &  data,
pressio_data const &  data2,
Function &&  f 
)

get beginning and end pointers for two input data values

Parameters
[in]datafirst input data set
[in]data2second input data set
[in]ftemplated 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()

template<class T >
pressio_data_delete_fn pressio_new_free_fn ( )

pressio_data_delete_fn for handling deleting data allocated with new T[];