| 5984 | #endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) |
| 5985 | |
| 5986 | Program( |
| 5987 | const string& source, |
| 5988 | bool build = false, |
| 5989 | cl_int* err = NULL) |
| 5990 | { |
| 5991 | cl_int error; |
| 5992 | |
| 5993 | const char * strings = source.c_str(); |
| 5994 | const size_type length = source.size(); |
| 5995 | |
| 5996 | Context context = Context::getDefault(err); |
| 5997 | |
| 5998 | object_ = ::clCreateProgramWithSource( |
| 5999 | context(), (cl_uint)1, &strings, &length, &error); |
| 6000 | |
| 6001 | detail::errHandler(error, __CREATE_PROGRAM_WITH_SOURCE_ERR); |
| 6002 | |
| 6003 | if (error == CL_SUCCESS && build) { |
| 6004 | |
| 6005 | error = ::clBuildProgram( |
| 6006 | object_, |
| 6007 | 0, |
| 6008 | NULL, |
| 6009 | #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) |
| 6010 | "-cl-std=CL2.0", |
| 6011 | #else |
| 6012 | "", |
| 6013 | #endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) |
| 6014 | NULL, |
| 6015 | NULL); |
| 6016 | |
| 6017 | detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo<CL_PROGRAM_BUILD_LOG>()); |
| 6018 | } |
| 6019 | |
| 6020 | if (err != NULL) { |
| 6021 | *err = error; |
| 6022 | } |
| 6023 | } |
| 6024 | |
| 6025 | Program( |
| 6026 | const Context& context, |
nothing calls this directly
no test coverage detected