MCPcopy Create free account
hub / github.com/boostorg/compute / create_with_binary

Method create_with_binary

include/boost/compute/program.hpp:439–462  ·  view source on GitHub ↗

Creates a new program with \p binary of \p binary_size in \p context. \see_opencl_ref{clCreateProgramWithBinary}

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 5

opencl_errorClass · 0.85
programClass · 0.85
idMethod · 0.45
get_deviceMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected