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