Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIP compiler does not like host dev on non-functions #1956

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dace/runtime/include/dace/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static DACE_CONSTEXPR DACE_HDFI std::complex<double> np_float_pow(const std::com

// Computes Python modulus (also NumPy remainder)
// Formula: num - (num // den) * den
// NOTE: This is different than Python math.remainder and C remainder,
// NOTE: This is different than Python math.remainder and C remainder,
// which are equaivalent to the IEEE remainder: num - round(num / den) * den
template<typename T>
static DACE_CONSTEXPR DACE_HDFI T py_mod(const T& numerator, const T& denominator) {
Expand Down Expand Up @@ -321,7 +321,7 @@ static DACE_CONSTEXPR DACE_HDFI std::complex<T> round(const std::complex<T>& a)
template<typename T>
static DACE_CONSTEXPR DACE_HDFI T sign(const T& x) {
return T( (T(0) < x) - (x < T(0)) );
// return (x < 0) ? -1 : ( (x > 0) ? 1 : 0);
// return (x < 0) ? -1 : ( (x > 0) ? 1 : 0);
}
template<typename T>
static DACE_CONSTEXPR DACE_HDFI std::complex<T> sign(const std::complex<T>& x) {
Expand All @@ -331,7 +331,7 @@ static DACE_CONSTEXPR DACE_HDFI std::complex<T> sign(const std::complex<T>& x) {
template<typename T>
static DACE_CONSTEXPR DACE_HDFI T sign_numpy_2(const T& x) {
return T( (T(0) < x) - (x < T(0)) );
// return (x < 0) ? -1 : ( (x > 0) ? 1 : 0);
// return (x < 0) ? -1 : ( (x > 0) ? 1 : 0);
}
template<typename T>
static DACE_CONSTEXPR DACE_HDFI std::complex<T> sign_numpy_2(const std::complex<T>& x) {
Expand All @@ -341,7 +341,7 @@ static DACE_CONSTEXPR DACE_HDFI std::complex<T> sign_numpy_2(const std::complex<
// Computes the Heaviside step function
template<typename T>
static DACE_CONSTEXPR DACE_HDFI T heaviside(const T& a, const T& b) {
return (a < 0) ? 0 : ( (a > 0) ? 1 : b);
return (a < 0) ? 0 : ( (a > 0) ? 1 : b);
}
template<typename T>
static DACE_CONSTEXPR DACE_HDFI T heaviside(const T& a) {
Expand Down Expand Up @@ -505,8 +505,8 @@ static DACE_CONSTEXPR DACE_HDFI void np_frexp(const T& a, T& mantissa, int& expo
namespace dace
{
namespace math
{
static DACE_CONSTEXPR_HOSTDEV typeless_pi pi{};
{
static DACE_CONSTEXPR typeless_pi pi{};
static DACE_CONSTEXPR typeless_nan nan{};
//////////////////////////////////////////////////////
template<typename T>
Expand Down Expand Up @@ -645,7 +645,7 @@ namespace dace
}
#endif
}

}


Expand Down
Loading