You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/source/faq.rst
+2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
FAQ
2
2
###
3
3
4
+
.. _join-slack-workspace:
5
+
4
6
**How do I join the Kokkos slack channel?**
5
7
You can find the slack channel at `kokkosteam.slack.com <https://kokkosteam.slack.com>`_. Register a new account with your email. We reached the limit of whitelisted organizations, but every member of the Kokkos Slack workspace can invite more people. If no one you know is in the Slack workspace you can contact the Kokkos maintainers (their emails are in the LICENSE file).
<https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html>`_ for
21
+
more information.
22
+
23
+
See :doc:`requirements` for more information about platforms compatible with
24
+
Kokkos and a list of supported versions of compilers and software development
25
+
kits (SDKs).
11
26
12
-
Please become familiar with `Kokkos Requirements <https://kokkos.org/kokkos-core-wiki/requirements.html>`_, and verify that your machine has all necessary compilers, backend GPU SDK (e.g., CUDA, ROCM, Intel oneAPI, etc.),and build system components.
27
+
If you don’t already have CMake installed, see the `CMake installation guide
As an example, create a ``HelloKokkos.cpp`` with the following content:
37
80
81
+
.. code-block:: c++
38
82
39
-
.. note::
83
+
#include <Kokkos_Core.hpp>
40
84
41
-
Kokkos will attempt to autodetect GPU microarchitecture, but it is also possible to specify the desired `GPU architecture <https://kokkos.org/kokkos-core-wiki/keywords.html#gpu-architectures>`_. In scenarios where a device (GPU) backend (e.g., CUDA, HIP) is enabled, Kokkos will default to serial execution on the host (CPU).
85
+
int main(int argc, char** argv) {
86
+
Kokkos::initialize(argc, argv);
87
+
{
88
+
// Allocate a 1-dimensional view of integers
89
+
Kokkos::View<int*> v("v", 5);
90
+
// Fill view with sequentially increasing values v=[0,1,2,3,4]
The above configuration declares the executable you want to build
118
+
(``HelloKokkos``), and links it to Kokkos.
61
119
120
+
Now you can build and run your Kokkos program.
121
+
122
+
Start with calling ``cmake`` to configure the project and generate a native
123
+
build system:
124
+
125
+
.. code-block:: sh
126
+
127
+
MyProject> cmake -B build
128
+
-- The C compiler identification is GNU 10.2.1
129
+
-- The CXX compiler identification is GNU 10.2.1
130
+
...
131
+
-- Build files have been written to: .../MyProject/build
62
132
63
-
Building and Linking a Kokkos "Hello World"
64
-
-------------------------------------------
65
133
66
134
.. note::
67
135
68
-
``Kokkos_ROOT`` and the root directory for you target backend SDK (i.e., ``CUDA_ROOT``, ``ROCM_PATH``) will need to be set. ``Kokkos_ROOT`` should be set to the path of your Kokkos installation. In a modules environment, the SDK variables will be typically automatically set upon module loading (e.g., ``module load rocm/5.7.1``). Please see `Build, Install and Use <https://kokkos.org/kokkos-core-wiki/building.html>`_ for additional details. The example detailed below is in the Kokkos Core `example` directory.
136
+
If you want to target a NVIDIA GPU, you will need to pass an extra
137
+
``-DKokkos_ENABLE_CUDA=ON`` argument to the cmake command above. For an AMD
138
+
or an Intel GPU, you would use ``-DKokkos_ENABLE_HIP=ON`` or
139
+
``-DKokkos_ENABLE_SYCL=ON`` respectively. For a list of options and variables
140
+
available at configuration time, see :doc:`keywords`.
69
141
70
142
143
+
Then invoke that build system to actually compile/link the project:
Finally try to use the newly built ``HelloKokkos``:
153
+
154
+
.. code-block:: sh
155
+
156
+
MyProject>cd build
157
+
158
+
MyProject/build> HelloKokkos
159
+
Goodbye World
160
+
161
+
.. note::
162
+
163
+
Depending on your shell, the correct syntax may be ``HelloKokkos``,
164
+
``./HelloKokkos`` or ``.\HelloKokkos``.
165
+
166
+
Congratulations! You’ve successfully built and run a test binary using Kokkos.
81
167
82
168
83
-
Getting Help
84
-
------------
169
+
Getting help
170
+
~~~~~~~~~~~~
85
171
86
-
If you need additional help getting started, please join the `Kokkos Slack Channel <https://kokkosteam.slack.com>`_. Here are `sign up details <https://kokkos.org/kokkos-core-wiki/faq.html#faq>`_. Joining Kokkos Slack is the on ramp for becoming a project contributor.
172
+
If you need additional help getting started, please join the `Kokkos Slack
173
+
Workspace <https://kokkosteam.slack.com>`_. If you have trouble signing up see the
174
+
:ref:`FAQ entry on how to join <join-slack-workspace>`.
0 commit comments