Skip to content

Commit

Permalink
review changes rapidsai#1
Browse files Browse the repository at this point in the history
- refactored code to avoid excess spacing
- avoided the raw numerically unstable computations of tanh and arctanh
- exposed the tanh and arctanh functions available in cuda toolkit to cuml
- removed redundant cudaStreamSynchronize statements
  • Loading branch information
Ganesh Venkataramana committed Jul 4, 2019
1 parent b75e491 commit a77d6fb
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 243 deletions.
32 changes: 32 additions & 0 deletions cpp/src_prims/cuda_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,38 @@ HDI double myPow(double x, double power) {
}
/** @} */

/**
* @defgroup myTanh tanh function
* @{
*/
template <typename T>
HDI T myTanh(T x);
template <>
HDI float myTanh(float x) {
return tanhf(x);
}
template <>
HDI double myTanh(double x) {
return tanh(x);
}
/** @} */

/**
* @defgroup myATanh arctanh function
* @{
*/
template <typename T>
HDI T myATanh(T x);
template <>
HDI float myATanh(float x) {
return atanhf(x);
}
template <>
HDI double myATanh(double x) {
return atanh(x);
}
/** @} */

/**
* @defgroup LambdaOps Lambda operations in reduction kernels
* @{
Expand Down
Loading

0 comments on commit a77d6fb

Please sign in to comment.