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: README.md
+4-59Lines changed: 4 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -285,70 +285,15 @@ We are currently developing Vulkan Kompute not to hide the Vulkan SDK interface
285
285
286
286
The build system provided uses `cmake`, which allows for cross platform builds.
287
287
288
-
### Build parameters (cmake)
288
+
The top level `Makefile` provides a set of optimized configurations for development as well as the docker image build, but you can start a build with the following command:
289
289
290
-
The recommended approach to build the project is as out-of-source build in the `build` folder. This project comes with a `Makefile` that provides a set of commands that help with developer workflows. You can see some of the commands if you want to add some of the more advanced commands.
291
-
292
-
For a base build you just have to run:
293
-
```
294
-
cmake -Bbuild
295
290
```
296
-
297
-
This by default configures without any of the extra build tasks (such as building shaders) and compiles without the optional dependencies. The table below provides more detail.
| -DDEBUG=1 | Enable debug build including debug flags (enabled by cmake debug build) |
325
-
| -DKOMPUTE_DISABLE_VK_DEBUG_LAYERS | Disable the debug Vulkan layers, mainly used for android builds |
326
-
327
-
### Dependencies
328
-
329
-
Given Kompute is expected to be used across a broad range of architectures and hardware, it will be important to make sure we are able to minimise dependencies.
330
-
331
-
#### Required dependencies
332
-
333
-
The only required dependency in the build is Vulkan. More specifically, the header files vulkan.h and vulkan.hpp, which are both part of the Vulkan SDK. If you haven't installed the Vulkan SDK yet, you can [download it here](https://vulkan.lunarg.com/).
334
-
335
-
#### Optional dependencies
336
-
337
-
SPDLOG is the preferred logging library, however by default Vulkan Kompute runs without SPDLOG by overriding the macros. It also provides an easy way to override the macros if you prefer to bring your own logging framework. The macro override is the following:
338
-
339
-
```c++
340
-
#ifndef KOMPUTE_LOG_OVERRIDE // Use this if you want to define custom macro overrides
341
-
#if KOMPUTE_SPDLOG_ENABLED // Use this if you want to enable SPDLOG
342
-
#include <spdlog/spdlog.h>
343
-
#endif//KOMPUTE_SPDLOG_ENABLED
344
-
// ... Otherwise it adds macros that use std::cout (and only print first element)
345
-
#endif // KOMPUTE_LOG_OVERRIDE
291
+
cmake -Bbuild
346
292
```
347
293
348
-
You can choose to build with or without SPDLOG by using the cmake flag `KOMPUTE_OPT_ENABLE_SPDLOG`.
349
-
350
-
Finally, remember that you will still need to set both the compile time log level with `SPDLOG_ACTIVE_LEVEL`, and the runtime log level with `spdlog::set_level(spdlog::level::debug);`.
294
+
You also are able to add Kompute in your repo with `add_subdirectory` - the [Android example CMakeLists.txt file](https://github.com/EthicalML/vulkan-kompute/blob/7c8c0eeba2cdc098349fcd999102bb2cca1bf711/examples/android/android-simple/app/src/main/cpp/CMakeLists.txt#L3) shows how this would be done.
351
295
296
+
For a more advanced overview of the build configuration check out the [Build System Deep Dive](https://kompute.cc/overview/build-system.html) documentation.
The recommended approach to build the project is as out-of-source build in the ``build`` folder. This project comes with a ``Makefile`` that provides a set of commands that help with developer workflows. You can see some of the commands if you want to add some of the more advanced commands.
6
+
7
+
For a base build you just have to run:
8
+
9
+
.. code-block::
10
+
11
+
cmake -Bbuild
12
+
13
+
This by default configures without any of the extra build tasks (such as building shaders) and compiles without the optional dependencies. The table below provides more detail.
- Enables local installation (which won't require admin privileges)
22
+
* - -DCMAKE_TOOLCHAIN_FILE="..."
23
+
- This is the path for your package manager if you use it such as vcpkg
24
+
* - -DKOMPUTE_OPT_BUILD_TESTS=1
25
+
- Enable if you wish to build and run the tests (must have deps installed.
26
+
* - -DKOMPUTE_OPT_BUILD_DOCS=1
27
+
- Enable if you wish to build the docs (must have docs deps installed)
28
+
* - -DKOMPUTE_OPT_BUILD_SINGLE_HEADER=1
29
+
- Option to build the single header file using "quom" utility
30
+
* - -DKOMPUTE_EXTRA_CXX_FLAGS="..."
31
+
- Allows you to pass extra config flags to compiler
32
+
* - -DKOMPUTE_OPT_INSTALL=0
33
+
- Disables the install step in the cmake file (useful for android build)
34
+
* - -DKOMPUTE_OPT_ANDROID_BUILD=1
35
+
- Enables android build which includes and excludes relevant libraries
36
+
37
+
38
+
Compile Flags
39
+
~~~~~~~~~~~~~
40
+
41
+
.. list-table::
42
+
:header-rows: 1
43
+
44
+
* - Flag
45
+
- Description
46
+
* - KOMPUTE_CREATE_PIPELINE_RESULT_VALUE
47
+
- Ensure the return value of createPipeline is processed as ResultValue instead of Result
48
+
* - -DKOMPUTE_VK_API_VERSION="..."
49
+
- Sets the default api version to use for vulkan kompute api
50
+
* - -DKOMPUTE_VK_API_MAJOR_VERSION=1
51
+
- Major version to use for the Vulkan API
52
+
* - -DKOMPUTE_VK_API_MINOR_VERSION=1
53
+
- Minor version to use for the Vulkan API
54
+
* - -DKOMPUTE_ENABLE_SPDLOG=1
55
+
- Enables the build with SPDLOG and FMT dependencies (must be installed)
56
+
* - -DKOMPUTE_LOG_VERRIDE=1
57
+
- Does not define the SPDLOG_\ :raw-html-m2r:`<LEVEL>` macros if these are to be overridden
58
+
* - -DSPDLOG_ACTIVE_LEVEL
59
+
- The level for the log level on compile level (whether spdlog is enabled)
60
+
* - -DVVK_USE_PLATFORM_ANDROID_KHR
61
+
- Flag to enable android imports in kompute (enabled with -DKOMPUTE_OPT_ANDROID_BUILD)
62
+
* - -DRELEASE=1
63
+
- Enable release build (enabled by cmake release build)
64
+
* - -DDEBUG=1
65
+
- Enable debug build including debug flags (enabled by cmake debug build)
66
+
* - -DKOMPUTE_DISABLE_VK_DEBUG_LAYERS
67
+
- Disable the debug Vulkan layers, mainly used for android builds
68
+
69
+
70
+
Dependencies
71
+
^^^^^^^^^^^^
72
+
73
+
Given Kompute is expected to be used across a broad range of architectures and hardware, it will be important to make sure we are able to minimise dependencies.
74
+
75
+
Required dependencies
76
+
~~~~~~~~~~~~~~~~~~~~~
77
+
78
+
The only required dependency in the build is Vulkan. More specifically, the header files vulkan.h and vulkan.hpp, which are both part of the Vulkan SDK. If you haven't installed the Vulkan SDK yet, you can `download it here <https://vulkan.lunarg.com/>`_.
79
+
80
+
Optional dependencies
81
+
~~~~~~~~~~~~~~~~~~~~~
82
+
83
+
SPDLOG is the preferred logging library, however by default Vulkan Kompute runs without SPDLOG by overriding the macros. It also provides an easy way to override the macros if you prefer to bring your own logging framework. The macro override is the following:
84
+
85
+
.. code-block:: c++
86
+
87
+
#ifndef KOMPUTE_LOG_OVERRIDE // Use this if you want to define custom macro overrides
88
+
#if KOMPUTE_SPDLOG_ENABLED // Use this if you want to enable SPDLOG
89
+
#include <spdlog/spdlog.h>
90
+
#endif //KOMPUTE_SPDLOG_ENABLED
91
+
// ... Otherwise it adds macros that use std::cout (and only print first element)
92
+
#endif // KOMPUTE_LOG_OVERRIDE
93
+
94
+
You can choose to build with or without SPDLOG by using the cmake flag ``KOMPUTE_OPT_ENABLE_SPDLOG``.
95
+
96
+
Finally, remember that you will still need to set both the compile time log level with ``SPDLOG_ACTIVE_LEVEL``\ , and the runtime log level with ``spdlog::set_level(spdlog::level::debug);``.
0 commit comments