Skip to content

Commit 6f3c5d2

Browse files
authored
fix some linter warnings
1 parent b4e5608 commit 6f3c5d2

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
21
# Least-Squares Support-Vector Machine   [![Codacy Badge](https://app.codacy.com/project/badge/Grade/e780a63075ce40c29c49d3df4f57c2af)](https://www.codacy.com/gh/SC-SGS/PLSSVM/dashboard?utm_source=github.com&utm_medium=referral&utm_content=SC-SGS/PLSSVM&utm_campaign=Badge_Grade)   [![Generate documentation](https://github.com/SC-SGS/PLSSVM/actions/workflows/documentation.yml/badge.svg)](https://vancraar.github.io/PLSSVM/)   [![Build Status Linux CPU + GPU](https://simsgs.informatik.uni-stuttgart.de/jenkins/buildStatus/icon?job=PLSSVM%2FMultibranch-Github%2Fmain&subject=Linux+CPU/GPU)](https://simsgs.informatik.uni-stuttgart.de/jenkins/view/PLSSVM/job/PLSSVM/job/Multibranch-Github/job/main/)   [![Windows CPU](https://github.com/SC-SGS/PLSSVM/actions/workflows/msvc_windows.yml/badge.svg)](https://github.com/SC-SGS/PLSSVM/actions/workflows/msvc_windows.yml)
32

43
Implementation of a parallel [least-squares support-vector machine](https://en.wikipedia.org/wiki/Least-squares_support-vector_machine) using multiple different backends.
54
The currently available backends are:
5+
66
- [OpenMP](https://www.openmp.org/)
77
- [CUDA](https://developer.nvidia.com/cuda-zone)
88
- [OpenCL](https://www.khronos.org/opencl/)
@@ -13,26 +13,32 @@ The currently available backends are:
1313
### Dependencies
1414

1515
General dependencies:
16+
1617
- a C++17 capable compiler (e.g. [`gcc`](https://gcc.gnu.org/) or [`clang`](https://clang.llvm.org/))
1718
- [CMake](https://cmake.org/) 3.18 or newer
1819
- [cxxopts](https://github.com/jarro2783/cxxopts), [fast_float](https://github.com/fastfloat/fast_float) and [{fmt}](https://github.com/fmtlib/fmt) (all three are automatically build during the CMake configuration if they couldn't be found using the respective `find_package` call)
1920
- [GoogleTest](https://github.com/google/googletest) if testing is enabled (automatically build during the CMake configuration if `find_package(GTest)` wasn't successful)
2021
- [doxygen](https://www.doxygen.nl/index.html) if documentation generation is enabled
2122

2223
Additional dependencies for the OpenMP backend:
24+
2325
- compiler with OpenMP support
2426

2527
Additional dependencies for the CUDA backend:
28+
2629
- CUDA SDK
2730
- either NVIDIA [`nvcc`](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html) or [`clang` with CUDA support enabled](https://llvm.org/docs/CompileCudaWithLLVM.html)
2831

2932
Additional dependencies for the OpenCL backend:
33+
3034
- OpenCL runtime and header files
3135

3236
Additional dependencies for the SYCL backend:
37+
3338
- the code must be compiled with a SYCL capable compiler; currently tested with [DPC++](https://github.com/intel/llvm) and [hipSYCL](https://github.com/illuhad/hipSYCL)
3439

3540
Additional dependencies if `PLSSVM_ENABLE_TESTING` and `PLSSVM_GENERATE_TEST_FILE` are both set to `ON`:
41+
3642
- [Python3](https://www.python.org/) with the [`argparse`](https://docs.python.org/3/library/argparse.html) and [`sklearn`](https://scikit-learn.org/stable/) modules
3743

3844
### Building
@@ -51,6 +57,7 @@ Building the library can be done using the normal CMake approach:
5157

5258
The **required** CMake option `PLSSVM_TARGET_PLATFORMS` is used to determine for which targets the backends should be compiled.
5359
Valid targets are:
60+
5461
- `cpu`: compile for the CPU; **no** architectural specifications is allowed
5562
- `nvidia`: compile for NVIDIA GPUs; **at least one** architectural specification is necessary, e.g. `nvidia:sm_86,sm_70`
5663
- `amd`: compile for AMD GPUs; **at least one** architectural specification is necessary, e.g. `amd:gfx906`
@@ -83,6 +90,7 @@ If no GPU name is provided, the script tries to automatically detect any NVIDIA
8390
(requires the Python3 dependencies [`GPUtil`](https://pypi.org/project/GPUtil/) and [`pyamdgpuinfo`](https://pypi.org/project/pyamdgpuinfo/)).
8491

8592
If the architectural information for the requested GPU could not be retrieved, one option would be to have a look at:
93+
8694
- for NVIDIA GPUs: [Your GPU Compute Capability](https://developer.nvidia.com/cuda-gpus)
8795
- for AMD GPUs: [ROCm Documentation](https://github.com/RadeonOpenCompute/ROCm_Documentation/blob/master/ROCm_Compiler_SDK/ROCm-Native-ISA.rst)
8896

@@ -91,17 +99,18 @@ If the architectural information for the requested GPU could not be retrieved, o
9199
The `[optional_options]` can be one or multiple of:
92100

93101
- `PLSSVM_ENABLE_OPENMP_BACKEND=ON|OFF|AUTO` (default: `AUTO`):
94-
- `ON`: check for the OpenMP backend and fail if not available
95-
- `AUTO`: check for the OpenMP backend but **do not** fail if not available
96-
- `OFF`: do not check for the OpenMP backend
102+
- `ON`: check for the OpenMP backend and fail if not available
103+
- `AUTO`: check for the OpenMP backend but **do not** fail if not available
104+
- `OFF`: do not check for the OpenMP backend
97105
- `PLSSVM_ENABLE_CUDA_BACKEND=ON|OFF|AUTO` (default: `AUTO`):
98-
- `ON`: check for the CUDA backend and fail if not available
99-
- `AUTO`: check for the CUDA backend but **do not** fail if not available
100-
- `OFF`: do not check for the CUDA backend
106+
- `ON`: check for the CUDA backend and fail if not available
107+
- `AUTO`: check for the CUDA backend but **do not** fail if not available
108+
- `OFF`: do not check for the CUDA backend
109+
101110
- `PLSSVM_ENABLE_OPENCL_BACKEND=ON|OFF|AUTO` (default: `AUTO`):
102-
- `ON`: check for the OpenCL backend and fail if not available
103-
- `AUTO`: check for the OpenCL backend but **do not** fail if not available
104-
- `OFF`: do not check for the OpenCL backend
111+
- `ON`: check for the OpenCL backend and fail if not available
112+
- `AUTO`: check for the OpenCL backend but **do not** fail if not available
113+
- `OFF`: do not check for the OpenCL backend
105114
- `PLSSVM_ENABLE_SYCL_BACKEND=ON|OFF|AUTO` (default: `AUTO`):
106115
- `ON`: check for the SYCL backend and fail if not available
107116
- `AUTO`: check for the SYCL backend but **do not** fail if not available
@@ -117,9 +126,10 @@ The `[optional_options]` can be one or multiple of:
117126
- `PLSSVM_ENABLE_TESTING=ON|OFF` (default: ON): enable testing using GoogleTest and ctest
118127

119128
If `PLSSVM_ENABLE_TESTING` is set to `ON`, the following options can also be set:
129+
120130
- `PLSSVM_GENERATE_TEST_FILE=ON|OFF` (default: `ON`): automatically generate test files
121-
- `PLSSVM_TEST_FILE_NUM_DATA_POINTS` (default: `5000`): the number of data points in the test file
122-
- `PLSSVM_TEST_FILE_NUM_FEATURES` (default: `2000`): the number of features per data point
131+
- `PLSSVM_TEST_FILE_NUM_DATA_POINTS` (default: `5000`): the number of data points in the test file
132+
- `PLSSVM_TEST_FILE_NUM_FEATURES` (default: `2000`): the number of features per data point
123133

124134
If the SYCL backend is available and DPC++ is used, the option `PLSSVM_SYCL_DPCPP_USE_LEVEL_ZERO` can be used to select Level-Zero as the
125135
DPC++ backend instead of OpenCL.
@@ -136,17 +146,20 @@ To run the tests after building the library (with `PLSSVM_ENABLE_TESTING` set to
136146

137147
To enable the generation of test coverage reports using `locv` the library must be compiled using the custom `Coverage` `CMAKE_BUILD_TYPE`.
138148
Additionally, it's advisable to use smaller test files to shorten the `ctest` step.
149+
139150
```bash
140151
> cmake -DCMAKE_BUILD_TYPE=Coverage -DPLSSVM_TARGET_PLATFORMS="..." \
141152
-DPLSSVM_TEST_FILE_NUM_DATA_POINTS=100 \
142153
-DPLSSVM_TEST_FILE_NUM_FEATURES=50 ..
143154
> cmake --build . -- coverage
144155
```
156+
145157
The resulting `html` coverage report is located in the `coverage` folder in the build directory.
146158

147159
## Installing
148160

149161
The library supports the `install` target:
162+
150163
```bash
151164
> cmake --build . -- install
152165
```
@@ -224,6 +237,7 @@ Another example targeting NVIDIA GPUs using the SYCL backend looks like:
224237
```
225238
226239
The `--target_platform=automatic` flags works for the different backends as follows:
240+
227241
- `OpenMP`: always selects a CPU
228242
- `CUDA`: always selects an NVIDIA GPU (if no NVIDIA GPU is available, throws an exception)
229243
- `OpenCL`: tries to find available devices in the following order: NVIDIA GPUs 🠦 AMD GPUs 🠦 Intel GPUs 🠦 CPU
@@ -263,6 +277,7 @@ The `--target_platform=automatic` flags works like in the training (`./svm-train
263277
## Example code for usage as library
264278
265279
A simple C++ program (`main.cpp`) using this library could look like:
280+
266281
```cpp
267282
#include "plssvm/core.hpp"
268283

@@ -302,7 +317,9 @@ int main(i) {
302317
return 0;
303318
}
304319
```
320+
305321
With a corresponding minimal CMake file:
322+
306323
```cmake
307324
cmake_minimum_required(VERSION 3.16)
308325

0 commit comments

Comments
 (0)