MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / read_binary_file

Function read_binary_file

hls_smartInfinity/src/host/host_step_adagrad.cpp:109–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
129void AdagradCPU(

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected