diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ae82309..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.idea/* -cmake-* -build/ diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a83ad04..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -cmake_minimum_required(VERSION 3.28 FATAL_ERROR) -project(raiiSafeCuda CXX) - -option(ENABLE_TESTS "Enable tests' cmake target." ON) - -find_package(CUDAToolkit REQUIRED) - -file(GLOB_RECURSE SAFE_CUDA_HEADERS include/*.hpp) -file(GLOB_RECURSE SAFE_CUDA_SOURCES src/*.cpp) - - -add_library(raiiSafeCuda SHARED - ${SAFE_CUDA_HEADERS} - ${SAFE_CUDA_SOURCES} -) -target_precompile_headers(raiiSafeCuda PRIVATE ${SAFE_CUDA_HEADERS}) -target_compile_definitions(raiiSafeCuda PRIVATE $<$:_GLIBCXX_DEBUG>) -target_compile_options(raiiSafeCuda PRIVATE -pipe -Wall -Wextra -pedantic) -target_link_libraries(raiiSafeCuda CUDA::cudart) - -set_target_properties(raiiSafeCuda PROPERTIES - CXX_STANDARD 20 - CXX_EXTENSIONS OFF - INTERPROCEDURAL_OPTIMIZATION ON -) - -if (ENABLE_TESTS) - add_subdirectory(tests) -endif () diff --git a/include/malloc_unmanagef.hpp b/include/malloc_unmanagef.hpp deleted file mode 100644 index 3a8f745..0000000 --- a/include/malloc_unmanagef.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// -// 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 diff --git a/include/stream_related.hpp b/include/stream_related.hpp deleted file mode 100644 index 17594b4..0000000 --- a/include/stream_related.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef RAIISAFECUDA_STREAM_RELATED_HPP -#define RAIISAFECUDA_STREAM_RELATED_HPP - -#include -#include -#include - -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, cudaError_t> create_stream() noexcept; -} - -#endif //RAIISAFECUDA_STREAM_RELATED_HPP diff --git a/src/malloc_unmanagef.cpp b/src/malloc_unmanagef.cpp deleted file mode 100644 index bd282b5..0000000 --- a/src/malloc_unmanagef.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// -// Created by postaron on 25/03/24. -// - -#include "malloc_unmanagef.hpp" diff --git a/src/stream_related.cpp b/src/stream_related.cpp deleted file mode 100644 index a863685..0000000 --- a/src/stream_related.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "stream_related.hpp" - -namespace safe_cuda { - std::variant, cudaError_t> create_stream() noexcept { - cudaStream_t stream = nullptr; - const cudaError_t error = cudaStreamCreate(&stream); - if (error != cudaSuccess) { - return error; - } - return std::unique_ptr{ stream, cudaStreamDestroy }; - } - -} \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index 2bc2b61..0000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -project(testsRaiiSafeCuda CXX) - -find_package(Catch2 3) -if (NOT Catch2_FOUND) - message(STATUS "Using FetchContent to download and use Catch2") - include(FetchContent) - fetchcontent_declare( - Catch2 - GIT_REPOSITORY https://github.com/catchorg/Catch2 - GIT_TAG v3.5.3 - EXCLUDE_FROM_ALL - OVERRIDE_FIND_PACKAGE - ) - fetchcontent_makeavailable(Catch2) - find_package(Catch2 3 REQUIRED) -endif () - -include(CTest) -enable_testing() -include(Catch) -include(CatchAddTests) - -add_executable(tests tests_stream.cpp) -target_link_libraries(tests Catch2::Catch2WithMain) - -catch_discover_tests(tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/tests/tests_stream.cpp b/tests/tests_stream.cpp deleted file mode 100644 index 2e71430..0000000 --- a/tests/tests_stream.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// -// Created by postaron on 21/03/24. -// - -#include - -TEST_CASE("hello", "world") { - -}