MCPcopy Create free account
hub / github.com/Xilinx/xfopencv / import_binary_file

Function import_binary_file

examples_sdaccel/histequalize/xcl2.cpp:64–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 return get_devices("Xilinx");
63}
64cl::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
86std::string
87find_binary_file(const std::string& _device_name, const std::string& xclbin_name)

Callers 1

mainFunction · 0.70

Calls 1

readMethod · 0.80

Tested by

no test coverage detected