Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Core Modules
dune-common
Commits
aba26a3c
Commit
aba26a3c
authored
5 years ago
by
Jö Fahlke
Browse files
Options
Downloads
Patches
Plain Diff
Ensure Vc uses the implementation we expect from our compiler flags
parent
d4c5796c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!680
[CI] Compile the expensive tests with avx again.
Pipeline
#19067
passed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
dune/common/test/CMakeLists.txt
+6
-0
6 additions, 0 deletions
dune/common/test/CMakeLists.txt
dune/common/test/vcexpectedimpltest.cc
+71
-0
71 additions, 0 deletions
dune/common/test/vcexpectedimpltest.cc
with
78 additions
and
0 deletions
.gitlab-ci.yml
+
1
−
0
View file @
aba26a3c
...
...
@@ -18,6 +18,7 @@ debian:10 gcc-7-14--expensive:
DUNECI_CXXFLAGS
:
-mavx
DUNECI_TEST_LABELS
:
"
"
DUNECI_TOOLCHAIN
:
gcc-7-14
DUNE_TEST_EXPECTED_VC_IMPLEMENTATION
:
AVX
# require AVX to properly test Vc
tags
:
[
duneci
,
"
iset:avx"
]
# allowed to fail to e.g. do no hold up a merge when a runner supporting avx
...
...
This diff is collapsed.
Click to expand it.
dune/common/test/CMakeLists.txt
+
6
−
0
View file @
aba26a3c
...
...
@@ -412,6 +412,12 @@ dune_add_test(SOURCES varianttest.cc
LINK_LIBRARIES dunecommon
LABELS quick
)
dune_add_test
(
SOURCES vcexpectedimpltest.cc
LINK_LIBRARIES dunecommon
LABELS quick
CMAKE_GUARD Vc_FOUND
)
add_dune_vc_flags
(
vcexpectedimpltest
)
install
(
FILES
arithmetictestsuite.hh
...
...
This diff is collapsed.
Click to expand it.
dune/common/test/vcexpectedimpltest.cc
0 → 100644
+
71
−
0
View file @
aba26a3c
#include
"config.h"
#if !HAVE_VC
#error Inconsistent buildsystem. This program should not be built in the \
absence of Vc.
#endif
#include
<cstdlib>
#include
<map>
#include
<iostream>
#include
<string>
#include
<dune/common/exceptions.hh>
#include
<dune/common/vc.hh>
const
std
::
map
<
Vc
::
Implementation
,
std
::
string
>
impl_names
=
{
{
Vc
::
ScalarImpl
,
"Scalar"
},
{
Vc
::
SSE2Impl
,
"SSE2"
},
{
Vc
::
SSE3Impl
,
"SSE3"
},
{
Vc
::
SSSE3Impl
,
"SSSE3"
},
{
Vc
::
SSE41Impl
,
"SSE41"
},
{
Vc
::
SSE42Impl
,
"SSE42"
},
{
Vc
::
AVXImpl
,
"AVX"
},
{
Vc
::
AVX2Impl
,
"AVX2"
},
{
Vc
::
MICImpl
,
"MIC"
},
};
const
std
::
string
expected_var
=
"DUNE_TEST_EXPECTED_VC_IMPLEMENTATION"
;
int
main
()
{
auto
p
=
impl_names
.
find
(
Vc
::
CurrentImplementation
::
current
());
if
(
p
==
impl_names
.
end
())
DUNE_THROW
(
Dune
::
NotImplemented
,
"Unexpected current implementation value "
<<
Vc
::
CurrentImplementation
::
current
());
auto
current_impl
=
p
->
second
;
std
::
cout
<<
"The current Vc implementation is "
<<
current_impl
<<
std
::
endl
;
std
::
string
expected_impl
;
if
(
auto
env_impl
=
std
::
getenv
(
expected_var
.
c_str
()))
expected_impl
=
env_impl
;
if
(
expected_impl
.
empty
())
{
std
::
cerr
<<
"No expected vc imlementation provided, skipping test
\n
"
<<
"Please set "
<<
expected_var
<<
" environment variable to one of the following values:"
;
for
(
const
auto
&
item
:
impl_names
)
std
::
cerr
<<
' '
<<
item
.
second
;
std
::
cerr
<<
std
::
endl
;
return
77
;
}
std
::
cout
<<
"The expected Vc implementation is "
<<
expected_impl
<<
std
::
endl
;
if
(
current_impl
==
expected_impl
)
{
std
::
cout
<<
"OK: Current and expected Vc implementation match"
<<
std
::
endl
;
return
0
;
}
else
{
std
::
cout
<<
"Error: Current Vc implementation does not match expected"
<<
std
::
endl
;
return
1
;
}
}
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