Skip to content

Commit 95b4ab4

Browse files
committed
add local test file for #375
1 parent 3ded8b4 commit 95b4ab4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

local/rcpparma375.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
#include <RcppArmadillo.h>
3+
#include <omp.h>
4+
5+
// [[Rcpp::export]]
6+
void rcpparma375(int nthreads) {
7+
omp_set_num_threads(nthreads);
8+
#pragma omp parallel for
9+
for (int i = 0; i < 5; i++){
10+
int tid = omp_get_thread_num();
11+
std::cout << tid << "\t tid" << std::endl;
12+
int nThreads = omp_get_num_threads();
13+
std::cout << nThreads << "\t nThreads" << std::endl;
14+
}
15+
}

0 commit comments

Comments
 (0)