Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic device support to dft domain through portFFT #570

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ oneMKL is part of the [UXL Foundation](http://www.uxlfoundation.org).
</tr>
<tr>
<td align="center"><a href="https://github.com/codeplaysoftware/portFFT"> portFFT </a></td>
<td align="center">x86 CPU, Intel GPU, NVIDIA GPU, AMD GPU</td>
<td align="center">x86 CPU, Intel GPU, NVIDIA GPU, AMD GPU, Other SYCL devices (unsupported)</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -278,7 +278,7 @@ Supported compilers include:
<td align="center">Dynamic, Static</td>
</tr>
<tr>
<td rowspan=8 align="center">DFT</td>
<td rowspan=9 align="center">DFT</td>
<td rowspan=2 align="center">x86 CPU</td>
<td align="center">Intel(R) oneMKL</td>
<td align="center">Intel DPC++</td>
Expand Down Expand Up @@ -322,6 +322,12 @@ Supported compilers include:
<td align="center">Open DPC++</td>
<td align="center">Dynamic, Static</td>
</tr>
<tr>
<td rowspan=1 align="center">Other SYCL devices (unsupported)</td>
<td align="center">portFFT</td>
<td align="center">Open DPC++</br>Open DPC++</td>
<td align="center">Dynamic, Static</td>
</tr>
<tr>
<td rowspan=2 align="center">SPARSE_BLAS</td>
<td align="center">x86 CPU</td>
Expand Down
23 changes: 19 additions & 4 deletions docs/building_the_project_with_dpcpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ SYCL enables portable heterogeneous computing on a wide range of accelerators.
Consequently, it is possible to use oneMKL Interfaces with accelerators not
anticipated by the oneMKL Interfaces team.

For generic SYCL devices, only the portBLAS backend is enabled. The user must
set the appropriate ``-fsycl-targets`` for their device, and also any
``PORTBLAS_TUNING_TARGET`` required for performance. See
`Building for portBLAS`_. Extensive testing is strongly advised for these
For generic SYCL devices, only portBLAS and portFFT backend are enabled.
The user must set the appropriate ``-fsycl-targets`` for their device, and also
any other option required for performance. See `Building for portBLAS`_ and
`Building for portFFT`_. Extensive testing is strongly advised for these
unsupported configurations.

.. _build_for_portlibs_dpcpp:
Expand Down Expand Up @@ -438,6 +438,21 @@ Note that this is not a tested configuration. This builds oneMKL Interfaces
with the portBLAS backend only, for a generic SYCL device supported by the
Open DPC++ project.

Build oneMKL for the DFT domain on a generic SYCL device:

.. code-block:: bash

cmake $ONEMKL_DIR \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DENABLE_MKLCPU_BACKEND=False \
-DENABLE_MKLGPU_BACKEND=False \
-DENABLE_PORTFFT_BACKEND=True

Note that this is not a tested configuration. This builds oneMKL Interfaces
with the portFFT backend only, for a generic SYCL device supported by the
Open DPC++ project.

.. _project_cleanup:

Project Cleanup
Expand Down
6 changes: 6 additions & 0 deletions include/oneapi/mkl/detail/backends_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ static std::map<domain, std::map<device, std::vector<const char*>>> libraries =
#endif
#ifdef ENABLE_PORTFFT_BACKEND
LIB_NAME("dft_portfft")
#endif
} },
{ device::generic_device,
{
#ifdef ENABLE_PORTFFT_BACKEND
LIB_NAME("dft_portfft"),
#endif
} } } },

Expand Down
3 changes: 1 addition & 2 deletions include/oneapi/mkl/detail/get_device_id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ inline oneapi::mkl::device get_device_id(sycl::queue &queue) {
device_id = device::nvidiagpu;
else if (vendor_id == AMD_ID)
device_id = device::amdgpu;
else {
else
device_id = device::generic_device;
}
}
else {
device_id = device::generic_device;
Expand Down
2 changes: 1 addition & 1 deletion src/include/function_table_initializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class table_initializer {
}

private:
#ifdef ENABLE_PORTBLAS_BACKEND
#if defined(ENABLE_PORTBLAS_BACKEND) || defined(ENABLE_PORTFFT_BACKEND)
static constexpr bool is_generic_device_supported = true;
#else
static constexpr bool is_generic_device_supported = false;
Expand Down