This example show how to output a vector in FasTensor .
#include <iostream>
#include <stdarg.h>
#include <vector>
#include <stdlib.h>
using namespace std;
#define VEC_SIZE 8
{
{
temp_vec[i] = iStencil(0, i) * 2.0;
}
oStencil = temp_vec;
std::vector<size_t> vector_shape(2);
vector_shape[0] = 1;
return oStencil;
}
int main(
int argc,
char *argv[])
{
std::vector<int> chunk_size = {4, 16};
std::vector<int> overlap_size = {0, 0};
FT::Array<float> *A =
new Array<float>(
"EP_HDF5:./test-data/testf-16x16-vector.h5:/testg/testd", chunk_size, overlap_size);
FT::Array<float> *B =
new Array<float>(
"EP_HDF5:./test-data/testf-16x16-vector-output.h5:/testg/testd");
std::vector<int> skip_size = {1, 16};
delete A;
delete B;
return 0;
}
Definition: ft_array.h:163
void Transform(Stencil< UDFOutputType >(*UDF)(const Stencil< T > &), Array< BType > &B)
Definition: ft_array.h:771
int EnableApplyStride(const std::vector< int > &skip_size_p)
Definition: ft_array.h:1665
Definition: ft_stencil.h:100
int SetShape(const std::vector< size_t > &shape_p)
Set the Shape of the Stencil object.
Definition: ft_stencil.h:1160
#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_vector.cpp:126
#define VEC_SIZE
Definition: ft_example_vector.cpp:99
Stencil< std::vector< float > > udf_vector(const Stencil< float > &iStencil)
UDF to support output of vector.
Definition: ft_example_vector.cpp:107
Definition: ft_array.h:113