Issue 172061
Summary clang should support way to access OpenCL precision for sqrt and fdiv, or more general way to set !fpmath
Labels clang, backend:AMDGPU, cuda, OpenCL, floating-point
Assignees
Reporter arsenm
    By default, OpenCL only requires 2.5 ulp on fdiv and sqrt. Other languages assume correctly rounded by default. Currently this is indicated by adding `!fpmath` metadata set directly on sqrt calls and divide operators based on the language mode. This can be disabled with the global `-cl-fp32-correctly-rounded-divide-sqrt` flag. For HIP , the default is correctly rounded but relaxable to the OpenCL precision with another global flag, -fno-hip-fp32-correctly-rounded-divide-sqrt.

There is no way to access this from the scope of an individual operation. From C++ and other languages, there is no way to access this behavior. We could either have a new general pragma or builtin for marking a sequence with fpmath metadata, or a new elementwise builtin with this precision target. 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to