Skip to content

Commit

Permalink
Make new text fit within 80 lines to satisfy Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
csbnw committed Jul 16, 2024
1 parent 609063d commit 42c1df9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ This library is a C++ wrapper for the Nvidia C libraries (e.g. CUDA driver, nvrt
2. _better fault handling_ (through exceptions);
3. _more compact user code_.

This library also supports AMD GPUs through the HIP: C++ Heterogeneous-Compute Interface for Portability.
This library also supports AMD GPUs through the HIP: C++ Heterogeneous-Compute
Interface for Portability.

Originally, the API enforced RAII to even further reduce the risk of faulty code, but enforcing RAII and compatibility with (unmanaged) objects obtained outside this API are mutually exclusive.

Expand All @@ -37,6 +38,7 @@ Originally, the API enforced RAII to even further reduce the risk of faulty code
| AMD GPU | RDNA2 or newer, CDNA2 or newer |



## Usage

We use CMake in this project, so you can clone and build this library with the following steps:
Expand All @@ -61,9 +63,15 @@ make -C build install
```

## Usage (HIP)

Check notice on line 65 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L65

Expected: 1; Actual: 0; Below
To enable HIP, make sure to build cudawrappers with `-DCUDAWRAPPERS_BACKEND=HIP`, or when using `FetchContent`, use `set(CUDAWRAPPERS_BACKEND "HIP")`.
In your project's `CMakeLists.txt`, add `enable_language(HIP)`. Furthermore, every
target that includes a cudawrappers header file needs to be 'hipified', to this end, add `set_source_files_properties(source.cpp PROPERTIES LANGUAGE HIP)` for every relevant `source.cpp` file. Some CUDA specific features may not be available or not work on non-NVIDIA GPUs, in those cases use `#ifdef(__HIP__)` guards to patch your code wherever this is needed.
To enable HIP, make sure to build cudawrappers with
`-DCUDAWRAPPERS_BACKEND=HIP`, or when using `FetchContent`, use
`set(CUDAWRAPPERS_BACKEND "HIP")`. In your project's `CMakeLists.txt`, add
`enable_language(HIP)`. Furthermore, every target that includes a cudawrappers
header file needs to be 'hipified', to this end, add
`set_source_files_properties(source.cpp PROPERTIES LANGUAGE HIP)` for every
relevant `source.cpp` file. Some CUDA specific features may not be available or
not work on non-NVIDIA GPUs, in those cases use `#ifdef(__HIP__)` guards to
patch your code wherever this is needed.

### Usage examples

Expand Down

0 comments on commit 42c1df9

Please sign in to comment.