Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wenqing
ogs
Commits
d4ba40a2
Commit
d4ba40a2
authored
6 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MaL] Remove OPENMP_LOOP_TYPE. Use int.
parent
205b8734
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MathLib/MathTools.h
+4
-25
4 additions, 25 deletions
MathLib/MathTools.h
scripts/cmake/CompilerSetup.cmake
+0
-2
0 additions, 2 deletions
scripts/cmake/CompilerSetup.cmake
with
4 additions
and
27 deletions
MathLib/MathTools.h
+
4
−
25
View file @
d4ba40a2
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
scripts/cmake/CompilerSetup.cmake
+
0
−
2
View file @
d4ba40a2
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment