ViennaCL - The Vienna Computing Library  1.4.2
Namespaces | Data Structures | Functions
viennacl::tools Namespace Reference

Namespace for various tools used within ViennaCL. More...

Namespaces

namespace  detail
 

Contains implementation details for the tools. Usually not of interest for the library user.


Data Structures

struct  MATRIX_ITERATOR_INCREMENTER
struct  cl_type< float >
struct  cl_type< double >
struct  cl_type< int >
struct  cl_type< long >
struct  cl_type< bool >
class  const_sparse_matrix_adapted_iterator
 A const iterator for sparse matrices of type std::vector<std::map<SizeType, SCALARTYPE> > More...
class  const_sparse_matrix_adapter
 Adapts a constant sparse matrix type made up from std::vector<std::map<SizeType, SCALARTYPE> > to basic ublas-compatibility. More...
class  sparse_matrix_adapted_iterator
 A non-const iterator for sparse matrices of type std::vector<std::map<SizeType, SCALARTYPE> > More...
class  sparse_matrix_adapter
 Adapts a non-const sparse matrix type made up from std::vector<std::map<SizeType, SCALARTYPE> > to basic ublas-compatibility. More...
struct  MATRIX_KERNEL_CLASS_DEDUCER
 Implementation of a helper meta class for deducing the correct kernels for the supplied matrix. More...
struct  MATRIX_PROD_KERNEL_CLASS_DEDUCER
 deduces kernel type for C=A*B, where A, B, C are MatrixType1, MatrixType2 and MatrixType3 respectively More...
struct  MATRIX_SIZE_DEDUCER
 Deduces the size of the resulting vector represented by a vector_expression from the operands. More...
struct  MATRIX_SOLVE_KERNEL_CLASS_DEDUCER
 deduces kernel type for A \ B, where A, B, C are MatrixType1 and MatrixType2 More...
class  shared_ptr
 A shared pointer class similar to boost::shared_ptr. Reimplemented in order to avoid a Boost-dependency. Will be replaced by std::shared_ptr as soon as C++11 is widely available. More...
struct  CHECK_SCALAR_TEMPLATE_ARGUMENT
 A guard that checks whether the floating point type of GPU types is either float or double. More...
struct  CHECK_SCALAR_TEMPLATE_ARGUMENT< float >
struct  CHECK_SCALAR_TEMPLATE_ARGUMENT< double >
struct  CONST_REMOVER
 Removes the const qualifier from a type. More...
struct  CONST_REMOVER< const T >
struct  VECTOR_EXTRACTOR_IMPL
 Extracts the vector type from one of the two arguments. Used for the vector_expression type. More...
struct  VECTOR_EXTRACTOR
struct  MATRIX_EXTRACTOR_IMPL
 Extracts the vector type from one of the two arguments. Used for the vector_expression type. More...
struct  MATRIX_EXTRACTOR
struct  CPU_SCALAR_TYPE_DEDUCER
 Obtain the cpu scalar type from a type, including a GPU type like viennacl::scalar<T> More...

Functions

std::string readTextFromFile (const std::string &filename)
 Reads a text from a file into a std::string.
std::string strReplace (const std::string &text, std::string to_search, std::string to_replace)
 Replaces all occurances of a substring by another stringstream.
template<class INT_TYPE >
INT_TYPE roundUpToNextMultiple (INT_TYPE to_reach, INT_TYPE base)
 Rounds an integer to the next multiple of another integer.
std::string make_double_kernel (std::string const &source, std::string const &fp_extension)
 Create a double precision kernel out of a single precision kernel.
template<typename HostScalarType >
viennacl::scalar
< HostScalarType > const & 
promote_if_host_scalar (viennacl::scalar< HostScalarType > const &s)
template<typename HostScalarType >
viennacl::scalar_expression
< const viennacl::scalar
< HostScalarType >, const
viennacl::scalar
< HostScalarType >
, viennacl::op_flip_sign >
const & 
promote_if_host_scalar (viennacl::scalar_expression< const viennacl::scalar< HostScalarType >, const viennacl::scalar< HostScalarType >, viennacl::op_flip_sign > const &s)
template<typename HostScalarType >
HostScalarType promote_if_host_scalar (float s)
template<typename HostScalarType >
HostScalarType promote_if_host_scalar (double s)
template<typename HostScalarType >
HostScalarType promote_if_host_scalar (long s)
template<typename HostScalarType >
HostScalarType promote_if_host_scalar (unsigned long s)
template<typename HostScalarType >
HostScalarType promote_if_host_scalar (int s)
template<typename HostScalarType >
HostScalarType promote_if_host_scalar (unsigned int s)

Detailed Description

Namespace for various tools used within ViennaCL.


Function Documentation

std::string viennacl::tools::make_double_kernel ( std::string const &  source,
std::string const &  fp_extension 
) [inline]

Create a double precision kernel out of a single precision kernel.

Parameters:
sourceThe source string
fp_extensionAn info string that specifies the OpenCL double precision extension
Returns:
The double precision kernel
viennacl::scalar<HostScalarType> const& viennacl::tools::promote_if_host_scalar ( viennacl::scalar< HostScalarType > const &  s)
viennacl::scalar_expression<const viennacl::scalar<HostScalarType>, const viennacl::scalar<HostScalarType>, viennacl::op_flip_sign> const& viennacl::tools::promote_if_host_scalar ( viennacl::scalar_expression< const viennacl::scalar< HostScalarType >, const viennacl::scalar< HostScalarType >, viennacl::op_flip_sign > const &  s)
HostScalarType viennacl::tools::promote_if_host_scalar ( float  s)
HostScalarType viennacl::tools::promote_if_host_scalar ( double  s)
HostScalarType viennacl::tools::promote_if_host_scalar ( long  s)
HostScalarType viennacl::tools::promote_if_host_scalar ( unsigned long  s)
HostScalarType viennacl::tools::promote_if_host_scalar ( int  s)
HostScalarType viennacl::tools::promote_if_host_scalar ( unsigned int  s)
std::string viennacl::tools::readTextFromFile ( const std::string &  filename) [inline]

Reads a text from a file into a std::string.

Parameters:
filenameThe filename
Returns:
The text read from the file
INT_TYPE viennacl::tools::roundUpToNextMultiple ( INT_TYPE  to_reach,
INT_TYPE  base 
)

Rounds an integer to the next multiple of another integer.

Template Parameters:
INT_TYPEThe integer type
Parameters:
to_reachThe integer to be rounded up (ceil operation)
baseThe base
Returns:
The smallest multiple of 'base' such that to_reach <= base
std::string viennacl::tools::strReplace ( const std::string &  text,
std::string  to_search,
std::string  to_replace 
) [inline]

Replaces all occurances of a substring by another stringstream.

Parameters:
textThe string to search in
to_searchThe substring to search for
to_replaceThe replacement for found substrings
Returns:
The resulting string