refactor repo
This commit is contained in:
parent
22ebb857eb
commit
24a83dfa08
5 changed files with 32 additions and 10 deletions
5
src/malloc_unmanagef.cpp
Normal file
5
src/malloc_unmanagef.cpp
Normal file
|
@ -0,0 +1,5 @@
|
|||
//
|
||||
// Created by postaron on 25/03/24.
|
||||
//
|
||||
|
||||
#include "malloc_unmanagef.hpp"
|
13
src/stream_related.cpp
Normal file
13
src/stream_related.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include "stream_related.hpp"
|
||||
|
||||
namespace safe_cuda {
|
||||
std::variant<std::unique_ptr<CUstream_st, streamDestroyType>, cudaError_t> create_stream() noexcept {
|
||||
cudaStream_t stream = nullptr;
|
||||
const cudaError_t error = cudaStreamCreate(&stream);
|
||||
if (error != cudaSuccess) {
|
||||
return error;
|
||||
}
|
||||
return std::unique_ptr<CUstream_st, streamDestroyType>{ stream, cudaStreamDestroy };
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue