spcl / dace

DaCe - Data Centric Parallel Programming
http://dace.is/fast
BSD 3-Clause "New" or "Revised" License
499 stars 129 forks source link

Fixed `dace::math::pow` for Integer case #1748

Open philip-paul-mueller opened 1 week ago

philip-paul-mueller commented 1 week ago

Added a pow specialization for dace::math::pow.

The new specialization works for integers if all arguments are integer the return value is guaranteed to be integer as well. This should also solve the issue with the fft test mentioned by Tal (https://github.com/spcl/dace/pull/1742/files#diff-a81c4594b19da98f6516283a50f6958b04976ae2913f097358141b2681868f3eR158). However, to work we need https://github.com/spcl/dace/pull/1747.

tbennun commented 1 week ago

@philip-paul-mueller That's a lot of modern C++. Can you verify that it conforms to C++14?

philip-paul-mueller commented 1 week ago

Yes everything is C++14, actually it looks a bit strange because for example std::is_integral_v is in C++17. We should consider switching to C++17.

I spotted a small error in the current implementation and also one in ipow which I fixed.

philip-paul-mueller commented 1 week ago

Actually If I have time I want to go through the runtime and fix some things there (for example the range class in pyinterop.h is wrong if (end - begin) % skip != 0 holds.

tbennun commented 1 week ago

Yes everything is C++14, actually it looks a bit strange because for example std::is_integral_v is in C++17. We should consider switching to C++17.

I spotted a small error in the current implementation and also one in ipow which I fixed.

We cannot do so yet, definitely not before 1.0. As far as I understand some of our target platforms do not support it and it will change our compiler requirements.

philip-paul-mueller commented 1 week ago

I currently have a strange error with template instantiation. I am looking into it as soon as I can.

philip-paul-mueller commented 1 week ago

@tbennun On the note about C++17, in HIP mode C++17 is used. https://github.com/spcl/dace/blob/02c9c3787d0c16c5a7a8ba006bf446d24c9a0443/dace/config_schema.yml#L313