summaryrefslogtreecommitdiff
path: root/R/src
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2024-06-21 08:53:11 +1000
committerJustin Bedo <cu@cua0.org>2024-06-21 09:07:13 +1000
commitea8c8392ef8a84a146bf1e46fe36d55bdc89799d (patch)
tree8e1cabe30b19ee83528ad60866c1154d6557147d /R/src
parent3080e05e64292a934f9ce32e908c1c8a88dc40ec (diff)
R: allow configuration of the number of threadsHEADmaster
Diffstat (limited to 'R/src')
-rw-r--r--R/src/wrapper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/R/src/wrapper.c b/R/src/wrapper.c
index 52c1192..5e258b8 100644
--- a/R/src/wrapper.c
+++ b/R/src/wrapper.c
@@ -1,9 +1,10 @@
#include "pca.h"
void
-pca_wrapper(int *n, int *d, int *iters, double *q, int *k, double *X, double *B, double *U, double *l) {
+pca_wrapper(int *nprocs, int *n, int *d, int *iters, double *q, int *k, double *X, double *B, double *U, double *l) {
struct futhark_context_config *cfg = futhark_context_config_new();
+ futhark_context_config_set_num_threads(cfg, *nprocs);
struct futhark_context *ctx = futhark_context_new(cfg);
struct futhark_f64_2d *Xf = futhark_new_f64_2d(ctx, X, *n, *d);