DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
test_puremexOpenmp.cxx
Go to the documentation of this file.
1 
18 #include "mex.h"
19 #include <omp.h>
20 
21 void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
22 {
23  // omp_set_dynamic(1);
24  // omp_set_num_threads(3);
25 #pragma omp parallel
26  {
27  mexPrintf("Max num threads %d.\n", omp_get_max_threads());
28 #pragma omp for
29  for (int i = 0; i < 10; i++)
30  {
31  mexPrintf("Num threads %d, thread ID %d.\n", omp_get_num_threads(), omp_get_thread_num());
32  }
33  }
34 }
35 
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])