prepare cuda deliver dev
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# if (BASALT_CUDA_DELIVER)
|
||||
# add_subdirectory(CudaDeliver)
|
||||
# endif ()
|
||||
if (BASALT_CUDA_DELIVER)
|
||||
add_subdirectory(CudaDeliver)
|
||||
endif ()
|
||||
# if (BASALT_ROCM_DELIVER)
|
||||
# add_subdirectory(RocmDeliver)
|
||||
# endif ()
|
||||
|
||||
28
BasaltPresenter/Plugins/Deliver/CudaDeliver/CMakeLists.txt
Normal file
28
BasaltPresenter/Plugins/Deliver/CudaDeliver/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# Create shared library
|
||||
add_library(BasaltCudaDeliver SHARED "")
|
||||
# Setup sources
|
||||
target_sources(BasaltCudaDeliver
|
||||
PRIVATE
|
||||
main.cpp
|
||||
)
|
||||
# Setup header infomation
|
||||
target_include_directories(BasaltCudaDeliver
|
||||
PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}"
|
||||
)
|
||||
# Setup linked library infomation
|
||||
target_link_libraries(BasaltCudaDeliver
|
||||
PRIVATE
|
||||
BasaltShared
|
||||
CUDA::cudart
|
||||
)
|
||||
# Enable export macro
|
||||
target_compile_definitions(BasaltCudaDeliver
|
||||
PRIVATE
|
||||
BS_EXPORTING
|
||||
)
|
||||
|
||||
# Install BasaltCudaDeliver only on Release mode
|
||||
install(TARGETS BasaltCudaDeliver
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/plugin/deliver"
|
||||
)
|
||||
23
BasaltPresenter/Plugins/Deliver/CudaDeliver/main.cpp
Normal file
23
BasaltPresenter/Plugins/Deliver/CudaDeliver/main.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <basalt/export_macro.hpp>
|
||||
#include <basalt/deliver.hpp>
|
||||
|
||||
namespace deliver = ::basalt::shared::deliver;
|
||||
using deliver::DeliverConfig;
|
||||
using deliver::IDeliver;
|
||||
|
||||
class CudaDeliver : public IDeliver {
|
||||
public:
|
||||
CudaDeliver() {}
|
||||
virtual ~CudaDeliver() {}
|
||||
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
BS_EXPORT void* BSCreateInstance() {
|
||||
return static_cast<IDeliver*>(new CudaDeliver());
|
||||
}
|
||||
|
||||
BS_EXPORT void BSDestroyInstance(void* instance) {
|
||||
delete dynamic_cast<CudaDeliver*>(static_cast<IDeliver*>(instance));
|
||||
}
|
||||
@@ -1,9 +1,23 @@
|
||||
#include <basalt/export_macro.hpp>
|
||||
#include <basalt/deliver.hpp>
|
||||
|
||||
namespace deliver = ::basalt::shared::deliver;
|
||||
using deliver::DeliverConfig;
|
||||
using deliver::IDeliver;
|
||||
|
||||
class PipeDeliver : public IDeliver {
|
||||
public:
|
||||
PipeDeliver() {}
|
||||
virtual ~PipeDeliver() {}
|
||||
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
BS_EXPORT void* BSCreateInstance() {
|
||||
return nullptr;
|
||||
return static_cast<IDeliver*>(new PipeDeliver());
|
||||
}
|
||||
|
||||
BS_EXPORT void BSDestroyInstance(void* instance) {
|
||||
return;
|
||||
delete dynamic_cast<PipeDeliver*>(static_cast<IDeliver*>(instance));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user