refactor repo
This commit is contained in:
		
					parent
					
						
							
								22ebb857eb
							
						
					
				
			
			
				commit
				
					
						24a83dfa08
					
				
			
		
					 5 changed files with 32 additions and 10 deletions
				
			
		
							
								
								
									
										12
									
								
								include/malloc_unmanagef.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								include/malloc_unmanagef.hpp
									
										
									
									
									
										Normal 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
 | 
			
		||||
							
								
								
									
										18
									
								
								include/stream_related.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								include/stream_related.hpp
									
										
									
									
									
										Normal 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
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue