mirror of
https://github.com/matrix-construct/construct
synced 2024-05-18 10:53:48 +02:00
ircd:🆑 Enable configure by default; disable runtime by default.
This commit is contained in:
parent
78133c59cd
commit
1d46cf9f5f
12
configure.ac
12
configure.ac
|
@ -2253,16 +2253,16 @@ PKG_CHECK_MODULES(MesaOpenCL, [MesaOpenCL],
|
|||
])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to enable use of any found OpenCL)
|
||||
AC_ARG_ENABLE(opencl, RB_HELP_STRING([--enable-opencl], [Enable OpenCL support]),
|
||||
AC_MSG_CHECKING(whether to disable use of any found OpenCL)
|
||||
AC_ARG_ENABLE(opencl, RB_HELP_STRING([--disable-opencl], [Disable OpenCL support]),
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
enable_opencl="yes"
|
||||
opencl_enable="enabled"
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
enable_opencl="no"
|
||||
opencl_enable="disabled"
|
||||
], [
|
||||
AC_MSG_RESULT([yes])
|
||||
enable_opencl="yes"
|
||||
opencl_enable="enabled"
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([OPENCL], [test "x$have_opencl" = "xyes" && test "x$enable_opencl" = "xyes" ])
|
||||
|
|
20
ircd/cl.cc
20
ircd/cl.cc
|
@ -18,6 +18,8 @@ namespace ircd::cl
|
|||
static int throw_on_error(const int &code);
|
||||
template<class func, class... args> static int call(func&&, args&&...);
|
||||
template<class T = string_view, class F, class id, class param> static T info(F&&, const id &, const param &, const mutable_buffer &);
|
||||
|
||||
extern conf::item<bool> enable;
|
||||
}
|
||||
|
||||
// Runtime state
|
||||
|
@ -79,12 +81,30 @@ ircd::cl::version_abi
|
|||
"OpenCL", info::versions::ABI
|
||||
};
|
||||
|
||||
decltype(ircd::cl::enable)
|
||||
ircd::cl::enable
|
||||
{
|
||||
{ "name", "ircd.cl.enable" },
|
||||
{ "default", false },
|
||||
{ "persist", false },
|
||||
};
|
||||
|
||||
//
|
||||
// init
|
||||
//
|
||||
|
||||
ircd::cl::init::init()
|
||||
{
|
||||
if(!enable)
|
||||
{
|
||||
log::dwarning
|
||||
{
|
||||
log, "OpenCL hardware acceleration is not available or enabled."
|
||||
};
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const ctx::posix::enable_pthread enable_pthread;
|
||||
|
||||
// Setup options
|
||||
|
|
Loading…
Reference in a new issue