1
0
Fork 0

refactor repo

This commit is contained in:
Pcornat 2024-03-25 18:13:16 +01:00
parent 22ebb857eb
commit 24a83dfa08
Signed by: Pcornat
GPG key ID: E0326CC678A00BDD
5 changed files with 32 additions and 10 deletions

View file

@ -0,0 +1,12 @@
//
// Created by postaron on 25/03/24.
//
#ifndef RAIISAFECUDA_MALLOC_UNMANAGEF_HPP
#define RAIISAFECUDA_MALLOC_UNMANAGEF_HPP
namespace safe_cuda {
}
#endif //RAIISAFECUDA_MALLOC_UNMANAGEF_HPP

View file

@ -0,0 +1,18 @@
#ifndef RAIISAFECUDA_STREAM_RELATED_HPP
#define RAIISAFECUDA_STREAM_RELATED_HPP
#include <memory>
#include <cuda_runtime_api.h>
#include <variant>
namespace safe_cuda {
using streamDestroyType = decltype(&cudaStreamDestroy);
/**
* \brief It tries to create a stream, putting it in a smart pointer with its correct destructor.
* \return smart pointer if creation is OK, else the CUDA error
*/
std::variant<std::unique_ptr<CUstream_st, streamDestroyType>, cudaError_t> create_stream() noexcept;
}
#endif //RAIISAFECUDA_STREAM_RELATED_HPP