-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first include sys headers in detectCores.cpp * Release 2.1.4 * remove wait in threadpool dtor * add test for global pool dtor * bump version + NEWS --------- Co-authored-by: tnagler <thomas.nagler@tum.de>
- Loading branch information
Showing
13 changed files
with
114 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ revdep/ | |
.vscode/ | ||
new-benchmarks.R | ||
bench* | ||
^CRAN-SUBMISSION$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
Fixes clang-14 warning about bitwise & with boolen operands. | ||
Fixes clang-17 error caused by wrong order of system/R headers (macro `RF_length`). | ||
|
||
## Test environments | ||
* ubuntu 20.04 (devel, release, old-rel) | ||
* ubuntu 22.04 (devel, release, old-rel) | ||
* macOS X (release) | ||
* Windows Server 2019 (release) | ||
* CRAN win builder (devel) | ||
|
||
## Check status summary | ||
|
||
NOTE OK | ||
Source packages 0 1 | ||
Reverse depends 17 1 | ||
Reverse depends 21 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PKG_CPPFLAGS = -I../inst/include | ||
PKG_LIBS = `"$(R_HOME)/bin/Rscript" -e "source('../R/LdFlags.R'); LdFlags()"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
#include <thread> | ||
|
||
#define R_NO_REMAP | ||
|
||
#include <R.h> | ||
#include <Rdefines.h> | ||
#include <thread> | ||
|
||
extern "C" { | ||
#include "RcppThread.h" | ||
|
||
SEXP detectCoresCpp() { | ||
SEXP result; | ||
PROTECT(result = NEW_INTEGER(1)); | ||
INTEGER(result)[0] = std::thread::hardware_concurrency(); | ||
UNPROTECT(1); | ||
return result; | ||
} | ||
extern "C" | ||
{ | ||
|
||
SEXP detectCoresCpp() | ||
{ | ||
SEXP result; | ||
PROTECT(result = NEW_INTEGER(1)); | ||
INTEGER(result)[0] = std::thread::hardware_concurrency(); | ||
UNPROTECT(1); | ||
return result; | ||
} | ||
|
||
static const R_CallMethodDef callMethods[] = { | ||
{"detectCoresCpp", (DL_FUNC) &detectCoresCpp, 0}, | ||
{NULL, NULL, 0} | ||
}; | ||
SEXP testGlobalCpp() | ||
{ | ||
auto fun = [](int i) {}; | ||
RcppThread::parallelFor(0, 100, fun); | ||
SEXP result; | ||
PROTECT(result = NEW_INTEGER(1)); | ||
INTEGER(result)[0] = 1; | ||
UNPROTECT(1); | ||
return result; | ||
} | ||
|
||
void R_init_RcppThread(DllInfo *info) | ||
{ | ||
R_registerRoutines(info, NULL, callMethods, NULL, NULL); | ||
R_useDynamicSymbols(info, TRUE); | ||
} | ||
static const R_CallMethodDef callMethods[] = { | ||
{ "detectCoresCpp", (DL_FUNC)&detectCoresCpp, 0 }, | ||
{ "testGlobalCpp", (DL_FUNC)&testGlobalCpp, 0 }, | ||
{ NULL, NULL, 0 } | ||
}; | ||
|
||
void R_init_RcppThread(DllInfo* info) | ||
{ | ||
R_registerRoutines(info, NULL, callMethods, NULL, NULL); | ||
R_useDynamicSymbols(info, TRUE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// #include "RcppThread.h" | ||
// | ||
// extern "C" { | ||
// | ||
// SEXP testGlobalCpp() { | ||
// RcppThread:: | ||
// SEXP result; | ||
// PROTECT(result = NEW_INTEGER(1)); | ||
// INTEGER(result)[0] = std::thread::hardware_concurrency(); | ||
// UNPROTECT(1); | ||
// return result; | ||
// } | ||
// | ||
// | ||
// static const R_CallMethodDef callMethods[] = { | ||
// {"testGlobalCpp", (DL_FUNC) &detectCoresCpp, 0}, | ||
// {NULL, NULL, 0} | ||
// }; | ||
// | ||
// void R_init_RcppThread(DllInfo *info) | ||
// { | ||
// R_registerRoutines(info, NULL, callMethods, NULL, NULL); | ||
// R_useDynamicSymbols(info, TRUE); | ||
// } | ||
// | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
RcppThread:::testGlobal() | ||
|
||
if (RcppThread:::hasAtomicSupport()) { | ||
|
||
context("Compile test functions") | ||
|