From 87822061f8c1e7da95583a462605d605d5e86a36 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 27 Dec 2017 16:16:09 +0100 Subject: [PATCH] New test. --- tests/base/vectorization_09.cc | 69 ++++++++++++++++++++++++++++++ tests/base/vectorization_09.output | 5 +++ 2 files changed, 74 insertions(+) create mode 100644 tests/base/vectorization_09.cc create mode 100644 tests/base/vectorization_09.output diff --git a/tests/base/vectorization_09.cc b/tests/base/vectorization_09.cc new file mode 100644 index 0000000000..b43305de48 --- /dev/null +++ b/tests/base/vectorization_09.cc @@ -0,0 +1,69 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2014 - 2015 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// test VectorizedArray::streaming_store + +#include "../tests.h" + +#include +#include + +template +void test () +{ + const unsigned int n_chunks = 50000; + const unsigned int n_vectors = VectorizedArray::n_array_elements; + std::vector values(n_vectors*n_chunks); + for (unsigned int i=0; i stored(n_vectors*n_chunks); + for (unsigned int i=0; i tmp; + tmp.load(&values[i*n_vectors]); + tmp.streaming_store(&stored[i*n_vectors]); + } + for (unsigned int i=0; i (); + deallog.pop(); + deallog.push("float"); + test (); + deallog.pop(); + + // test long double and unsigned int: in these cases, the default path of + // VectorizedArray is taken no matter what was done for double or float + deallog.push("long double"); + test (); + deallog.pop(); + + deallog.push("unsigned int"); + test (); + deallog.pop(); +} diff --git a/tests/base/vectorization_09.output b/tests/base/vectorization_09.output new file mode 100644 index 0000000000..2080240873 --- /dev/null +++ b/tests/base/vectorization_09.output @@ -0,0 +1,5 @@ + +DEAL:double::streaming store OK +DEAL:float::streaming store OK +DEAL:long double::streaming store OK +DEAL:unsigned int::streaming store OK -- 2.39.5