Remove attributes from math functions#1695
Conversation
yhmtsai
left a comment
There was a problem hiding this comment.
It will work with __half, but I think it is somehow by accident or not strict rule from cuda compiler. they might inline it before checking whether it can be constexpr or not.
__half does not have any constexpr constructor.
zero<__half> and one<__half> will not be done in compiled time, and then these functions are not __device__ kernel. Thus, the device kernel should not be able to use these function, right?
|
Inlining happens much later than any checks for function attributes, so this should not be an issue at all. If |
|
but even if the function is |
|
The |
|
I know constexpr does not always need to be evaluated in compile time. |
|
To make the terminology a bit clearer: A function is marked |
yhmtsai
left a comment
There was a problem hiding this comment.
If the constexpr in the first place does not need to be checked, I am fine with the changes
20f7f32 to
98f29f6
Compare
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1695 +/- ##
========================================
Coverage 89.96% 89.96%
========================================
Files 763 763
Lines 62877 62878 +1
========================================
+ Hits 56570 56571 +1
Misses 6307 6307 ☔ View full report in Codecov by Sentry. |
This merge removes `GKO_ATTRIBUTES` from constexpr functions in math.hpp. Since we build cuda with `--expt-relaxed-constexpr` the `constexpr` is already enough to allow those functions on the device. Related PR: ginkgo-project#1695



This PR removes
GKO_ATTRIBUTESfrom constexpr functions in math.hpp. Since we build cuda with--expt-relaxed-constexprtheconstexpris already enough to allow those functions on the device.Fixes #1693.