Skip to content
Snippets Groups Projects
Commit d4ba40a2 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] Remove OPENMP_LOOP_TYPE. Use int.

parent 205b8734
No related branches found
No related tags found
No related merge requests found
......@@ -28,17 +28,10 @@ template<typename T, int N> inline
T scalarProduct(T const * const v0, T const * const v1)
{
T res (v0[0] * v1[0]);
#ifdef _OPENMP
OPENMP_LOOP_TYPE k;
#pragma omp parallel for reduction (+:res)
for (k = 1; k<N; k++) {
res += v0[k] * v1[k];
}
#else
for (std::size_t k(1); k < N; k++)
for (int k = 1; k < N; k++)
res += v0[k] * v1[k];
#endif
return res;
}
......@@ -51,28 +44,14 @@ double scalarProduct<double,3>(double const * const v0, double const * const v1)
return res;
}
template<typename T> inline
T scalarProduct(T const * const v0, T const * const v1, unsigned n)
template <typename T>
inline T scalarProduct(T const* const v0, T const* const v1, int const n)
{
T res (v0[0] * v1[0]);
#ifdef _OPENMP
OPENMP_LOOP_TYPE k;
#pragma omp parallel for reduction (+:res)
#ifdef WIN32
#pragma warning ( push )
#pragma warning ( disable: 4018 )
#endif
for (k = 1; k<n; k++) {
res += v0[k] * v1[k];
}
#ifdef WIN32
#pragma warning ( pop )
#endif
#else
for (std::size_t k(1); k < n; k++)
for (int k = 1; k < n; k++)
res += v0[k] * v1[k];
#endif
return res;
}
......
......@@ -47,7 +47,6 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL)
add_compile_options(
-Wall
-Wextra
-DOPENMP_LOOP_TYPE=unsigned
)
# Profiling
......@@ -116,7 +115,6 @@ if(MSVC)
/W3
/wd4290 /wd4267 /wd4996
/bigobj
-DOPENMP_LOOP_TYPE=int # Missing OpenMP 3.0 implementation fix for Windows, this fixes #6
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_NONSTDC_NO_WARNINGS
-D_CRT_XNONSTDC_NO_WARNINGS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment