refactor repo
This commit is contained in:
parent
22ebb857eb
commit
24a83dfa08
7 changed files with 57 additions and 35 deletions
|
|
@ -1,21 +0,0 @@
|
|||
#ifndef RAIISAFECUDA_STREAM_RELATED_H
|
||||
#define RAIISAFECUDA_STREAM_RELATED_H
|
||||
|
||||
#include <memory>
|
||||
#include <cuda_runtime_api.h>
|
||||
#include <variant>
|
||||
|
||||
namespace safe_cuda {
|
||||
template<typename T>
|
||||
using returnType = std::variant<T, cudaError_t>;
|
||||
|
||||
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
|
||||
*/
|
||||
returnType<std::unique_ptr<CUstream_st, streamDestroyType>> create_stream() noexcept;
|
||||
}
|
||||
|
||||
#endif //RAIISAFECUDA_STREAM_RELATED_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue