Page 1 of 1

Windows

Posted: Thu Jan 24, 2019 11:45 am
by Dade
@Acasta69: do you now if the VisulaStudio version we are currently using supports a more recent version than OpenMP 2.5 ?

I have a lot of code around looking like:

Code: Select all

	#pragma omp parallel for
	for (
			// Visual C++ 2013 supports only OpenMP 2.5
#if _OPENMP >= 200805
			unsigned
#endif
			int i = 0; i < photons.size(); ++i) {
			}
It was required to work with VisualStudio C++ 2013 but it is ugly. I would like to remove the #if.

Re: Windows

Posted: Thu Jan 24, 2019 12:34 pm
by alpistinho
Hey,

I did a quick search and found plenty of people asking about an update for OpenMP on VS, so I think the answer is no :( .

I've found however that it is possible to use Clang with VS, so maybe that's an option.
https://marketplace.visualstudio.com/it ... -toolchain

Re: Windows

Posted: Thu Jan 24, 2019 12:49 pm
by acasta69
alpistinho wrote: Thu Jan 24, 2019 12:34 pm Hey,

I did a quick search and found plenty of people asking about an update for OpenMP on VS, so I think the answer is no :( .

I've found however that it is possible to use Clang with VS, so maybe that's an option.
https://marketplace.visualstudio.com/it ... -toolchain
I confirm, I was looking at the same topic this morning and it is still 2.5.
About clang on Windows, that's' something I'd like to try, but probably not so soon due to lack of time...

Re: Windows

Posted: Thu Jan 24, 2019 1:03 pm
by B.Y.O.B.
What about a typedef like I did in the imagepipeline plugin tutorial?

Code: Select all

#if _OPENMP >= 200805
	typedef unsigned int itertype;
#else
	// Visual C++ 2013 supports only OpenMP 2.5
	typedef int itertype;
#endif


#pragma omp parallel for
for (itertype i = 0; i < pixelCount; ++i) {
	// ...
}

Re: Windows

Posted: Thu Jan 24, 2019 2:09 pm
by Dade
B.Y.O.B. wrote: Thu Jan 24, 2019 1:03 pm What about a typedef like I did in the imagepipeline plugin tutorial?
Fine for me.