Suppose I have the following code:
tbb::enumerable_thread_specific<DataType> tls;
tbb::parallel_for ( [&] () {
DataType &data = tls.local();
cblas_....(data);
});When the MKL is compiled using OpenMP, the above code can compute the correct answer. When the MKL is compiled used TBB, however, the above code cannot produce the correct result. I think the computation is in parallel in the cblas function.
I think the problem may be related to the thread local storage, but I don't know why it does not work. Any ideas? How to solve the problem?
Zone:
Thread Topic:
Help Me