Commit dbb1f15d authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

Another patch about OpenMp support for libpgf :

- M$ Visual C++ 2008 support well OpenMP. Do not limit OpenMP support to Visual C++ 2010.
- use dedicated OpenMP detection define everywhere if OpenMP will be used with libpgf implementation.

Raphael, now, digiKam+libpgf compile fine with M$ Visual C++. Please include this patch into official and current libpgf repository. Thanks in advance.

CCBUGS: 273765
CCMAIL: rschweizer@schweizer-informatik.ch
parent df6961e6
......@@ -78,14 +78,14 @@ CDecoder::CDecoder(CPGFStream* stream, PGFPreHeader& preHeader, PGFHeader& heade
int count, expected;
// set number of threads
#ifdef _OPENMP
#ifdef LIBPGF_USE_OPENMP
m_macroBlockLen = omp_get_num_procs();
#else
m_macroBlockLen = 1;
#endif
if (useOMP && m_macroBlockLen > 1) {
#ifdef _OPENMP
#ifdef LIBPGF_USE_OPENMP
omp_set_num_threads(m_macroBlockLen);
#endif
......
......@@ -80,14 +80,14 @@ CEncoder::CEncoder(CPGFStream* stream, PGFPreHeader preHeader, PGFHeader header,
int count;
// set number of threads
#ifdef _OPENMP
#ifdef LIBPGF_USE_OPENMP
m_macroBlockLen = omp_get_num_procs();
#else
m_macroBlockLen = 1;
#endif
if (useOMP && m_macroBlockLen > 1) {
#ifdef _OPENMP
#ifdef LIBPGF_USE_OPENMP
omp_set_num_threads(m_macroBlockLen);
#endif
......
......@@ -612,8 +612,8 @@ __inline UINT64 ByteSwap(UINT64 ui64) {
#if defined (_OPENMP)
#if defined(WIN32)
# if defined (_MSC_VER) && (_MSC_VER >= 1600)
/* VS2010+ : OpenMP works OK */
# if defined (_MSC_VER) && (_MSC_VER >= 1500)
/* VS2008 and VS2010+ : OpenMP works OK */
# define LIBPGF_USE_OPENMP
#elif defined (__INTEL_COMPILER) && (__INTEL_COMPILER >=910)
/* Have not tested on 9.x and 10.x, but Intel documentation claims OpenMP 2.5 support in 9.1 */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment