The following code example shows how the widget_real2complex graph class can be used within a user super-graph, including how to set the runtime<ratio> of internal kernels. This example shows the widget configured to convert a window of int16 samples to cint16 samples.
#include <adf.h>
#include "widget_real2complex_graph.hpp"
#define DATA_IN_TYPE int16
#define DATA_OUT_TYPE cint16
#define WINDOW_VSIZE_W_R2C 1024
using namespace adf;
namespace widgr2c_example {
class test_widg_r2c : public adf::graph {
public:
port<input> in;
port<output> out;
xf::dsp::aie::widget::real2complex::widget_real2complex_graph<DATA_IN_TYPE, DATA_OUT_TYPE, WINDOW_VSIZE_W_R2C>
widget;
test_widg_r2c() {
connect<>(in, widget.in);
connect<>(widget.out, out);
kernel* kernels = widget.getKernels();
runtime<ratio>(*kernels) = 0.5;
};
};
};