[eigen] enabling OpenMP in only a subset of a library |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
However, we also have a larger problem for which we'd like to turn on OpenMP support in Eigen, and utilize multiple cores in a single process - but we want to be able to link the OpenMP-enabled code against the rest of the framework that uses Eigen without any kind of threading.
As I understand it, that's not possible to do naively, as it means we end up defining some inline functions (e.g. nbThreads) in different ways in different compilation units, and that's Undefined Behavior.
Is there any way to make this work without having to recompile all the non-OpenMP code with OpenMP support while calling setNbThreads(1) to disable it until we want it? Or other recommendations on how to accomplish what we want to do here?
Thanks in advance! Jim
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |