Saves program binaries for future reuse.
| 712 | #ifdef BOOST_COMPUTE_USE_OFFLINE_CACHE |
| 713 | // Saves program binaries for future reuse. |
| 714 | static void save_program_binary(const std::string &hash, const program &prog) |
| 715 | { |
| 716 | std::string fname = detail::program_binary_path(hash, true) + "kernel"; |
| 717 | std::ofstream bfile(fname.c_str(), std::ios::binary); |
| 718 | if (!bfile) return; |
| 719 | |
| 720 | std::vector<unsigned char> binary = prog.binary(); |
| 721 | |
| 722 | size_t binary_size = binary.size(); |
| 723 | bfile.write((char*)&binary_size, sizeof(size_t)); |
| 724 | bfile.write((char*)binary.data(), binary_size); |
| 725 | } |
| 726 | |
| 727 | // Tries to read program binaries from file cache. |
| 728 | static boost::optional<program> load_program_binary( |
nothing calls this directly
no test coverage detected