Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Stokhos_KokkosArrayKernelsUnitTestDecl.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Stokhos Package
5// Copyright (2009) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
38//
39// ***********************************************************************
40// @HEADER
41
42TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsMatrixFree, Scalar, Device ) {
43 typedef Stokhos::DefaultMultiply SparseMatOps;
44 success = test_crs_matrix_free<Scalar,Device,SparseMatOps>(setup, out);
45}
46
47TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsMatrixFreeView, Scalar, Device ) {
48 typedef Stokhos::DefaultMultiply SparseMatOps;
49 success = test_crs_matrix_free_view<Scalar,Device,SparseMatOps>(setup, out);
50}
51
52#ifdef HAVE_STOKHOS_KOKKOSLINALG
53TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsMatrixFreeKokkos, Scalar, Device ) {
54 success = test_crs_matrix_free_kokkos<Scalar,Device>(setup, out);
55}
56#else
57TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsMatrixFreeKokkos, Scalar, Device ) {}
58#endif
59
60TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsMatrixFreeSingleCol, Scalar, Device ) {
62 success = test_crs_matrix_free<Scalar,Device,SparseMatOps>(setup, out);
63}
64
65TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsDenseBlock, Scalar, Device) {
66 success = test_crs_dense_block<Scalar,Device>(setup, out);
67}
68
69TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsFlatCommuted, Scalar, Device ) {
70 success = test_crs_flat_commuted<Scalar,Device>(setup, out);
71}
72
73TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsFlatOriginal, Scalar, Device ) {
74 success = test_crs_flat_original<Scalar,Device>(setup, out);
75}
76
77TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CrsProductTensor, Scalar, Device ) {
79 success = test_crs_product_tensor<Scalar,Tensor,Device>(setup, out);
80}
81
82TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, TiledCrsProductTensor, Scalar, Device ) {
84 Teuchos::ParameterList params;
85 params.set("Tile Size", 10);
86 params.set("Max Tiles", 10000);
87 success = test_crs_product_tensor<Scalar,Tensor,Device>(setup, out, params);
88}
89
90TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, SimpleTiledCrsProductTensor, Scalar, Device ){
92 Teuchos::ParameterList params;
93 params.set("Tile Size", 10);
94 success = test_crs_product_tensor<Scalar,Tensor,Device>(setup, out, params);
95}
96
97TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CooProductTensorPacked, Scalar, Device ) {
99 success = test_crs_product_tensor<Scalar,Tensor,Device>(setup, out);
100}
101
102TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, CooProductTensorUnpacked, Scalar, Device ) {
104 success = test_crs_product_tensor<Scalar,Tensor,Device>(setup, out);
105}
106
107TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, FlatSparse3Tensor, Scalar, Device ) {
109 success = test_crs_product_tensor<Scalar,Tensor,Device>(setup, out);
110}
111
112TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, FlatSparse3Tensor_kji, Scalar, Device ) {
114 success = test_crs_product_tensor<Scalar,Tensor,Device>(setup, out);
115}
116
117TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, LinearTensorSymmetric, Scalar, Device ) {
118 const bool symmetric = true;
120 s.setup(1, 10);
121 success = test_linear_tensor<Scalar,Device,4>(s, out, symmetric);
122}
123
124TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, LinearTensorAsymmetric, Scalar, Device ) {
125 const bool symmetric = false;
127 s.setup(1, 10);
128 success = test_linear_tensor<Scalar,Device,4>(s, out, symmetric);
129}
130
131TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Kokkos_SG_SpMv, LexoBlockTensor, Scalar, Device ) {
132 success = test_lexo_block_tensor<Scalar,Device>(setup, out);
133}
134
135// ETP 6/23/14: CooProductTensor tests are failing with Intel compiler
136// (optimized with AVX). Probably alignment issue
137
138// ETP 5/12/16: LinearProductTensor tests are failing with Intel compiler too.
139
140#define UNIT_TEST_GROUP_SCALAR_DEVICE( SCALAR, DEVICE ) \
141 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsMatrixFree, SCALAR, DEVICE ) \
142 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsMatrixFreeView, SCALAR, DEVICE ) \
143 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsMatrixFreeKokkos, SCALAR, DEVICE ) \
144 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsMatrixFreeSingleCol, SCALAR, DEVICE ) \
145 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsDenseBlock, SCALAR, DEVICE ) \
146 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsFlatCommuted, SCALAR, DEVICE ) \
147 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsFlatOriginal, SCALAR, DEVICE ) \
148 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CrsProductTensor, SCALAR, DEVICE ) \
149 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, TiledCrsProductTensor, SCALAR, DEVICE ) \
150 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, SimpleTiledCrsProductTensor, SCALAR, DEVICE ) \
151 /*TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CooProductTensorPacked, SCALAR, DEVICE )*/ \
152 /*TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, CooProductTensorUnpacked, SCALAR, DEVICE )*/ \
153 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, FlatSparse3Tensor, SCALAR, DEVICE ) \
154 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, FlatSparse3Tensor_kji, SCALAR, DEVICE ) \
155 /*TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, LinearTensorSymmetric, SCALAR, DEVICE )*/ \
156 /*TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, LinearTensorAsymmetric, SCALAR, DEVICE )*/ \
157 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( Kokkos_SG_SpMv, LexoBlockTensor, SCALAR, DEVICE )
TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL(Kokkos_SG_SpMv, CrsMatrixFree, Scalar, Device)
UnitTestSetup< Kokkos::Cuda > setup
Sparse product tensor using 'COO'-like storage format.
Sparse product tensor with replicated entries to provide subsets with a given coordinate.
Sparse product tensor with replicated entries to provide subsets with a given coordinate.
Sparse product tensor with replicated entries to provide subsets with a given coordinate.