Returns the binary for the program.
| 162 | |
| 163 | /// Returns the binary for the program. |
| 164 | std::vector<unsigned char> binary() const |
| 165 | { |
| 166 | size_t binary_size = get_info<size_t>(CL_PROGRAM_BINARY_SIZES); |
| 167 | std::vector<unsigned char> binary(binary_size); |
| 168 | |
| 169 | unsigned char *binary_ptr = &binary[0]; |
| 170 | cl_int error = clGetProgramInfo(m_program, |
| 171 | CL_PROGRAM_BINARIES, |
| 172 | sizeof(unsigned char **), |
| 173 | &binary_ptr, |
| 174 | 0); |
| 175 | if(error != CL_SUCCESS){ |
| 176 | BOOST_THROW_EXCEPTION(opencl_error(error)); |
| 177 | } |
| 178 | |
| 179 | return binary; |
| 180 | } |
| 181 | |
| 182 | std::vector<device> get_devices() const |
| 183 | { |