Creates a new program with \p binary of \p binary_size in \p context. \see_opencl_ref{clCreateProgramWithBinary}
| 437 | /// |
| 438 | /// \see_opencl_ref{clCreateProgramWithBinary} |
| 439 | static program create_with_binary(const unsigned char *binary, |
| 440 | size_t binary_size, |
| 441 | const context &context) |
| 442 | { |
| 443 | const cl_device_id device = context.get_device().id(); |
| 444 | |
| 445 | cl_int error = 0; |
| 446 | cl_int binary_status = 0; |
| 447 | cl_program program_ = clCreateProgramWithBinary(context, |
| 448 | uint_(1), |
| 449 | &device, |
| 450 | &binary_size, |
| 451 | &binary, |
| 452 | &binary_status, |
| 453 | &error); |
| 454 | if(!program_){ |
| 455 | BOOST_THROW_EXCEPTION(opencl_error(error)); |
| 456 | } |
| 457 | if(binary_status != CL_SUCCESS){ |
| 458 | BOOST_THROW_EXCEPTION(opencl_error(binary_status)); |
| 459 | } |
| 460 | |
| 461 | return program(program_, false); |
| 462 | } |
| 463 | |
| 464 | /// Creates a new program with \p binary in \p context. |
| 465 | /// |
nothing calls this directly
no test coverage detected