diff --git a/docs/README.md b/docs/README.md index 040d22aac..5120b33c8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,9 @@ This folder contains oneMKL documentation in reStructuredText (rST) format. The documentation build step is skipped by default. To enable building documentation from the main build, set `-DBUILD_DOC=ON`. -For more information see [Building with CMake](../README.md#building-with-cmake). + +Make sure you have Sphinx installed: +`pip install sphinx` To build documentation only, use the following commands from the current folder: ```bash diff --git a/docs/create_new_backend.rst b/docs/create_new_backend.rst index 8f25bda33..1eaaf3562 100644 --- a/docs/create_new_backend.rst +++ b/docs/create_new_backend.rst @@ -38,13 +38,13 @@ If there is no need for multiple wrappers only ```` and ``<3rd-party lib For each new backend library, you should create the following two header files: * Header file with a declaration of entry points to the new third-party library wrappers -* Compiler-time dispatching interface (see `oneMKL Usage Models <../README.md#supported-usage-models>`_) for new third-party libraries +* Compile-time dispatching interface (see `oneMKL Usage Models <../README.md#supported-usage-models>`_) for new third-party libraries **Header File Example**: command to generate the header file with a declaration of BLAS entry points in the oneapi::mkl::newlib namespace .. code-block:: bash - python scripts/generate_backend_api.py include/oneapi/mkl/blas.hpp \ # Base header file + python scripts/generate_backend_api.py include/oneapi/mkl/blas.hxx \ # Base header file include/oneapi/mkl/blas/detail/newlib/onemkl_blas_newlib.hpp \ # Output header file oneapi::mkl::newlib # Wrappers namespace @@ -61,10 +61,13 @@ Code snippet of the generated header file ``include/oneapi/mkl/blas/detail/newli -**Compile-time Dispatching Interface Example**: command to generate the compile-time dispatching interface template instantiations for ``newlib`` and supported device ``newdevice`` +**Compile-time Dispatching Interface Example**: commands to generate the compile-time dispatching interface template instantiations for ``newlib`` and supported device ``newdevice`` .. code-block:: bash + python scripts/generate_ct_templates.py include/oneapi/mkl/blas.hxx \ # Base header file + include/oneapi/mkl/blas/detail/blas_ct_templates.hpp # Output header file + python scripts/generate_ct_instant.py include/oneapi/mkl/blas/detail/blas_ct_templates.hpp \ # Base header file include/oneapi/mkl/blas/detail/newlib/blas_ct.hpp \ # Output header file include/oneapi/mkl/blas/detail/newlib/onemkl_blas_newlib.hpp \ # Header file with declaration of entry points to wrappers @@ -72,6 +75,17 @@ Code snippet of the generated header file ``include/oneapi/mkl/blas/detail/newli newdevice \ # Backend name oneapi::mkl::newlib # Wrappers namespace +Code snippet of the generated template header file ``include/oneapi/mkl/blas/detail/blas_ct_templates.hpp`` + +.. code-block:: cpp + + #include "oneapi/mkl/types.hpp" + #include "oneapi/mkl/detail/backends.hpp" + + template + static inline void asum(sycl::queue &queue, std::int64_t n, sycl::buffer, 1> &x, + std::int64_t incx, sycl::buffer &result); + Code snippet of the generated header file ``include/oneapi/mkl/blas/detail/newlib/blas_ct.hpp`` .. code-block:: cpp @@ -124,6 +138,7 @@ Below you can see structure of oneMKL top-level include directory: / / +Note: The actual structure may be different than what is shown here. To ensure your addition of a new backend is correct, verify that the above scripts correctly generate sample header files from the new files you have added. To integrate the new third-party library to a oneMKL header-based part, following files from this structure should be updated: @@ -402,7 +417,7 @@ Here is the list of files that should be created/updated to integrate the new wr + PUBLIC ONEMKL::NEWLIB::NEWLIB ) -Now you can build the backend library for ``newlib`` to make sure the third-party library integration was completed successfully (for more information, see `Build with cmake <../README.md#building-with-cmake>`_) +Now you can build the backend library for ``newlib`` to make sure the third-party library integration was completed successfully (for more information, see `Building the Project with DPC++ `_) .. code-block:: bash @@ -499,7 +514,7 @@ Update the following files to enable the new third-party library for unit tests: + devices.push_back(sycl::device(sycl::host_selector())); + #endif -Now you can build and run functional testing for enabled third-party libraries (for more information see `Build with cmake <../README.md#building-with-cmake>`_). +Now you can build and run functional testing for enabled third-party libraries (for more information see `Building the Project with DPC++ `_). .. code-block:: bash