-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sudaraka88
authored and
Sudaraka88
committed
Jul 18, 2024
1 parent
2ded16e
commit fc5a4f6
Showing
7 changed files
with
50 additions
and
7 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 |
---|---|---|
|
@@ -6,4 +6,3 @@ | |
*.o | ||
.DS_Store | ||
*.Rmd | ||
Makevars |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CXX_STD=CXX11 | ||
|
||
CXX1X=$(shell ${R_HOME}/bin/R CMD config CXX11) | ||
|
||
PKG_LIBS = $(shell $(R_HOME)/bin/Rscipt.exe -e "Rcpp:::LdFlags()") -lz | ||
|
||
ifeq ($(shell $(CXX1X) -fopenmp -E -xc++ - 2>&1 >/dev/null && echo 'true'), true) | ||
PKG_CXXFLAGS=$(SHLIB_OPENMP_CXXFLAGS) -DARMA_64BIT_WORD | ||
PKG_LIBS=$(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) | ||
else | ||
PKG_CXXFLAGS=-DARMA_64BIT_WORD | ||
PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) | ||
endif |
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,16 @@ | ||
#include <Rcpp.h> | ||
#ifdef _OPENMP | ||
#include <omp.h> | ||
// [[Rcpp::plugins(openmp)]] | ||
#endif | ||
|
||
|
||
// [[Rcpp::export]] | ||
void test_openmp() { | ||
#ifdef _OPENMP | ||
int nthreads = omp_get_max_threads(); | ||
Rcpp::Rcout << "with OpenMP support - system supports up to: " << nthreads << " cores" << std::endl; | ||
#else | ||
Rcpp::Rcout << "without OpenMP support - WARNING! Some functions will run slower..." << std::endl; | ||
#endif | ||
} |