Skip to content

Commit

Permalink
Call it oneMKL Interfaces; more formatting to 80 columns
Browse files Browse the repository at this point in the history
  • Loading branch information
hjabird committed Jun 14, 2024
1 parent addbea1 commit 73d3510
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 38 deletions.
4 changes: 2 additions & 2 deletions docs/building_and_running_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Building and Running Tests
==========================

The functional are tests are enabled by default, and can be enabled/disabled
with the CMake build parameter ``-DBUILD_FUNCTIONAL_TESTS=True/False``. Only tests
relevant for the enabled backends and target domains are built.
with the CMake build parameter ``-DBUILD_FUNCTIONAL_TESTS=True/False``. Only
tests relevant for the enabled backends and target domains are built.

Building tests for some domains may require additional libraries for reference.

Expand Down
2 changes: 1 addition & 1 deletion docs/building_the_project_with_adaptivecpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Environment Setup
Build Commands
###############

In most cases, building oneMKL is as simple as setting the compiler and
In most cases, building oneMKL Interfaces is as simple as setting the compiler and
selecting the desired backends to build with.

On Linux (other OSes are not supported with the AdaptiveCpp compiler):
Expand Down
10 changes: 5 additions & 5 deletions docs/building_the_project_with_dpcpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Building the Project with DPC++
===============================

This page describes building the oneMKL interface library with either the
Intel(R) oneAPI DPC++ Compiler or open-source oneAPI DPC++ Compiler. For
guidance on building the project with AdaptiveCpp, see
This page describes building the oneMKL Interfaces with either the Intel(R)
oneAPI DPC++ Compiler or open-source oneAPI DPC++ Compiler. For guidance on
building the project with AdaptiveCpp, see
:ref:`building_the_project_with_adaptivecpp`.

.. _build_setup_with_dpcpp:
Expand Down Expand Up @@ -148,8 +148,8 @@ In most cases, ``TARGET_DOMAINS`` is set automatically according to the domains
supported by the backend libraries enabled. However, while most backend
libraries support only one of these domains, but some may support multiple. For
example, the ``MKLCPU`` backend supports every domain. To enable support for
only the BLAS domain in the oneMKL interface library whilst compiling with
``MKLCPU``, ``TARGET_DOMAINS`` could be set to ``blas``. To enable BLAS and DFT,
only the BLAS domain in the oneMKL Interfaces whilst compiling with ``MKLCPU``,
``TARGET_DOMAINS`` could be set to ``blas``. To enable BLAS and DFT,
``-DTARGET_DOMAINS="blas dft"`` would be used.


Expand Down
64 changes: 34 additions & 30 deletions docs/using_onemkl_with_cmake.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.. _using_onemkl_interface_library_with_cmake:

Using the oneMKL Interface Library in your project with CMake
Using the oneMKL Interfaces in your project with CMake
=============================================================

The CMake build tool can help you use oneMKL Interface Library in your own project.
The CMake build tool can help you use oneMKL Interfaces in your own project.
Instead of manually linking and including directories, you can use the CMake targets
exported by the oneMKL Interface Library project. You can use oneMKL in one of two
exported by the oneMKL Interfaces project. You can use oneMKL in one of two
forms, with the target names depending on the approach taken:

* you can use a previously installed copy, either from a binary distribution
Expand All @@ -18,12 +18,13 @@ See the section `using_with_fetchcontent`_.

.. _using_from_installed_binary:

Using an installed oneMKL Interface Library
###########################################
Using an installed oneMKL Interfaces
####################################

If the oneMKL interfaces have been previously installed, either by building from source or as a distributed
binary, they can be consumed using CMake using ``find_package(oneMKL REQUIRED)``. The compiler used
for the target library or application should match that used to build oneMKL interface library.
If the oneMKL Interfaces have been previously installed, either by building from
source or as a distributed binary, they can be consumed using CMake using
``find_package(oneMKL REQUIRED)``. The compiler used for the target library or
application should match that used to build oneMKL Interfaces.

For example:

Expand All @@ -37,32 +38,32 @@ To link against the entire library, the ``MKL::onemkl`` target should be used.
For specific domains, ``MKL::onemkl_<domain>`` should be used.
And for specific backends, ``MKL::onemkl_<domain>_<backend>`` should be used.

When using a binary, it may be useful to know the backends that were enabled during the build.
To check for the existence of backends, CMake's ``if(TARGET <target>)`` construct can be used.
For example, with the ``cufft`` backend:
When using a binary, it may be useful to know the backends that were enabled
during the build. To check for the existence of backends, CMake's ``if(TARGET
<target>)`` construct can be used. For example, with the ``cufft`` backend:

.. code-block:: cmake
if(TARGET MKL::onemkl_dft_cufft)
target_link_libraries(myTarget PRIVATE MKL::onemkl_dft_cufft)
else()
message(FATAL_ERROR "oneMKL interface was not built with CuFFT backend")
message(FATAL_ERROR "oneMKL Interfaces was not built with CuFFT backend")
endif()
If oneMKL has been installed to a non-standard location, the operating system
may not find the backend libraries when they're lazily loaded at runtime.
To make sure they're found you may need to set ``LD_LIBRARY_PATH=<onemkl_install_dir>/lib:$LD_LIBRARY_PATH``
on Linux.
If oneMKL Interfaces has been installed to a non-standard location, the
operating system may not find the backend libraries when they're lazily loaded
at runtime. To make sure they're found you may need to set
``LD_LIBRARY_PATH=<onemkl_install_dir>/lib:$LD_LIBRARY_PATH`` on Linux.

.. _using_with_fetchcontent:

Using CMake's FetchContent
##########################


The FetchContent_ functionality of CMake can be used to download, build and install oneMKL
interface library as part of the build.
The FetchContent_ functionality of CMake can be used to download, build and
install oneMKL Interfaces as part of the build.

For example:

Expand All @@ -81,18 +82,21 @@ For example:
target_link_libraries(myTarget PRIVATE onemkl)
The build parameters should be appropriately set before ``FetchContent_Declare``.
See :ref:`building_the_project_with_dpcpp` or :ref:`building_the_project_with_adaptivecpp`.

To link against the main library with run-time dispatching, use the target ``onemkl``.
To link against particular domains, use the target ``onemkl_<domain>``. For example, ``onemkl_blas`` or ``onemkl_dft``.
To link against particular backends (as required for static dispatch of oneAPI calls to a particular backend),
use the target ``onemkl_<domain>_<backend>``. For example, ``onemkl_dft_cufft``.

When using the run-time dispatch mechanism, it is likely that the operating system
will not find the backend libraries when they're loaded at runtime.
To make sure they're found you may need to set ``LD_LIBRARY_PATH=<onemkl_install_dir>/lib:$LD_LIBRARY_PATH``
on Linux.
The build parameters should be appropriately set before
``FetchContent_Declare``. See :ref:`building_the_project_with_dpcpp` or
:ref:`building_the_project_with_adaptivecpp`.

To link against the main library with run-time dispatching, use the target
``onemkl``. To link against particular domains, use the target
``onemkl_<domain>``. For example, ``onemkl_blas`` or ``onemkl_dft``. To link
against particular backends (as required for static dispatch of oneAPI calls to
a particular backend), use the target ``onemkl_<domain>_<backend>``. For
example, ``onemkl_dft_cufft``.

When using the run-time dispatch mechanism, it is likely that the operating
system will not find the backend libraries when they're loaded at runtime. To
make sure they're found you may need to set
``LD_LIBRARY_PATH=<onemkl_install_dir>/lib:$LD_LIBRARY_PATH`` on Linux.


.. _FetchContent: https://cmake.org/cmake/help/latest/module/FetchContent.html

0 comments on commit 73d3510

Please sign in to comment.