Some small changes to Compute graph API to define structured datatype.
Some small changes to take into account google colab new version numbers
for the packages.
* `python_name` is the name of the Python class implementing this type (when you generate a Python schedule)
* `size_in_bytes` is the size of the struct. It should take into account padding. It is used in case of buffer sharing since the datatype of the shared buffer is `int8_t`. The Python script must be able to compute the size of those buffers and needs to know the size of the structure.
* `size_in_bytes` is the size of the struct. It should take into account padding. It is used in case of buffer sharing since the datatype of the shared buffer is `int8_t`. The Python script must be able to compute the size of those buffers and needs to know the size of the structure including padding.
In Python, there is no `struct`. This datatype is mapped to an object. Object have reference type. Compute graph FIFOs are assuming a value type semantic.
## PythonClassType
As consequence, in Python side you should never copy those structs since it would copy the reference. You should instead copy the members of the struct.
```python
def __init__(self,python_name)
```
In Python, there is no `struct`. This datatype is mapped to an object. Object have reference type. Compute graph FIFOs are assuming a value type semantic.
If you don't plan on generating a Python scheduler, you can just use whatever name you want for the `python_name`. It will be ignored by the C++ code generation.
As consequence, in Python side you should never copy those structs since it would copy the reference. You should instead copy the members of the struct and they should be scalar values.
## Function and constant nodes
# Function and constant nodes
A Compute graph C++ wrapper is useful when the software components you use have a state that needs to be initialized in the C++ constructor, and preserved between successive calls to the `run` method of the wrapper.
This is defining a new datatype that is mapped to the type `complex` in C/C++ and the class `MyComplex` in Python. The last argument is the size in bytes of the struct in C.
This is defining a new datatype that is mapped to the type `complex` in C/C++.
The last argument is the size in bytes of the struct in C.
The type complex may be defined with:
@ -26,6 +30,15 @@ typedef struct {
} complex;
```
For the Python version of the scheduler:
```python
complexType=PythonClassType("MyComplex")
```
The class `MyComplex` is used in Python.
**Note that:**
- The value **must have** value semantic in C/C++. So avoid classes
@ -8,7 +8,7 @@ Some tests to validate some parts of the Compute graph. They all rely on the CMS
* Create a complex graph containing all classes defined in `GenericNodes.h` (synchronous mode). Used to test that it builds and that there are no errors in the templates
* Create a complex graph containing all classes defined in `GenericNodes.h` (ssynchronous mode). Used to test that it builds and that there are no errors in the templates
* Create a complex graph containing all classes defined in `GenericNodes.h` (asynchronous mode). Used to test that it builds and that there are no errors in the templates
* Create a graph with FFT / IFFT : the graph is decomposing a signal and rebuilding it. It is used to test the performance of different FIFOs implementations (synchronous mode)