Skip to content
Snippets Groups Projects
Commit 5af9c1da authored by Jö Fahlke's avatar Jö Fahlke
Browse files

[simd/test] Generate instantiations for index vectors.

parent 8eb20359
Branches
Tags
1 merge request!193Extended SIMD interface
Pipeline #
......@@ -26,7 +26,7 @@ dune_instance_end()
dune_list_filter(DUNE_INSTANCE_GENERATED INCLUDE REGEX [[\.cc$]])
dune_add_test(NAME looptest
SOURCES ${DUNE_INSTANCE_GENERATED} looptest_mask.cc
SOURCES ${DUNE_INSTANCE_GENERATED} looptest_index.cc looptest_mask.cc
LINK_LIBRARIES dunecommon
)
# no need to install looptest.hh, used by looptest*.cc only
......@@ -52,7 +52,7 @@ dune_instance_end()
dune_list_filter(DUNE_INSTANCE_GENERATED INCLUDE REGEX [[\.cc$]])
dune_add_test(NAME standardtest
SOURCES ${DUNE_INSTANCE_GENERATED} standardtest_mask.cc
SOURCES ${DUNE_INSTANCE_GENERATED} standardtest_index.cc standardtest_mask.cc
LINK_LIBRARIES dunecommon
)
# no need to install standardtest.hh, used by standardtest*.cc only
......@@ -80,6 +80,16 @@ foreach(SCALAR IN LISTS VCTEST_TYPES)
endforeach(LANES IN ITEMS 4 8)
endforeach()
# Vc's Index types are always Vc::SimdArray<int, N>, even for Vc::Vector.
# Instanciate for up to N=32, enough for std::int16_t on AVX512
# Use exactly the same variables as for the ARRAY template so matching
# instantiations of vctest_simdmaskarray.cc give the same result.
set(SCALAR std::int32_t)
foreach(LANES IN ITEMS 1 2 4 8 16 32)
dune_instance_add(TEMPLATE INDEX ID "${SCALAR}_${LANES}"
FILES vctest_index.cc vctest_simdmaskarray.cc)
endforeach(LANES)
dune_instance_end()
dune_list_filter(DUNE_INSTANCE_GENERATED INCLUDE REGEX [[\.cc$]])
......
......@@ -4,6 +4,7 @@
#include "config.h"
#endif
#include <cstddef>
#include <cstdlib>
#include <dune/common/simd/loop.hh>
......@@ -18,6 +19,8 @@ int main()
test.checkVector<Dune::LoopSIMD<@SCALAR@, 5>>();
#cmake @endtemplate@
test.checkIndex<Dune::LoopSIMD<std::size_t, 5>>();
test.checkMask<Dune::LoopSIMD<bool, 5>>();
return test.good() ? EXIT_SUCCESS : EXIT_FAILURE;
......
......@@ -3,6 +3,8 @@
#ifndef DUNE_COMMON_SIMD_TEST_LOOPTEST_HH
#define DUNE_COMMON_SIMD_TEST_LOOPTEST_HH
#include <cstddef>
#include <dune/common/simd/test.hh>
#include <dune/common/simd/loop.hh>
......@@ -13,6 +15,8 @@ namespace Dune {
extern template void UnitTest::checkVector<LoopSIMD<@SCALAR@, 5>>();
#cmake @endtemplate@
extern template void UnitTest::checkIndex<LoopSIMD<std::size_t, 5>>();
extern template void UnitTest::checkMask<LoopSIMD<bool, 5>>();
} //namespace Simd
......
#include <config.h>
#include <dune/common/simd/test/looptest.hh>
namespace Dune {
namespace Simd {
template void UnitTest::checkIndex<LoopSIMD<std::size_t, 5>>();
} //namespace Simd
} // namespace Dune
......@@ -5,6 +5,7 @@
#endif
#include <complex>
#include <cstddef>
#include <cstdlib>
#include <dune/common/simd/test.hh>
......@@ -18,5 +19,9 @@ int main()
test.checkVector<@SCALAR@>();
#cmake @endtemplate@
test.checkIndex<std::size_t>();
test.checkMask<bool>();
return test.good() ? EXIT_SUCCESS : EXIT_FAILURE;
}
......@@ -4,6 +4,7 @@
#define DUNE_COMMON_SIMD_TEST_STANDARDTEST_HH
#include <complex>
#include <cstddef>
#include <dune/common/simd/test.hh>
......@@ -14,6 +15,8 @@ namespace Dune {
extern template void UnitTest::checkVector<@SCALAR@>();
#cmake @endtemplate@
extern template void UnitTest::checkIndex<std::size_t>();
extern template void UnitTest::checkMask<bool>();
} // namespace Simd
......
#include <config.h>
#include <dune/common/simd/test.hh>
#include <dune/common/simd/test/standardtest.hh>
namespace Dune {
namespace Simd {
template void UnitTest::checkIndex<std::size_t>();
} // namespace Simd
} // namespace Dune
......@@ -33,5 +33,9 @@ int main()
test.checkVector<SimdArray<@SCALAR@, @LANES@> >();
#@endtemplate@
#@template INDEX@
test.checkIndex<SimdArray<std::int32_t, @LANES@> >();
#@endtemplate@
return test.good() ? EXIT_SUCCESS : EXIT_FAILURE;
}
......@@ -21,6 +21,11 @@ namespace Dune {
extern template void UnitTest::checkMask<Vc::SimdMaskArray<@SCALAR@, @LANES@> >();
#cmake @endtemplate@
#cmake @template INDEX@
extern template void UnitTest::checkIndex<Vc::SimdMaskArray<@SCALAR@, @LANES@> >();
extern template void UnitTest::checkMask<Vc::SimdMaskArray<@SCALAR@, @LANES@> >();
#cmake @endtemplate@
} // namespace Simd
} // namespace Dune
......
// @GENERATED_SOURCE@
#include <config.h>
#include <cstdint>
#include <dune/common/simd/test/vctest.hh>
namespace Dune {
namespace Simd {
template
void UnitTest::checkIndex<Vc::SimdArray<@SCALAR@, @LANES@> >();
} // namespace Simd
} // namespace Dune
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment