diff --git a/include/ircd/cl.h b/include/ircd/cl.h index f886e3fa2..1da8f1692 100644 --- a/include/ircd/cl.h +++ b/include/ircd/cl.h @@ -76,8 +76,8 @@ struct ircd::cl::code public: void build(const string_view &opts = {}); - code(const vector_view &srcs); - code(const string_view &src); + code(const vector_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; diff --git a/ircd/cl.cc b/ircd/cl.cc index 791e07b0c..54cde1257 100644 --- a/ircd/cl.cc +++ b/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(&src, 1) + vector_view(&src, 1), + build_opts } { } -ircd::cl::code::code(const vector_view &srcs) +ircd::cl::code::code(const vector_view &srcs, + const string_view &build_opts) { static const size_t iov_max { @@ -498,6 +501,9 @@ ircd::cl::code::code(const vector_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)