Skip to content

Implement tanpi#2012

Open
ferdymercury wants to merge 5 commits intoAdaptiveCpp:developfrom
ferdymercury:tanpi
Open

Implement tanpi#2012
ferdymercury wants to merge 5 commits intoAdaptiveCpp:developfrom
ferdymercury:tanpi

Conversation

@ferdymercury
Copy link
Copy Markdown
Contributor

No description provided.

@resetius
Copy link
Copy Markdown
Member

Now you can rebase and add tanpi to math.cpp tests. Somewhere near cospi and sinpi tests

@ferdymercury
Copy link
Copy Markdown
Contributor Author

I'm not sure how to solve this error:

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpif"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpi"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpif"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpi"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

@resetius
Copy link
Copy Markdown
Member

I'm not sure how to solve this error:

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpif"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpi"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpif"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

"/home/runner/work/AdaptiveCpp/AdaptiveCpp/build/install/bin/../include/AdaptiveCpp/hipSYCL/sycl/libkernel/generic/hiplike/builtins.hpp", line 237: error: the global scope has no "tanpi"
  HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
  ^

These functions are undefined. You need smth like this

template<class T>
HIPSYCL_HIPLIKE_BUILTIN T __acpp_tanpi(T x) noexcept {
  return hiplike_builtins::__acpp_tan(x * M_PI);
}

HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_sinpi, sinpif, sinpi)
HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tan, tanf, tan)
HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanh, tanhf, tanh)
HIPSYCL_DEFINE_HIPLIKE_MATH_BUILTIN(__acpp_tanpi, tanpif, tanpi)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still need ? Please look at cospi sinpi implementation I don’t think they use a similar macro

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three lines above there is sinpi defined like this one, i just copy pasted. Or do you mean that it's not needed because you defined the template function above for tanpi (unlike for sinpi) ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or do you mean that it's not needed because you defined the template function above for tanpi (unlike for sinpi) ?

exactly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants