Skip to content
Snippets Groups Projects
Commit 430af8df authored by auphelia's avatar auphelia
Browse files

[Code Gen] Added template for single node code generation and deleted...

[Code Gen] Added template for single node code generation and deleted redundant lines in example cpp file
parent 0aa40d0a
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,41 @@
def execute(node, context, graph):
# template for single node execution
docompute_template= """
#include "cnpy.h"
#include <vector>
#include "bnn-library.h"
// includes for network parameters
$GLOBALS$
// defines for network parameters
$DEFINES$
int main(){
typedef struct{
ap_uint<$STREAMWIDTH$> last_data;
std::vector<ap_uint<$STREAMWIDTH$>> data;
} output_interface;
output_interface k;
$READNPYDATA$
$STREAMDECLARATIONS$
$STREAMPRAGMAS$
$DATAINSTREAM$
$DOCOMPUTE$
$DATAOUTSTREAM$
$SAVEASCNPY$
}
"""
print("\n\n Set up for code generation of single not in progress! \n\n")
#include "cnpy.h"
#include<complex>
#include<cstdlib>
#include<map>
#include <vector>
#include "bnn-library.h"
#include "maxpool.h"
......@@ -14,10 +11,8 @@ int main(){
typedef struct{
ap_uint<2> last_data;
std::vector<ap_uint<2>> data;
bool valid;
bool invert;
} input_interface;
input_interface i, k;
} output_interface;
output_interface k;
cnpy::NpyArray arr = cnpy::npy_load("input_0.npy");
float* loaded_data = arr.data<float>();
int Nx = arr.shape[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment