| 90 | "); |
| 91 | |
| 92 | Program buildProgram(span<const string> kernelSources, |
| 93 | span<const string> compileOpts) { |
| 94 | Program retVal; |
| 95 | try { |
| 96 | auto device = getDevice(); |
| 97 | Program::Sources sources; |
| 98 | sources.emplace_back(DEFAULT_MACROS_STR); |
| 99 | sources.emplace_back(KParam_hpp, KParam_hpp_len); |
| 100 | sources.insert(end(sources), begin(kernelSources), end(kernelSources)); |
| 101 | |
| 102 | retVal = Program(getContext(), sources); |
| 103 | |
| 104 | ostringstream options; |
| 105 | for (auto &opt : compileOpts) { options << opt; } |
| 106 | options << getActiveDeviceBaseBuildFlags(); |
| 107 | retVal.build({device}, (options.str()).c_str()); |
| 108 | } catch (Error &err) { |
| 109 | if (err.err() == CL_BUILD_PROGRAM_FAILURE) { |
| 110 | THROW_BUILD_LOG_EXCEPTION(retVal); |
| 111 | } |
| 112 | throw; |
| 113 | } |
| 114 | return retVal; |
| 115 | } |
| 116 | |
| 117 | string getProgramBuildLog(const Program &prog) { |
| 118 | string build_error(""); |
no test coverage detected