Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ if(ENABLE_MKLCPU_BACKEND
OR ENABLE_MKLGPU_BACKEND
OR ENABLE_CUBLAS_BACKEND
OR ENABLE_ROCBLAS_BACKEND
OR ENABLE_NETLIB_BACKEND)
OR ENABLE_NETLIB_BACKEND
OR ENABLE_SYCLBLAS_BACKEND)
list(APPEND DOMAINS_LIST "blas")
endif()
if(ENABLE_MKLCPU_BACKEND
Expand All @@ -103,6 +104,15 @@ if(ENABLE_MKLGPU_BACKEND
list(APPEND DOMAINS_LIST "dft")
endif()

if(ENABLE_SYCLBLAS_BACKEND AND
(ENABLE_MKLCPU_BACKEND OR
ENABLE_MKLGPU_BACKEND OR
ENABLE_CUBLAS_BACKEND OR
ENABLE_ROCBLAS_BACKEND OR
ENABLE_NETLIB_BACKEND))
message(FATAL_ERROR "SYCL-BLAS backend cannot be enabled with other backends")
endif()

# Define required CXX compilers before project
if(CMAKE_CXX_COMPILER OR NOT ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++")
if(WIN32)
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ oneMKL is part of [oneAPI](https://oneapi.io).
<td align="center"><a href="https://github.com/ROCmSoftwarePlatform/rocRAND"> AMD rocRAND</a> for AMD GPU </td>
<td align="center">AMD GPU</td>
</tr>
<tr>
<td align="center"><a href="https://github.com/codeplaysoftware/sycl-blas"> SYCL-BLAS </a></td>
<td align="center">x86 CPU, Intel GPU, NVIDIA GPU, AMD GPU</td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -150,7 +154,7 @@ Supported domains: BLAS, LAPACK, RNG, DFT
</thead>
<tbody>
<tr>
<td rowspan=5 align="center">BLAS</td>
<td rowspan=6 align="center">BLAS</td>
<td align="center">x86 CPU</td>
<td rowspan=2 align="center">Intel(R) oneAPI Math Kernel Library</td>
<td align="center">Dynamic, Static</td>
Expand Down Expand Up @@ -178,6 +182,12 @@ Supported domains: BLAS, LAPACK, RNG, DFT
<td align="center">AMD rocBLAS</td>
<td align="center">Dynamic, Static</td>
<td align="center">LLVM*, hipSYCL</td>
</tr>
<tr >
<td align="center">x86 CPU, Intel GPU, NVIDIA GPU, AMD GPU</td>
<td align="center">SYCL-BLAS</td>
<td align="center">Dynamic, Static</td>
<td align="center">DPC++, LLVM*</td>
</tr>
<tr>
<td rowspan=4 align="center">LAPACK</td>
Expand Down Expand Up @@ -456,6 +466,7 @@ Python | 3.6 or higher | No | *N/A* | *Pre-installed or Installed by user* | [PS
[AMD rocSOLVER](https://github.com/ROCmSoftwarePlatform/rocSOLVER) | 5.0.0 | No | *N/A* | *Installed by user* |[AMD License](https://github.com/ROCmSoftwarePlatform/rocRAND/blob/develop/LICENSE.txt)
[NETLIB LAPACK](https://www.netlib.org/) | 3.7.1 | Yes | conan-community | ~/.conan/data or $CONAN_USER_HOME/.conan/data | [BSD like license](http://www.netlib.org/lapack/LICENSE.txt)
[Sphinx](https://www.sphinx-doc.org/en/master/) | 2.4.4 | Yes | pip | ~/.local/bin (or similar user local directory) | [BSD License](https://github.com/sphinx-doc/sphinx/blob/3.x/LICENSE)
[SYCL-BLAS](https://github.com/codeplaysoftware/sycl-blas) | 0.1 | No | *N/A* | *Installed by user* | [Apache License v2.0](https://github.com/codeplaysoftware/sycl-blas/blob/master/LICENSE)

*conan-center: https://api.bintray.com/conan/conan/conan-center*

Expand Down
49 changes: 49 additions & 0 deletions docs/building_the_project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,51 @@ A few often-used architectures are listed below:
- | Radeon Instinct(TM) MI 25 Accelerator
| Radeon(TM) RX Vega 64/56 Graphics

Building for SYCL-BLAS
^^^^^^^^^^^^^^^^^^^^^^

Note the SYCL-BLAS backend is experimental and currently only supports a
subset of the operations and features. The SYCL-BLAS backend cannot be enabled
with other backends and can only be used with the compile time dispatch.
The SYCL-BLAS backend uses the `SYCL-BLAS <https://github.com/codeplaysoftware/sycl-blas>`_
project as a header-only library.

* On Linux*

.. code-block:: bash

# Inside <path to onemkl>
mkdir build && cd build
cmake .. -DENABLE_SYCLBLAS_BACKEND=ON \
-DENABLE_MKLCPU_BACKEND=OFF \
-DENABLE_MKLGPU_BACKEND=OFF \
-DTARGET_DOMAINS=blas \
[-DREF_BLAS_ROOT=<reference_blas_install_prefix>] \ # required only for testing
[-Dsycl_blas_DIR=<path to SYCL-BLAS install directory>]
cmake --build .
./bin/test_main_blas_ct
cmake --install . --prefix <path_to_install_dir>


SYCL-BLAS will be downloaded automatically if not found.
By default, the SYCL-BLAS backend is not tuned for any specific device which
will impact performance.
SYCL-BLAS can be tuned for a specific hardware target by adding compiler
definitions in 2 ways:

#.
Manually specify a tuning target with ``-DSYCLBLAS_TUNING_TARGET=<target>``.
The list of SYCL-BLAS targets can be found
`here <https://github.com/codeplaysoftware/sycl-blas#cmake-options>`_.
This will automatically set ``-fsycl-targets`` if needed.
#.
If one target is set via ``-fsycl-targets`` the configuration step will
try to automatically detect the SYCL-BLAS tuning target. One can manually
specify ``-fsycl-targets`` via ``CMAKE_CXX_FLAGS``. See
`DPC++ User Manual <https://intel.github.io/llvm-docs/UsersManual.html>`_
for more information on ``-fsycl-targets``.


Build Options
^^^^^^^^^^^^^

Expand Down Expand Up @@ -551,6 +596,10 @@ CMake.
- ENABLE_MKLCPU_THREAD_TBB
- True, False
- True
* - *Not Supported*
- ENABLE_SYCLBLAS_BACKEND
- True, False
- False
* - build_functional_tests
- BUILD_FUNCTIONAL_TESTS
- True, False
Expand Down
3 changes: 3 additions & 0 deletions include/oneapi/mkl/blas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
#ifdef ENABLE_NETLIB_BACKEND
#include "oneapi/mkl/blas/detail/netlib/blas_ct.hpp"
#endif
#ifdef ENABLE_SYCLBLAS_BACKEND
#include "oneapi/mkl/blas/detail/syclblas/blas_ct.hpp"
#endif

namespace oneapi {
namespace mkl {
Expand Down
6 changes: 6 additions & 0 deletions include/oneapi/mkl/blas/detail/blas_ct_backends.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ namespace column_major {
#define BACKEND netlib
#include "blas_ct_backends.hxx"
#undef BACKEND
#define BACKEND syclblas
#include "blas_ct_backends.hxx"
#undef BACKEND

} //namespace column_major
namespace row_major {
Expand All @@ -70,6 +73,9 @@ namespace row_major {
#define BACKEND netlib
#include "blas_ct_backends.hxx"
#undef BACKEND
#define BACKEND syclblas
#include "blas_ct_backends.hxx"
#undef BACKEND

} //namespace row_major
} //namespace blas
Expand Down
57 changes: 57 additions & 0 deletions include/oneapi/mkl/blas/detail/syclblas/blas_ct.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/***************************************************************************
* Copyright (C) Codeplay Software Limited
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* For your convenience, a copy of the License has been included in this
* repository.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**************************************************************************/

#ifndef _DETAIL_SYCLBLAS_BLAS_CT_HPP_
#define _DETAIL_SYCLBLAS_BLAS_CT_HPP_

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#else
#include <CL/sycl.hpp>
#endif
#include <complex>
#include <cstdint>

#include "oneapi/mkl/types.hpp"
#include "oneapi/mkl/detail/backend_selector.hpp"
#include "oneapi/mkl/blas/detail/syclblas/onemkl_blas_syclblas.hpp"
#include "oneapi/mkl/blas/detail/blas_ct_backends.hpp"

namespace oneapi {
namespace mkl {
namespace blas {
namespace column_major {

#define MAJOR column_major
#include "blas_ct.hxx"
#undef MAJOR

} //namespace column_major
namespace row_major {

#define MAJOR row_major
#include "blas_ct.hxx"
#undef MAJOR

} //namespace row_major
} //namespace blas
} //namespace mkl
} //namespace oneapi

#endif //_DETAIL_SYCLBLAS_BLAS_CT_HPP_
Loading