MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / Program

Method Program

include/CL/opencl.hpp:6053–6090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6051#endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY)
6052
6053 Program(
6054 const string& source,
6055 bool build = false,
6056 cl_int* err = nullptr)
6057 {
6058 cl_int error;
6059
6060 const char * strings = source.c_str();
6061 const size_type length = source.size();
6062
6063 Context context = Context::getDefault(err);
6064
6065 object_ = ::clCreateProgramWithSource(
6066 context(), (cl_uint)1, &strings, &length, &error);
6067
6068 detail::errHandler(error, __CREATE_PROGRAM_WITH_SOURCE_ERR);
6069
6070 if (error == CL_SUCCESS && build) {
6071
6072 error = ::clBuildProgram(
6073 object_,
6074 0,
6075 nullptr,
6076#if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD)
6077 "-cl-std=CL2.0",
6078#else
6079 "",
6080#endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD)
6081 nullptr,
6082 nullptr);
6083
6084 detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo<CL_PROGRAM_BUILD_LOG>());
6085 }
6086
6087 if (err != nullptr) {
6088 *err = error;
6089 }
6090 }
6091
6092 Program(
6093 const Context& context,

Callers

nothing calls this directly

Calls 8

errHandlerFunction · 0.85
clBuildProgramFunction · 0.85
buildErrHandlerFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected