aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-14 17:48:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-14 17:48:46 +0100
commite229b6dd55b04b155b17fcb8c09b9f7e602c4913 (patch)
tree40163e7cfe4ec72308b359fa13e464bd70e538a2 /src/libutil/util.c
parent784746733a95d847e741a2d74153e99349b52fee (diff)
downloadrspamd-e229b6dd55b04b155b17fcb8c09b9f7e602c4913.tar.gz
rspamd-e229b6dd55b04b155b17fcb8c09b9f7e602c4913.zip
[Fix] Add configurable number of threads for OpenBLAS
Issue: #3082
Diffstat (limited to 'src/libutil/util.c')
-rw-r--r--src/libutil/util.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c
index ecdd7b2b9..5baffebd9 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -2401,6 +2401,14 @@ rspamd_free_zstd_dictionary (struct zstd_dictionary *dict)
}
}
+#ifdef HAVE_CBLAS
+#ifdef HAVE_CBLAS_H
+#include "cblas.h"
+#else
+extern void openblas_set_num_threads(int num_threads);
+#endif
+#endif
+
void
rspamd_config_libs (struct rspamd_external_libs_ctx *ctx,
struct rspamd_config *cfg)
@@ -2494,6 +2502,9 @@ rspamd_config_libs (struct rspamd_external_libs_ctx *ctx,
ZSTD_freeCStream (ctx->out_zstream);
ctx->out_zstream = NULL;
}
+#ifdef HAVE_CBLAS
+ openblas_set_num_threads (cfg->max_blas_threads);
+#endif
}
}
@@ -3267,4 +3278,4 @@ rspamd_set_counter_ema (struct rspamd_counter_data *cd,
cd->number ++;
return cd->mean;
-}
+} \ No newline at end of file