This example show how to deal with multiple datasets in FasTensor .
#include <iostream>
#include <stdarg.h>
#include <vector>
#include <stdlib.h>
using namespace std;
{
int i;
int j;
int k;
};
{
int i;
int j;
int k;
float ave;
};
{
ovds.
i = iStencil(0, 0).i;
ovds.
j = iStencil(0, 0).j;
ovds.
k = iStencil(0, 0).k;
ovds.
ave = (iStencil(0, 0).i + iStencil(0, 0).j + iStencil(0, 0).k) / 3.0;
oStencil = ovds;
return oStencil;
}
int main(
int argc,
char *argv[])
{
std::vector<int> chunk_size = {4, 16};
std::vector<int> overlap_size = {1, 1};
Array<InputStruct> *A = new Array<InputStruct>(chunk_size, overlap_size);
A->PushBackAttribute<int>("EP_HDF5:./test-data/testf-16x16-vds.h5:/testg/x");
A->PushBackAttribute<int>("EP_HDF5:./test-data/testf-16x16-vds.h5:/testg/y");
A->PushBackAttribute<int>("EP_HDF5:./test-data/testf-16x16-vds.h5:/testg/z");
A->PrintEndpointInfo();
std::cout << A->GetValue(0, 0) << "\n";
Array<OutputStruct> *B = new Array<OutputStruct>();
B->PushBackAttribute<int>("EP_HDF5:./test-data/testf-16x16-vds-output.h5:/testg/x");
B->PushBackAttribute<int>("EP_HDF5:./test-data/testf-16x16-vds-output.h5:/testg/y");
B->PushBackAttribute<int>("EP_HDF5:./test-data/testf-16x16-vds-output.h5:/testg/z");
B->PushBackAttribute<float>("EP_HDF5:./test-data/testf-16x16-vds-output.h5:/testg/ave");
B->PrintEndpointInfo();
delete A;
delete B;
return 0;
}
Definition: ft_stencil.h:100
#define AU_Init(argc, argv)
Definition: ft.h:112
#define AU_Finalize()
Definition: ft.h:113
int main(int argc, char *argv[])
Definition: ft_example_vds.cpp:133
Stencil< OutputStruct > udf_vds(const Stencil< InputStruct > &iStencil)
Definition: ft_example_vds.cpp:119
#define AU_UDT_INIT(A)
Definition: ft_type.h:255
Definition: ft_array.h:113
Definition: ft_example_cmpd.cpp:112
int i
Definition: ft_example_cmpd.cpp:114
float ave
Definition: ft_example_vds.cpp:115
int j
Definition: ft_example_vds.cpp:113
int k
Definition: ft_example_vds.cpp:114