mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd:🆑 Build code on construction unless coerced otherwise.
This commit is contained in:
parent
4da7d2ae43
commit
dea1118bda
2 changed files with 11 additions and 5 deletions
|
@ -76,8 +76,8 @@ struct ircd::cl::code
|
|||
public:
|
||||
void build(const string_view &opts = {});
|
||||
|
||||
code(const vector_view<const string_view> &srcs);
|
||||
code(const string_view &src);
|
||||
code(const vector_view<const string_view> &srcs, const string_view &opts = {});
|
||||
code(const string_view &src, const string_view &opts = {});
|
||||
code() = default;
|
||||
code(code &&) noexcept;
|
||||
code &operator=(const code &) = delete;
|
||||
|
|
12
ircd/cl.cc
12
ircd/cl.cc
|
@ -461,15 +461,18 @@ ircd::cl::kern::arg(const int i,
|
|||
// code
|
||||
//
|
||||
|
||||
ircd::cl::code::code(const string_view &src)
|
||||
ircd::cl::code::code(const string_view &src,
|
||||
const string_view &build_opts)
|
||||
:code
|
||||
{
|
||||
vector_view<const string_view>(&src, 1)
|
||||
vector_view<const string_view>(&src, 1),
|
||||
build_opts
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::cl::code::code(const vector_view<const string_view> &srcs)
|
||||
ircd::cl::code::code(const vector_view<const string_view> &srcs,
|
||||
const string_view &build_opts)
|
||||
{
|
||||
static const size_t iov_max
|
||||
{
|
||||
|
@ -498,6 +501,9 @@ ircd::cl::code::code(const vector_view<const string_view> &srcs)
|
|||
int err {CL_SUCCESS};
|
||||
handle = clCreateProgramWithSource(primary, count, src, len, &err);
|
||||
throw_on_error(err);
|
||||
|
||||
if(!null(build_opts))
|
||||
build(build_opts);
|
||||
}
|
||||
|
||||
ircd::cl::code::code(code &&o)
|
||||
|
|
Loading…
Reference in a new issue