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