Skip to content
Snippets Groups Projects
Commit 8e63c9ff authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add DestructuringBindingsForFieldClass to use pystencils kernels in a more C++-ish way

DestructuringBindingsForFieldClass defines all field-related variables
in its subordinated block.
However, it leaves a TypedSymbol of type 'Field' for each field
undefined.
By that trick we can generate kernels that accept structs as
kernelparameters.
Either to include a pystencils specific Field struct of the following
definition:

```cpp
template<DTYPE_T, DIMENSION>
struct Field
{
    DTYPE_T* data;
    std::array<DTYPE_T, DIMENSION> shape;
    std::array<DTYPE_T, DIMENSION> stride;
}

or to be able to destructure user defined types like `pybind11::array`,
`at::Tensor`, `tensorflow::Tensor`

```
parent 8c4a6f1e
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment