config.hpp 3.88 KB
Newer Older
1
// Software License for MTL
2
3
//
// Copyright (c) 2007 The Trustees of Indiana University.
4
//               2008 Dresden University of Technology and the Trustees of Indiana University.
5
//               2010 SimuNova UG (haftungsbeschränkt), www.simunova.com.
6
7
// All rights reserved.
// Authors: Peter Gottschling and Andrew Lumsdaine
8
//
9
// This file is part of the Matrix Template Library
10
//
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// See also license.mtl.txt in the distribution.

#ifndef MTL_CONFIG_INCLUDE
#define MTL_CONFIG_INCLUDE

namespace mtl {


    namespace matrix {

	// parameters for dense operations


#     ifdef MTL_MATRIX_DENSE_NON_RECURSIVE_PRODUCT_LIMIT
	const std::size_t dense_non_recursive_product_limit= MTL_MATRIX_DENSE_NON_RECURSIVE_PRODUCT_LIMIT;
#     else
	/// Maximal matrix size of dense matrices that is multiplied without recursion
	/** Can be reset with a macro definition or corresponding compiler flag,
	    e.g. {-D|/D}MTL_MATRIX_DENSE_NON_RECURSIVE_PRODUCT_LIMIT=4000 **/
	const std::size_t dense_non_recursive_product_limit= 10000;
#     endif


#     ifdef MTL_STRAIGHT_DMAT_DMAT_MULT_LIMIT
	const std::size_t straight_dmat_dmat_mult_limit= MTL_STRAIGHT_DMAT_DMAT_MULT_LIMIT;
#     else
	/// Defines the maximal number of entries in each matrix for which the dense matrix product is computed in C++.
	/** Above this limit the computation is performed with BLAS if available.
	    Can be reset with a macro definition or corresponding compiler flag,
	    e.g. {-D|/D}MTL_STRAIGHT_DMAT_DMAT_MULT_LIMIT=4000 **/
	const std::size_t straight_dmat_dmat_mult_limit= 1000;
#     endif

#     ifdef MTL_FULLY_UNROLL_DMAT_DMAT_MULT_LIMIT
	const std::size_t fully_unroll_dmat_dmat_mult_limit= MTL_FULLY_UNROLL_DMAT_DMAT_MULT_LIMIT;
#     else
	/// Defines the maximal number of entries in each matrix for which the dense matrix product is fully unrolled.
	/** Above this limit the computation is performed with a tiled loop implementation.
	    Applies only to statically sized matrices.
	    Can be reset with a macro definition or corresponding compiler flag,
	    e.g. {-D|/D}MTL_FULLY_UNROLL_DMAT_DMAT_MULT_LIMIT=40 **/
	const std::size_t fully_unroll_dmat_dmat_mult_limit= 10;
#     endif

	// parameters for sparse operations

#     ifdef MTL_MATRIX_COMPRESSED_LINEAR_SEARCH_LIMIT
	const std::size_t compressed_linear_search_limit= MTL_MATRIX_COMPRESSED_LINEAR_SEARCH_LIMIT;
#     else
	/// Maximal number of entries that is searched linearly within a row/column of a CRS/CCS matrix
	/** Above this std::lower_bound is used.
	    Can be reset with a macro definition or corresponding compiler flag,
	    e.g. {-D|/D}MTL_MATRIX_COMPRESSED_LINEAR_SEARCH_LIMIT=16 **/
	const std::size_t compressed_linear_search_limit= 10;
#     endif

#     ifdef MTL_SORTED_BLOCK_INSERTION_LIMIT
	const std::size_t sorted_block_insertion_limit= MTL_SORTED_BLOCK_INSERTION_LIMIT;
#     else
	/// Maximal number of columns in block that is inserted separately; above this the block is presorted (only row-major sparse matrices).
	/** Can be reset with a macro definition or corresponding compiler flag,
72
	    e.g. {-D|/D}MTL_SORTED_BLOCK_INSERTION_LIMIT=8
73
74
75
76
77
78
79
	    Default is 5. **/
	const std::size_t sorted_block_insertion_limit= 5;
#     endif

#     ifdef MTL_CRS_CVEC_MULT_BLOCK_SIZE
	const std::size_t crs_cvec_mult_block_size= MTL_CRS_CVEC_MULT_BLOCK_SIZE;
#     else
80
81
	/// Number of rows that are handled independently in each iteration of CRS times vector product
	/** The independent treatment of multiple matrix rows enables concurrency
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
	    (although we do not explicit parallelize the matrix product here).
	    The default is treating 4 rows in each iteration.
	    This default can be changed with a macro definition or corresponding compiler flag,
	    e.g. {-D|/D}MTL_CRS_CVEC_MULT_BLOCK_SIZE=8
	    At the same the macro MTL_CRS_CVEC_MULT_TUNING must be defined. **/
	const std::size_t crs_cvec_mult_block_size= 4;
#     endif


    }



} // namespace mtl

#endif // MTL_CONFIG_INCLUDE