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