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

some standard mathematical functions are missing in std #16

Open
Clothoid1 opened this issue Nov 25, 2021 · 2 comments
Open

some standard mathematical functions are missing in std #16

Clothoid1 opened this issue Nov 25, 2021 · 2 comments

Comments

@Clothoid1
Copy link

This is a minor issue, i am just reporting this so that this does not get lost.

When trying to use
std::sqrtf()
std::fabsf()
std::powf()
...
and compiling with circle to SPIR-V binaries, one gets the error message:
'sqrtf' is not a member of std

In modern C++ such code should work, so circle should be able to compile such code.
(knowing that a workaround is trivial - so really a low prio issue)

@seanbaxter
Copy link
Owner

Can you submit a repro case? sqrtf is definitely supported by the backend.

@Clothoid1
Copy link
Author

Clothoid1 commented Nov 29, 2021

I can reproduce it with a very simple compute shader:

#include <cmath>

float sqrt_float(float aValue_in) { return std::sqrtf(aValue_in); }

[[using spirv:comp, local_size(8, 8, 1)]] void main() { uint x = glcomp_GlobalInvocationID.x; uint y = glcomp_GlobalInvocationID.y; }

when i compile that (stored in a file test.cxx) with
./circle -shader -c -emit-spirv test.cxx
i get the error message:
'sqrtf' is not a member of namespace std

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

No branches or pull requests

2 participants