#include <iostream>
#include <stdarg.h>
#include <vector>
#include <stdlib.h>
#include <time.h>
#include <random>
using namespace std;
template <class T>
{
oStencil = iStencil(0, 0) * 2.0;
return oStencil;
}
#define S(O, TYPE) static_cast<Array<TYPE> *>(O)
int main(
int argc,
char *argv[])
{
std::vector<int> chunk_size = {4, 16};
std::vector<int> overlap_size = {1, 1};
bool is_float = false;
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_real_distribution<> dis(0, 1.0);
double r = dis(gen);
std::cout << r << "\n";
if (r > 0.5)
{
is_float = true;
std::cout << "View data as float !\n";
Abase = new Array<float>("EP_HDF5:./test-data/testf-16x16-hello-world.h5:/testg/testd", chunk_size, overlap_size);
}
else
{
std::cout << "View data as int !\n";
Abase = new Array<int>("EP_HDF5:./test-data/testf-16x16-hello-world-int.h5:/testg/testd", chunk_size, overlap_size);
}
Array<float> *B = new Array<float>("EP_HDF5:./test-data/testf-16x16-hello-world-output.h5:/testg/testd");
delete Abase;
delete B;
return 0;
}
the object to the ArrayBase
Definition: ft_array.h:146
virtual int ControlEndpoint(int cmd_p)=0
virtual void ReportCost()=0
Definition: ft_stencil.h:100
#define AU_Init(argc, argv)
Definition: ft.h:112
#define AU_Finalize()
Definition: ft.h:113
#define TRANSFORM(A_BASE_OBJECT, UDF, B, A_TYPE, UDF_OUT_TYPE)
transform the ArrayBase object to one with the type A_TYPE can call the transform function
Definition: ft_array.h:120
#define OP_CREATE_VIS_SCRIPT
Definition: ft_endpoint.h:96
int main(int argc, char *argv[])
Definition: ft_example_base.cpp:114
Stencil< float > udf_hello_world(const Stencil< T > &iStencil)
Definition: ft_example_base.cpp:105
AuEndpointDataType
Definition: ft_type.h:118
@ AU_FLOAT
Definition: ft_type.h:128
@ AU_INT
Definition: ft_type.h:121
Definition: ft_array.h:113