This example show how to output a vector in FasTensor .
#include <iostream>
#include <stdarg.h>
#include <vector>
#include <stdlib.h>
using namespace std;
#define INPUT_CHK_ROWS 4
#define INPUT_CHK_COLS 4
#define OUTPUT_VEC_ROWS 2
#define OUTPUT_VEC_COLS 2
{
{
{
}
}
oStencil = temp_vec;
std::vector<size_t> vector_shape(2);
return oStencil;
}
int main(
int argc,
char *argv[])
{
std::vector<int> chunk_size = {4, 4};
std::vector<int> overlap_size = {0, 0};
Array<float> *A = new Array<float>("EP_HDF5:./test-data/testf-16x16-vector-2d.h5:/testg/testd", chunk_size, overlap_size);
Array<float> *B = new Array<float>("EP_HDF5:./test-data/testf-16x16-vector-2d-output.h5:/testg/testd");
std::vector<int> skip_size = {4, 4};
A->EnableApplyStride(skip_size);
delete A;
delete B;
return 0;
}
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_2d.cpp:148
#define OUTPUT_VEC_ROWS
Definition: ft_example_vector_2d.cpp:105
#define OUTPUT_VEC_COLS
Definition: ft_example_vector_2d.cpp:106
Stencil< std::vector< float > > udf_vector_2d(const Stencil< float > &iStencil)
UDF to support output of 2D vector.
Definition: ft_example_vector_2d.cpp:114
void PrintVector(std::string name, std::vector< T > v)
Definition: ft_utility.h:165
Definition: ft_array.h:113