| 61 | return get_devices("Xilinx"); |
| 62 | } |
| 63 | cl::Program::Binaries import_binary_file(std::string xclbin_file_name) { |
| 64 | std::cout << "INFO: Importing " << xclbin_file_name << std::endl; |
| 65 | |
| 66 | if (access(xclbin_file_name.c_str(), R_OK) != 0) { |
| 67 | printf("ERROR: %s xclbin not available please build\n", xclbin_file_name.c_str()); |
| 68 | exit(EXIT_FAILURE); |
| 69 | } |
| 70 | // Loading XCL Bin into char buffer |
| 71 | std::cout << "Loading: '" << xclbin_file_name.c_str() << "'\n"; |
| 72 | std::ifstream bin_file(xclbin_file_name.c_str(), std::ifstream::binary); |
| 73 | bin_file.seekg(0, bin_file.end); |
| 74 | unsigned nb = bin_file.tellg(); |
| 75 | bin_file.seekg(0, bin_file.beg); |
| 76 | char* buf = new char[nb]; |
| 77 | bin_file.read(buf, nb); |
| 78 | bin_file.close(); |
| 79 | |
| 80 | cl::Program::Binaries bins; |
| 81 | bins.push_back({buf, nb}); |
| 82 | return bins; |
| 83 | } |
| 84 | |
| 85 | std::string find_binary_file(const std::string& _device_name, const std::string& xclbin_name) { |
| 86 | std::cout << "XCLBIN File Name: " << xclbin_name.c_str() << std::endl; |