Skip to content

Commit

Permalink
[oneDPL][Doc] Declare predefined dpcpp_default and dpcpp fpga pol…
Browse files Browse the repository at this point in the history
…icies as `const` (#1671)
  • Loading branch information
SergeyKopienko authored Aug 6, 2024
1 parent 13ab906 commit aec12a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions documentation/library_guide/macros.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ Macro Description
such as ``dpcpp_default`` and ``dpcpp_fpga``. When the macro is not defined (by default)
or evaluates to non-zero, predefined policies objects can be used.
When the macro is set to 0, predefined policies objects and make functions
without arguments, when ``make_device_policy()``,
``make_fpga_policy()``, are not available.
without arguments (``make_device_policy()`` and ``make_fpga_policy()``) are not available.
---------------------------------- ------------------------------
``ONEDPL_ALLOW_DEFERRED_WAITING`` This macro allows waiting for completion of certain algorithms executed with
device policies to be deferred. (Disabled by default.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ names for SYCL kernel functions. The |dpcpp_cpp| supports it by default;
for other compilers it may need to be enabled with compilation options such as
``-fsycl-unnamed-lambda``. Refer to your compiler documentation for more information.

The ``oneapi::dpl::execution::dpcpp_default`` object is a predefined object of
the ``device_policy`` class. It is created with a default kernel name and a default queue.
The ``oneapi::dpl::execution::dpcpp_default`` object is a predefined immutable object of
the ``device_policy`` class. It is created with a default kernel name and uses a default queue.
Use it to construct customized policy objects or pass directly when invoking an algorithm.

If ``dpcpp_default`` is passed directly to more than one algorithm, you must ensure that the
Expand Down Expand Up @@ -167,14 +167,14 @@ The default constructor of ``fpga_policy`` wraps a SYCL queue created
for ``fpga_selector``, or for ``fpga_emulator_selector``
if the ``ONEDPL_FPGA_EMULATOR`` is defined.

``oneapi::dpl::execution::dpcpp_fpga`` is a predefined object of
``oneapi::dpl::execution::dpcpp_fpga`` is a predefined immutable object of
the ``fpga_policy`` class created with a default unroll factor and a default kernel name.
Use it to create customized policy objects or pass directly when invoking an algorithm.

.. Note::

Specifying the unroll factor for a policy enables loop unrolling in the implementation of
your algorithms. The default value is 1.
|onedpl_short| algorithms. The default value is 1.
To find out how to choose a more precise value, refer to the `unroll Pragma <https://www.intel.com/content/www/us/en/docs/oneapi-fpga-add-on/developer-guide/current/unroll-pragma.html>`_
and `Loop Analysis <https://www.intel.com/content/www/us/en/docs/oneapi-fpga-add-on/developer-guide/current/loop-analysis.html>`_ content in
the `Intel® oneAPI FPGA Handbook
Expand Down
4 changes: 2 additions & 2 deletions include/oneapi/dpl/pstl/hetero/dpcpp/execution_sycl_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ class fpga_policy : public device_policy<KernelName>
// Starting with c++17 we can simply define sycl as inline variable.
# if _ONEDPL___cplusplus >= 201703L

inline device_policy<> dpcpp_default{__internal::__global_instance_tag{}};
inline const device_policy<> dpcpp_default{__internal::__global_instance_tag{}};
# if _ONEDPL_FPGA_DEVICE
inline fpga_policy<> dpcpp_fpga{__internal::__global_instance_tag{}};
inline const fpga_policy<> dpcpp_fpga{__internal::__global_instance_tag{}};
# endif // _ONEDPL_FPGA_DEVICE

# endif // _ONEDPL___cplusplus >= 201703L
Expand Down

0 comments on commit aec12a4

Please sign in to comment.