Commit graph

10 commits

Author SHA1 Message Date
lainon
6e1566386e project: Apply more C++ paradigms to the code
- Use auto in places where code clarity is improved or identical.
- Replace trivial constructors and destructors with default.
- Use true random for random generation.
- Use std::string_view where it is valid to do so.
- Apply const where it is valid to do so.
- Use references where it is valid to do so.
- Manually optimize memory usage with std::move and std::copy.
- Opt for memory efficient containers where the size is known ahead of time.

Signed-off-by: lainon <GermanAizek@yandex.ru>
2023-04-05 18:58:32 +02:00
Michael Fabian 'Xaymar' Dirks
cd8abac142 nvidia/cuda: Adjust to match coding guidelines 2023-04-05 18:51:05 +02:00
Michael Fabian 'Xaymar' Dirks
5adebc5f03 project: Apply formatting 2023-04-05 18:50:51 +02:00
Michael Fabian 'Xaymar' Dirks
5cd1d13d5f nvidia/cuda/context: Merge context-stack into context header 2023-04-05 18:50:50 +02:00
Michael Fabian 'Xaymar' Dirks
7b38114469 nvidia/cuda: Log extra information when built for Debug 2023-04-05 18:50:50 +02:00
Michael Fabian 'Xaymar' Dirks
98f711523e nvidia/cuda: Use util::library and remove CUDA library argument
The CUDA library is always available as a singleton, so it does not make sense for it to be passed in. Instead we can simply grab it from the singleton and use it as it is, which makes the code easier to maintain and automates certain code.
2023-04-05 18:50:50 +02:00
Michael Fabian 'Xaymar' Dirks
dbb71cf801 project: Code cleanup and reapply formatting
Changes applied:

* Moved utility files to /util/.
* Removed unused #includes.
* Removed unused ::ffmpeg::tools function.
* Removed unused variables.
* Fixed missing parentheses in the version macro.
* Fixed missing override on virtual function overrides and removed unnecessary virtual keyword from them.
* Disabled additional warning for ATL headers on MSVC only.
* Replaced direct printf parameters with their macro equivalent.
* Replaced C-style casts with C++-style casts.
* Applied clang-format again after an earlier change to the CMake file broke the integration for it.
2023-03-28 12:52:20 +02:00
Michael Fabian 'Xaymar' Dirks
9658c1ee0f nvidia/cuda: Remove 'cu_' prefix from types 2023-03-28 12:52:11 +02:00
Michael Fabian 'Xaymar' Dirks
b91df3e11a nvicia/cuda-context: Don't modify the primary context
Doing so could potentially cause other CUDA implementations to suddenly fail.
2023-03-28 12:40:43 +02:00
Michael Fabian 'Xaymar' Dirks
88213e81f6 nvidia-cuda: GPL compatible CUDA library interface
Due to the 'nvcuda' library being part of the driver, it falls in a clause of the GPL which allows us to load and interface with system drivers. Since we can't rely on Nvidias headers here (incompatible license), most of this was pulled from FFmpeg and other things were found out via testing.
2020-03-31 21:46:47 +02:00