aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-01 14:36:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-01 14:36:22 +0100
commit10aa9266198ba6e980eac5aaff5504e3002775bc (patch)
tree0de8d1c0bcb1fb0e416ae4a85e6130c1224e21bc /src
parent4bd0eb5511a3913e03962c79f72f5a54f8bb8a72 (diff)
downloadrspamd-10aa9266198ba6e980eac5aaff5504e3002775bc.tar.gz
rspamd-10aa9266198ba6e980eac5aaff5504e3002775bc.zip
[Project] Remove has_torch definitions
Diffstat (limited to 'src')
-rw-r--r--src/libserver/cfg_utils.c8
-rw-r--r--src/lua/lua_config.c23
-rw-r--r--src/plugins/lua/neural.lua5
3 files changed, 3 insertions, 33 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 6e244902a..055a66930 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -1194,14 +1194,6 @@ rspamd_ucl_add_conf_variables (struct ucl_parser *parser, GHashTable *vars)
ucl_parser_register_variable (parser, RSPAMD_BRANCH_VERSION_MACRO,
RSPAMD_VERSION_BRANCH);
-#if defined(WITH_TORCH) && defined(WITH_LUAJIT) && defined(__x86_64__)
- ucl_parser_register_variable (parser, "HAS_TORCH",
- "yes");
-#else
- ucl_parser_register_variable (parser, "HAS_TORCH",
- "no");
-#endif
-
hostlen = sysconf (_SC_HOST_NAME_MAX);
if (hostlen <= 0) {
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 18baf8551..8e8ba90e6 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -3805,27 +3805,8 @@ lua_config_get_cpu_flags (lua_State *L)
static gint
lua_config_has_torch (lua_State *L)
{
- LUA_TRACE_POINT;
- struct rspamd_config *cfg = lua_check_config (L, 1);
- struct rspamd_cryptobox_library_ctx *crypto_ctx;
-
- if (cfg != NULL) {
- crypto_ctx = cfg->libs_ctx->crypto_ctx;
-#if !defined(WITH_TORCH) || !defined(WITH_LUAJIT)
- lua_pushboolean (L, false);
- (void)crypto_ctx;
-#else
- if (crypto_ctx->cpu_config & CPUID_SSE2) {
- lua_pushboolean (L, true);
- }
- else {
- lua_pushboolean (L, false);
- }
-#endif
- }
- else {
- return luaL_error (L, "invalid arguments");
- }
+ msg_warn ("use of the obsoleted `has_torch` function");
+ lua_pushboolean (L, false);
return 1;
}
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua
index dd1b94b3a..032859d18 100644
--- a/src/plugins/lua/neural.lua
+++ b/src/plugins/lua/neural.lua
@@ -21,6 +21,7 @@ end
local rspamd_logger = require "rspamd_logger"
local rspamd_util = require "rspamd_util"
+local rspamd_kann = require "rspamd_kann"
local lua_redis = require "lua_redis"
local lua_util = require "lua_util"
local fun = require "fun"
@@ -30,10 +31,6 @@ local torch
local nn
local N = "neural"
-if rspamd_config:has_torch() then
- use_torch = true
-end
-
-- Module vars
local default_options = {
train = {