Skip to content

Commit 2492ce9

Browse files
committed
fix[shared_library] : Print on a file, because print don't work with ctypes
1 parent 3a0c43d commit 2492ce9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hls4ml/templates/vitis_accelerator/myproject_host_cl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include <string>
2+
#include <cstdio>
3+
#include <iostream>
24

35
#include "FpgaObj.hpp"
46
#include "Params.hpp"
@@ -11,6 +13,10 @@ extern "C" void predict(double *input, uint64_t input_size, double *output, uint
1113
int argc = 2;
1214
char *argv[] = {const_cast<char *>("host"), const_cast<char *>("myproject.xclbin")};
1315

16+
// Redirect stdout to a file - For debugging purposes
17+
freopen("c_log.txt","w",stdout);
18+
std::cout << "Entered shared function !" << std::endl;
19+
1420
Params params(argc, argv);
1521

1622
FpgaObj<in_buffer_t, out_buffer_t> fpga(params);

0 commit comments

Comments
 (0)