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

Method create_with_binary_file

include/boost/compute/program.hpp:476–490  ·  view source on GitHub ↗

Creates a new program with \p file in \p context. \see_opencl_ref{clCreateProgramWithBinary}

Source from the content-addressed store, hash-verified

474 ///
475 /// \see_opencl_ref{clCreateProgramWithBinary}
476 static program create_with_binary_file(const std::string &file,
477 const context &context)
478 {
479 // open file stream
480 std::ifstream stream(file.c_str(), std::ios::in | std::ios::binary);
481
482 // read binary
483 std::vector<unsigned char> binary(
484 (std::istreambuf_iterator<char>(stream)),
485 std::istreambuf_iterator<char>()
486 );
487
488 // create program
489 return create_with_binary(&binary[0], binary.size(), context);
490 }
491
492 #if defined(CL_VERSION_1_2) || defined(BOOST_COMPUTE_DOXYGEN_INVOKED)
493 /// Creates a new program with the built-in kernels listed in

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected