mirror of
https://github.com/matrix-construct/construct
synced 2024-09-28 19:58:53 +02:00
ircd:🆑 Enable configure by default; disable runtime by default.
This commit is contained in:
parent
78133c59cd
commit
1d46cf9f5f
2 changed files with 26 additions and 6 deletions
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_MSG_CHECKING(whether to disable use of any found OpenCL)
|
||||||
AC_ARG_ENABLE(opencl, RB_HELP_STRING([--enable-opencl], [Enable OpenCL support]),
|
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])
|
AC_MSG_RESULT([no])
|
||||||
enable_opencl="no"
|
enable_opencl="no"
|
||||||
opencl_enable="disabled"
|
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" ])
|
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);
|
static int throw_on_error(const int &code);
|
||||||
template<class func, class... args> static int call(func&&, args&&...);
|
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 &);
|
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
|
// Runtime state
|
||||||
|
@ -79,12 +81,30 @@ ircd::cl::version_abi
|
||||||
"OpenCL", info::versions::ABI
|
"OpenCL", info::versions::ABI
|
||||||
};
|
};
|
||||||
|
|
||||||
|
decltype(ircd::cl::enable)
|
||||||
|
ircd::cl::enable
|
||||||
|
{
|
||||||
|
{ "name", "ircd.cl.enable" },
|
||||||
|
{ "default", false },
|
||||||
|
{ "persist", false },
|
||||||
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// init
|
// init
|
||||||
//
|
//
|
||||||
|
|
||||||
ircd::cl::init::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;
|
const ctx::posix::enable_pthread enable_pthread;
|
||||||
|
|
||||||
// Setup options
|
// Setup options
|
||||||
|
|
Loading…
Reference in a new issue