Skip to content

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