mex testp.cpp CFLAGS="\$CFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp" CXXOPTIMFLAGS="\$CXXOPTIMFLAGS -fopenmp".
Here is a simple mex function to test this.
//testp.cpp
#include
#include "mex.h"
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray*prhs[] )
{
unsigned int threadid, nthreads;
#pragma omp parallel private(threadid) shared(nthreads) num_threads(8)
{
threadid = omp_get_thread_num();
if (threadid==0) {
nthreads = omp_get_num_threads();
}
}
mexPrintf("num_threads = %d\n",nthreads);
}
1 comment:
Nice blog..! I really loved reading through this article. Thanks for sharing such
a amazing post with us and keep blogging...Well written article Thank You for Sharing with Us pmp training class in chennai | pmp training fee | project management training certification | project management training in chennai
Post a Comment