> so you're formulating it so that the user needs to explicetly activate OMP > using the settings (makefile / vcxproj file)? >
Doing something to activate OMP is existing behavior. That is not changing. For example, on Linux, I need to add -fopenmp flag to CXXFLAGS. On Windows, I'm not sure what I have to do. If the user doesn't run into any problems if he doesn't have OMP it's fine > for me. > Yep, preserve existing behavior is an underlying theme. If the user does nothing, then nothing new happens. > > Did you check if VisualStudio provides the _OPENMP macro or if there's a > different one used? > On Linux, -fopenmp defines _OPENMP (http://stackoverflow.com/q/30803126). On Windows, _OPENMP is not defined, so nothing changes. I'm not sure what needs to be done because I don't use OpenMP on Windows. In either case you might want to consider making some > CRYPTOPP_OPENMP_AVAILABLE in config.h, so we can change the behavior at one > single point. > Well, I think we can pick it up automatically based on user actions. If the user can activate OMP in one step (-fopenmp), then I don't think there's a reason to require two steps (-fopenmp and CRYPTOPP_OPENMP_AVAILABLE). Also, OpenMP is incorporated with instrumentation though #pragmas, so I don't think there's much point in conditionally removing them. For example, exiting code: #pragma omp parallel #pragma omp sections { #pragma omp section cp = ModularSquareRoot(cp, m_p); #pragma omp section cq = ModularSquareRoot(cq, m_q); } In the code above, the ModularSquareRoot always executes. Guarding code blocks with CRYPTOPP_OPENMP_AVAILABLE won't gain anything, and it makes us write more code: #ifdef CRYPTOPP_OPENMP_AVAILABLE #pragma omp parallel #pragma omp sections { #pragma omp section cp = ModularSquareRoot(cp, m_p); #pragma omp section cq = ModularSquareRoot(cq, m_q); } #else cp = ModularSquareRoot(cp, m_p); cq = ModularSquareRoot(cq, m_q); #endif -- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
