ViennaCL - The Vienna Computing Library  1.7.0
Free open-source GPU-accelerated linear algebra and solver library.
tools.hpp File Reference

Various little tools used here and there in ViennaCL. More...

#include <string>
#include <fstream>
#include <sstream>
#include "viennacl/forwards.h"
#include "viennacl/tools/adapter.hpp"
#include <vector>
#include <map>

Go to the source code of this file.

Classes

struct  viennacl::tools::CHECK_SCALAR_TEMPLATE_ARGUMENT< T >
 A guard that checks whether the floating point type of GPU types is either float or double. More...
 
struct  viennacl::tools::CONST_REMOVER< T >
 Removes the const qualifier from a type. More...
 
struct  viennacl::tools::CPU_SCALAR_TYPE_DEDUCER< T >
 Obtain the cpu scalar type from a type, including a GPU type like viennacl::scalar<T> More...
 

Namespaces

 viennacl
 Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
 
 viennacl::tools
 Namespace for various tools used within ViennaCL.
 

Functions

std::string viennacl::tools::read_text_from_file (const std::string &filename)
 Reads a text from a file into a std::string. More...
 
std::string viennacl::tools::str_replace (const std::string &text, std::string to_search, std::string to_replace)
 Replaces all occurances of a substring by another stringstream. More...
 
template<class INT_TYPE >
INT_TYPE viennacl::tools::align_to_multiple (INT_TYPE to_reach, INT_TYPE base)
 Rounds an integer to the next multiple of another integer. More...
 
template<class INT_TYPE >
INT_TYPE viennacl::tools::round_down_to_prevous_multiple (INT_TYPE to_reach, INT_TYPE base)
 Rounds an integer to the previous multiple of another integer. More...
 
int viennacl::tools::find_and_replace (std::string &source, std::string const &find, std::string const &replace)
 Replace in a source string a pattern by another. More...
 
template<class InputIterator , class UnaryPredicate >
bool viennacl::tools::any_of (InputIterator first, InputIterator last, UnaryPredicate pred)
 Returns true if pred returns true for any of the elements in the range [first,last), and false otherwise. More...
 
std::string viennacl::tools::make_double_kernel (std::string const &source, std::string const &fp_extension)
 Create a double precision kernel out of a single precision kernel. More...
 
template<typename HostScalarType >
viennacl::scalar< HostScalarType > const & viennacl::tools::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 & viennacl::tools::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 viennacl::tools::promote_if_host_scalar (float s)
 
template<typename HostScalarType >
HostScalarType viennacl::tools::promote_if_host_scalar (double s)
 
template<typename HostScalarType >
HostScalarType viennacl::tools::promote_if_host_scalar (long s)
 
template<typename HostScalarType >
HostScalarType viennacl::tools::promote_if_host_scalar (unsigned long s)
 
template<typename HostScalarType >
HostScalarType viennacl::tools::promote_if_host_scalar (int s)
 
template<typename HostScalarType >
HostScalarType viennacl::tools::promote_if_host_scalar (unsigned int s)
 
template<class T >
std::string viennacl::tools::to_string (T const t)
 

Detailed Description

Various little tools used here and there in ViennaCL.

Definition in file tools.hpp.