1 #ifndef VIENNACL_LINALG_DETAIL_BISECT_UTIL_HPP_
2 #define VIENNACL_LINALG_DETAIL_BISECT_UTIL_HPP_
45 min(
const T &lhs,
const T &rhs)
48 return (lhs < rhs) ? lhs : rhs;
59 max(
const T &lhs,
const T &rhs)
62 return (lhs < rhs) ? rhs : lhs;
74 return (val < 0.0f) ? -1.0f : 1.0f;
86 return (val < 0.0) ? -1.0 : 1.0;
97 const unsigned int num_threads_block)
99 const unsigned int block_rem =
100 ((num_threads % num_threads_block) != 0) ? 1 : 0;
101 return (num_threads / num_threads_block) + block_rem;
106 #endif // #ifndef VIENNACL_LINALG_DETAIL_UTIL_HPP_
T max(const T &lhs, const T &rhs)
Maximum.
double sign_d(const double &val)
Sign of number (double)
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
unsigned int getNumBlocksLinear(const unsigned int num_threads, const unsigned int num_threads_block)
float sign_f(const float &val)
Sign of number (float)
T min(const T &lhs, const T &rhs)
Minimum.