#include "idb_streamc.hpp"
#include "test_kc.hpp"
// this defines the function "testProgram"
// as a stream program
STREAMPROG(testProgram);
// this stream program is a simple example
// that calls the addAndSum kernel twice
// all stream programs must have only these arguments
streamprog testProgram( String args)
//Macroprogram testProgram(String args)
{
// print the arguments (otherwise unused)
cout // declare two streams of 32 integers
// note that these are streams of "im_int"
// the Imagine integer type not "int"
im_stream s1(32);
im_stream s2(32);
// initialize the input stream from an array
int data[32];
for (int i = 0; i < 32; i++) {
data[i] = i;
}
//streamLoadBin(data, s1);
streamLoadBin(data, 32, s1);
// declare a microcontroller variable
im_uc uc_sum = 0;
// declare a stream of 32 integers
im_stream temp(32);
// call the addAndSum kernel twice
addAndSum(s1, s1, temp, uc_sum);
addAndSum(s1, temp, s2, uc_sum);
// save the output and display it
streamSaveBin(data, s2);
for (int i = 0; i < 32; i++) {
cout }
cout cout }