Creates a new program with \p source in \p context. \see_opencl_ref{clCreateProgramWithSource}
| 368 | /// |
| 369 | /// \see_opencl_ref{clCreateProgramWithSource} |
| 370 | static program create_with_source(const std::string &source, |
| 371 | const context &context) |
| 372 | { |
| 373 | const char *source_string = source.c_str(); |
| 374 | |
| 375 | cl_int error = 0; |
| 376 | cl_program program_ = clCreateProgramWithSource(context, |
| 377 | uint_(1), |
| 378 | &source_string, |
| 379 | 0, |
| 380 | &error); |
| 381 | if(!program_){ |
| 382 | BOOST_THROW_EXCEPTION(opencl_error(error)); |
| 383 | } |
| 384 | |
| 385 | return program(program_, false); |
| 386 | } |
| 387 | |
| 388 | /// Creates a new program with \p sources in \p context. |
| 389 | /// |
nothing calls this directly
no test coverage detected