mirror of
https://github.com/matrix-construct/construct
synced 2024-05-29 00:03:45 +02:00
ircd:🆑 Improve code object semantics; handle related.
This commit is contained in:
parent
6033f18694
commit
d2833cb3e2
|
@ -37,8 +37,9 @@ struct ircd::cl::code
|
|||
code(const string_view &src);
|
||||
code() = default;
|
||||
code(code &&) noexcept;
|
||||
code &operator=(const code &) = delete;
|
||||
code(const code &) = delete;
|
||||
code &operator=(code &&) noexcept;
|
||||
code &operator=(const code &) = delete;
|
||||
~code() noexcept;
|
||||
};
|
||||
|
||||
|
@ -61,7 +62,8 @@ noexcept
|
|||
}
|
||||
|
||||
inline ircd::cl::code::operator
|
||||
bool() const
|
||||
bool()
|
||||
const
|
||||
{
|
||||
return handle;
|
||||
}
|
||||
|
|
|
@ -1368,6 +1368,8 @@ ircd::cl::code::code(const vector_view<const string_view> &srcs)
|
|||
count,
|
||||
};
|
||||
|
||||
assert(!handle);
|
||||
|
||||
int err {CL_SUCCESS};
|
||||
handle = clCreateProgramWithSource(primary, count, src, len, &err);
|
||||
throw_on_error(err);
|
||||
|
@ -1414,6 +1416,7 @@ ircd::cl::code::code(const vector_view<const const_buffer> &bins)
|
|||
|
||||
assert(len);
|
||||
assert(devs);
|
||||
assert(!handle);
|
||||
|
||||
int err {CL_SUCCESS};
|
||||
int binerr[iov_max + 1] {CL_SUCCESS};
|
||||
|
@ -1435,6 +1438,8 @@ ircd::cl::code::code(const const_buffer &bc)
|
|||
ircd::data(bc),
|
||||
};
|
||||
|
||||
assert(!handle);
|
||||
|
||||
int err {CL_SUCCESS};
|
||||
handle = clCreateProgramWithIL
|
||||
(
|
||||
|
|
Loading…
Reference in a new issue