diff --git a/adoc/chapters/opencl_backend.adoc b/adoc/chapters/opencl_backend.adoc index 70b829c3..37bc993c 100644 --- a/adoc/chapters/opencl_backend.adoc +++ b/adoc/chapters/opencl_backend.adoc @@ -1185,6 +1185,18 @@ standard output all of the SYCL classes and primitives, and covers the capabilities defined in the OpenCL 1.2 specification document <>. + +== Precision of built-in math functions + +When the SYCL built-in functions defined in sections <> +through <> are called from a kernel running on the +OpenCL backend, their precision is the same as the corresponding OpenCL +functions as specified for the OpenCL profile. +See ch. 6.12.2 through ch. 6.12.6 of the OpenCL 1.2 specification for the +definition of these corresponding OpenCL functions. + + + // %%%%%%%%%%%%%%%%%%%%%%%%%%%% end opencl_extensions %%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%% end opencl_backend %%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index a5a1c38e..806db7a2 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -20839,17 +20839,11 @@ determined by their linear id. -- +[[sec:math-functions]] === Math functions -In SYCL the OpenCL math functions are available in the namespace [code]#sycl# on -host and device with the same precision guarantees as defined in the OpenCL 1.2 -specification document <> for host and device. -For a SYCL platform the numerical requirements for host need to match the -numerical requirements of the OpenCL math built-in functions. - -The built-in functions available for SYCL host and device, with the same -precision requirements for both host and device, are described in -<>. +<> describes the math functions that are available in the +[code]#sycl# namespace in both host and device code. The function descriptions in this section use the term _writeable address space_ to represent the following address spaces: @@ -23528,13 +23522,15 @@ corresponding [code]#vec#. === Native precision math functions -In SYCL the implementation-defined precision math functions are defined in the -namespace [code]#sycl::native#. -The functions that are available within this namespace are specified in -<>. +<> describes the native precision math functions +that are available in the [code]#sycl::native# namespace in both host and device +code. -The range of valid input values and the maximum error for these functions is -implementation defined. +The precision requirements and the set of legal input values for these functions +are defined in the backend specification. +The intent is that these functions might make use of native device functionality +which has better performance than their counterparts in <>, +but they may sacrifice accuracy or limit the set of legal input values. [[table.native.math.functions]] .Native precision math functions @@ -23991,12 +23987,14 @@ corresponding [code]#vec#. === Half precision math functions -In SYCL the half precision math functions are defined in the namespace -[code]#sycl::half_precision#. -The functions that are available within this namespace are specified in -<>. -These functions are implemented with a minimum of 10-bits of accuracy i.e. the -maximum error is less than or equal to 8192 ulp. +<> describes the half precision math functions that +are available in the [code]#sycl::half_precision# namespace in both host and +device code. + +The precision requirements for these functions are defined in the backend +specification. +The intent is that these functions have higher performance than their +counterparts in <>, but they have lower accuracy. [[table.half.math.functions]] .Half precision math functions @@ -25320,11 +25318,8 @@ corresponding [code]#vec#. === Common functions -In SYCL the OpenCL [keyword]#common functions# are available in the namespace -[code]#sycl# on host and device as defined in the OpenCL 1.2 specification -document <>. -They are described here in <>. +<> describes the common functions that are available in +the [code]#sycl# namespace in both host and device code. The function descriptions in this section use the term _generic floating point type_ to represent the following types: @@ -25784,15 +25779,8 @@ corresponding [code]#vec#. [[sec:geometric-functions]] === Geometric functions -In SYCL the OpenCL [keyword]#geometric functions# are available in the namespace -[code]#sycl# on host and device as defined in the OpenCL 1.2 specification -document <>. -On the host the vector types use the [code]#vec# class and on an SYCL device use -the corresponding native <> vector types. -All of the geometric functions use round-to-nearest-even rounding mode. -<> contains the definitions of supported geometric -functions. +<> describes the geometric functions that are +available in the [code]#sycl# namespace in both host and device code. The function descriptions in this section use two terms that refer to a specific list of types. @@ -26055,10 +26043,11 @@ corresponding [code]#vec#. |==== +[[sec:relational-functions]] === Relational functions -The functions in <> are defined in the [code]#sycl# -namespace and are available on both host and device. +<> describes the relational functions that are +available in the [code]#sycl# namespace in both host and device code. These functions perform various relational comparisons on [code]#vec#, [code]#marray#, and scalar types.