NVIDIA / MatX

An efficient C++17 GPU numerical computing library with Python-like syntax
https://nvidia.github.io/MatX
BSD 3-Clause "New" or "Revised" License
1.21k stars 83 forks source link

[BUG] ‘::rsqrt’ has not been declared when building MatX #705

Closed HugoPhibbs closed 2 months ago

HugoPhibbs commented 2 months ago

Describe the Bug A clear and concise description of what the bug is.

I include matx.h at the top of my file, and I get an error saying that rsqrt has not been declared.

This was following a clean build and install of the latest MatX changes (from commit #703), but don't know which commit caused it. But before pulling I was up to commit #8b8da5a0

To Reproduce Steps to reproduce the behavior: Basically I pulled the latest changes commit #e2cb0de (PR #703) built my tests and got the trace:

In file included from /usr/local/include/matx/core/type_utils.h:44,
                 from /usr/local/include/matx/core/pybind.h:34,
                 from /usr/local/include/matx/core/file_io.h:47,
                 from /usr/local/include/matx.h:41,
                 from /home/hphi344/Documents/GS-DBSCAN-CPP/test/../include/TestUtils.h:14,
                 from /home/hphi344/Documents/GS-DBSCAN-CPP/test/TestUtils.cpp:6:
/usr/local/include/matx/core/half.h: In function ‘matx::matxHalf<T> matx::rsqrt(const matx::matxHalf<T>&)’:
/usr/local/include/matx/core/half.h:704:27: error: ‘::rsqrt’ has not been declared
  704 |   return static_cast<T>(::rsqrt(static_cast<float>(x.x)));

Expected Behavior Build with no errors

Code Snippets If applicable, add code snippets to help explain your problem.

System Details (please complete the following information):

Additional Context May be a config issue on my behalf, but I'd be keen to see if you guys can reproduce it.

cliffburdick commented 2 months ago

Thanks @HugoPhibbs . This is caused by building with a host compiler usually in a cpp file. We don't test this typically so sometimes it breaks. This is fixed in https://github.com/NVIDIA/MatX/pull/706/