0
0
Fork 0
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:
Jason Volk 2022-04-23 19:41:10 -07:00
parent 6033f18694
commit d2833cb3e2
2 changed files with 9 additions and 2 deletions

View file

@ -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;
}

View file

@ -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
(