Hi Matt,

 > This is more of a curiosity question than anything else.  When I
> compiled the latest build of ViennaCL this evening, I modified the CMake
> GUI such that the release flags for CXX and C looked as follows:
>
> /MD /GL /Ot /MP /O2 /Ob2 /D NDEBUG
>
> Specifically, I added /GL /Ot /MP for global optimization, favoring fast
> code and multiprocessor compilation.  Who wants to wait for a single
> thread to compile the whole project?! ;-)

;-)


> Anyway, I have two questions.
>
> 1) I did not enable /openmp.  What I read here leads me to believe the
> OpenMP code in ViennaCL will still work if it is explicitly written in
> the code.  Should I enable this anyway?
> http://msdn.microsoft.com/en-us/library/fw509c3b.aspx

If you pass /openmp, then you also need to make sure that 
VIENNACL_WITH_OPENMP is defined. The easiest thing to do this is to 
select 'ENABLE_OPENMP' in CMake.

A bit of background information: Standard use of OpenMP through 
pragma-annotations is as follows:

* For-Loop without any extras:
   for (i=0; i<N; ++i) x[i] = 42;

* For-Loop with parallel execution via OpenMP:
   #pragma omp parallel for
   for (i=0; i<N; ++i) x[i] = 42;

Now the problem here is that certain compilers (including MSVC) emit 
warnings if OpenMP is not enabled to make the user aware that the 
#pragma-thing does nothing. Hence, in ViennaCL all OpenMP-parallel 
for-loops are guarded as follows:
   #ifdef VIENNACL_WITH_OPENMP
     #pragma omp parallel for
   #endif
   for (i=0; i<N; ++i) x[i] = 42;

This allows us to have clean compilations in both cases.


> 2) I assume the other compiler options were pulled by CMake directly
> from the compiler of my choice and it is not something specified from
> your configs?  However, If it is in your config, perhaps you can
> consider adding the above flags to visual studio builds to improve
> performance and compile times.

Yes, CMake runs a couple of compiler checks and then uses a couple of 
default flags. I think some of the flags you mentioned above are 
actually set if you select 'Release' mode (I'm sure about NDEBUG). Do 
you know about support for the other flags? I'll include them if they 
also work with Express-Editions and all the way back to VS 2005. 
Version-specific checks for Visual Studio is something I'd like to 
avoid, since this CMake's job ;-)

Best regards,
Karli


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to