Skip to content
Open
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
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ To use kokkos-fft, we need the following:
Since kokkos-fft is a header-only library, it is enough to simply add as a subdirectory. It is assumed that kokkos and kokkos-fft are placed under `<project_directory>/tpls`.

Here is an example to use kokkos-fft in the following CMake project.

```
---/
|
Expand All @@ -110,6 +111,7 @@ Here is an example to use kokkos-fft in the following CMake project.
```

The `CMakeLists.txt` would be

```CMake
cmake_minimum_required(VERSION 3.23)
project(kokkos-fft-as-subdirectory LANGUAGES CXX)
Expand All @@ -122,15 +124,35 @@ target_link_libraries(hello-kokkos-fft PUBLIC Kokkos::kokkos KokkosFFT::fft)
```

For compilation, we basically rely on the CMake options for Kokkos. For example, the compile options for A100 GPU is as follows.
```

```bash
cmake -B build \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-DKokkos_ENABLE_CUDA=ON \
-DKokkos_ARCH_AMPERE80=ON
cmake --build build -j 8
```
This way, all the functionalities are executed on A100 GPUs. For installation, details are provided in the [documentation](https://kokkosfft.readthedocs.io/en/latest/intro/building.html#install-kokkosfft-as-a-library).

This way, all the functionalities are executed on A100 GPUs. For installation, details are provided in the [documentation](https://kokkosfft.readthedocs.io/en/latest/intro/building.html#install-kokkosfft-by-cmake).

## Spack

kokkos-fft can also be installed with [spack](https://spack.io). For example, the recipe for H100 GPU with cufft is as follows.

```bash
git clone --depth=2 --branch=v1.0.1 https://github.com/spack/spack.git
source spack/share/spack/setup-env.sh # For bash

spack install kokkos-fft ^kokkos +cuda +wrapper cuda_arch=90
```

We have two main parameters to Spack:

* `host_backend`: Enable device backend FFT library (`fftw-serial` or `fftw-openmp`)
* `device_backend`: Enable device backend FFT library (e.g., `cufft`, `hipfft`, and `onemkl`)

To enable the device library, you need to install kokkos with the corresponding Kokkos backend. See [this page](https://kokkosfft.readthedocs.io/en/latest/intro/building.html#install-kokkosfft-by-spack) for detail.

## Support

Expand Down
30 changes: 28 additions & 2 deletions docs/intro/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ However, we have not tested all the listed compilers there and thus recommend th
* ``nvcc 11.0.0+`` - NVIDIA GPUs
* ``rocm 5.3.0+`` - AMD GPUs

Install kokkos-fft as a library
-------------------------------
Install kokkos-fft by CMake
---------------------------

Let's assume Kokkos is installed under ``<path/to/kokkos>`` with ``OpenMP`` backend. We build and install kokkos-fft under ``<path/to/kokkos-fft>``.

Expand Down Expand Up @@ -71,6 +71,32 @@ The code can be built as
-DCMAKE_PREFIX_PATH="<path/to/kokkos>;<path/to/kokkos-fft>"
cmake --build build -j 8

Install kokkos-fft by Spack
---------------------------

kokkos-fft can also be installed with [spack](https://spack.io). For example, the recipe for H100 GPU with cufft is as follows.

.. code-block:: bash

git clone --depth=2 --branch=v1.0.1 https://github.com/spack/spack.git
source spack/share/spack/setup-env.sh # For bash

# Automatically enables cufft backend
spack install kokkos-fft ^kokkos +cuda +wrapper cuda_arch=90

We have two main parameters to Spack:

* ``host_backend``: Enable device backend FFT library (``fftw-serial`` or ``fftw-openmp``)
* ``device_backend``: Enable device backend FFT library (e.g., ``cufft``, ``hipfft``, and ``onemkl``)

The code can be built as

.. code-block:: bash

spack load kokkos kokkos-fft
cmake -B build
cmake --build build -j 8

CMake options
-------------

Expand Down
Loading