aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-26 16:11:33 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-26 16:11:33 +0100
commit2c671761a7a88321b321d2a8d7288f65466b2eb3 (patch)
tree28bfab2b236a8f443c91317fcd96bb88f5837c2c /src
parent2e6a269af6c32c2dd288697994c849511d1f37af (diff)
downloadrspamd-2c671761a7a88321b321d2a8d7288f65466b2eb3.tar.gz
rspamd-2c671761a7a88321b321d2a8d7288f65466b2eb3.zip
[Minor] Lua_tensor: Add has_blas method
Diffstat (limited to 'src')
-rw-r--r--src/lua/lua_tensor.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lua/lua_tensor.c b/src/lua/lua_tensor.c
index b40ee6e71..e918188eb 100644
--- a/src/lua/lua_tensor.c
+++ b/src/lua/lua_tensor.c
@@ -38,11 +38,13 @@ LUA_FUNCTION_DEF (tensor, len);
LUA_FUNCTION_DEF (tensor, eigen);
LUA_FUNCTION_DEF (tensor, mean);
LUA_FUNCTION_DEF (tensor, transpose);
+LUA_FUNCTION_DEF (tensor, has_blas);
static luaL_reg rspamd_tensor_f[] = {
LUA_INTERFACE_DEF (tensor, load),
LUA_INTERFACE_DEF (tensor, new),
LUA_INTERFACE_DEF (tensor, fromtable),
+ LUA_INTERFACE_DEF (tensor, has_blas),
{NULL, NULL},
};
@@ -715,6 +717,18 @@ lua_tensor_transpose (lua_State *L)
}
static gint
+lua_tensor_has_blas (lua_State *L)
+{
+#ifdef HAVE_CBLAS
+ lua_pushboolean (L, true);
+#else
+ lua_pushboolean (L, false);
+#endif
+
+ return 1;
+}
+
+static gint
lua_load_tensor (lua_State * L)
{
lua_newtable (L);