Skip to content

Commit 50c7c6d

Browse files
committed
Add registration.
1 parent 42ba805 commit 50c7c6d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

inst/NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ RcppParallel 2017.7.0 (unreleased)
44
* Allow setting the number of threads to use via RCPP_PARALLEL_NUM_THREADS
55
environment variable.
66
* Update to TBB 2017 Update 7.
7+
* Add native registration of compiled functions.
78

89
RcppParallel 4.3.20
910
------------------------------------------------------------------------

src/init.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <R.h>
2+
#include <Rinternals.h>
3+
#include <stdlib.h> // for NULL
4+
#include <R_ext/Rdynload.h>
5+
6+
/* FIXME:
7+
Check these declarations against the C/Fortran source code.
8+
*/
9+
10+
/* .Call calls */
11+
extern SEXP defaultNumThreads();
12+
extern SEXP setThreadOptions(SEXP, SEXP);
13+
14+
static const R_CallMethodDef CallEntries[] = {
15+
{"defaultNumThreads", (DL_FUNC) &defaultNumThreads, 0},
16+
{"setThreadOptions", (DL_FUNC) &setThreadOptions, 2},
17+
{NULL, NULL, 0}
18+
};
19+
20+
void R_init_RcppParallel(DllInfo *dll)
21+
{
22+
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
23+
R_useDynamicSymbols(dll, FALSE);
24+
}

0 commit comments

Comments
 (0)