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

Remove redundant -cl-unsafe-math-optimizations option. #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dfukalov
Copy link

@dfukalov dfukalov commented Feb 1, 2021

OpenCL spec (https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/clBuildProgram.html) says that "cl-unsafe-math-optimizations" option allows a lot of optimizations and generated source code of Add tests can be completely optimized out. E.g.

s0=10.f-s0;
s0=10.f-s0;

can be optimized to

s0=s0;

when -cl-unsafe-math-optimizations is specified. At least clang compiler started to eliminate this code a time ago.

It seems for this trivial test the option should be removed in order to avoid such optimizations.

OpenCL spec (https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/clBuildProgram.html) says that "cl-unsafe-math-optimizations" option allows a lot of optimizations and generated source code of Add<N> tests can be completely optimized out. E.g.
 s0=10.f-s0;
 s0=10.f-s0;
can be optimized to
s0=s0;
when -cl-unsafe-math-optimizations is specified. At least clang compiler started to eliminate this code a time ago.

It seems for this trivial test the option should be removed in order to avoid such optimizations.
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.

1 participant