| 107 | } |
| 108 | |
| 109 | char* read_binary_file(const std::string &xclbin_file_name, unsigned &nb) |
| 110 | { |
| 111 | std::cout << "INFO: Reading " << xclbin_file_name << std::endl; |
| 112 | |
| 113 | if(access(xclbin_file_name.c_str(), R_OK) != 0) { |
| 114 | printf("ERROR: %s xclbin not available please build\n", xclbin_file_name.c_str()); |
| 115 | exit(EXIT_FAILURE); |
| 116 | } |
| 117 | //Loading XCL Bin into char buffer |
| 118 | std::cout << "Loading: '" << xclbin_file_name.c_str() << "'\n"; |
| 119 | std::ifstream bin_file(xclbin_file_name.c_str(), std::ifstream::binary); |
| 120 | bin_file.seekg (0, bin_file.end); |
| 121 | nb = bin_file.tellg(); |
| 122 | bin_file.seekg (0, bin_file.beg); |
| 123 | char *buf = new char [nb]; |
| 124 | bin_file.read(buf, nb); |
| 125 | return buf; |
| 126 | } |
| 127 | }; |
| 128 | |
| 129 | void AdagradCPU( |