MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / compile

Method compile

compute/include/boost/compute/program.hpp:290–333  ·  view source on GitHub ↗

Compiles the program with \p options. \opencl_version_warning{1,2} \see_opencl_ref{clCompileProgram}

Source from the content-addressed store, hash-verified

288 ///
289 /// \see_opencl_ref{clCompileProgram}
290 void compile(const std::string &options = std::string(),
291 const std::vector<std::pair<std::string, program> > &headers =
292 std::vector<std::pair<std::string, program> >())
293 {
294 const char *options_string = 0;
295
296 if(!options.empty()){
297 options_string = options.c_str();
298 }
299
300 cl_int ret;
301 if (headers.empty())
302 {
303 ret = clCompileProgram(
304 m_program, 0, 0, options_string, 0, 0, 0, 0, 0
305 );
306 }
307 else
308 {
309 std::vector<const char*> header_names(headers.size());
310 std::vector<cl_program> header_programs(headers.size());
311 for (size_t i = 0; i < headers.size(); ++i)
312 {
313 header_names[i] = headers[i].first.c_str();
314 header_programs[i] = headers[i].second.m_program;
315 }
316
317 ret = clCompileProgram(
318 m_program,
319 0,
320 0,
321 options_string,
322 static_cast<cl_uint>(headers.size()),
323 header_programs.data(),
324 header_names.data(),
325 0,
326 0
327 );
328 }
329
330 if(ret != CL_SUCCESS){
331 BOOST_THROW_EXCEPTION(opencl_error(ret));
332 }
333 }
334
335 /// Links the programs in \p programs with \p options in \p context.
336 ///

Callers 2

check_dependiciesFunction · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45

Calls 4

opencl_errorClass · 0.85
dataMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.36