Skip to content
Snippets Groups Projects
Commit 1a1f5654 authored by Bram Veenboer's avatar Bram Veenboer
Browse files

Use target_embed_source to embed correlator kernel

parent eae2636f
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ target_include_directories(
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>)
# Add links
target_link_libraries(tcc PRIVATE cudawrappers::cu cudawrappers::nvrtc)
target_embed_source(tcc kernel/TCCorrelator.cu)
# Install libraries and headers
install(
TARGETS tcc
......@@ -21,6 +22,3 @@ install(
EXPORT tcc-config
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
\ No newline at end of file
# Embed CUDA code
include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake)
include_cuda_code(tcc kernel/TCCorrelator.cu)
......@@ -7,7 +7,7 @@
#include <link.h>
extern const char _binary_libtcc_TCCorrelator_cu_start, _binary_libtcc_TCCorrelator_cu_end;
extern const char _binary_kernel_TCCorrelator_cu_start, _binary_kernel_TCCorrelator_cu_end;
namespace tcc {
......@@ -78,17 +78,8 @@ cu::Module Correlator::compileModule(unsigned nrBits,
//std::for_each(options.begin(), options.end(), [] (const std::string &e) { std::cout << e << ' '; }); std::cout << std::endl;
#if 0
nvrtc::Program program("tcc/TCCorrelator.cu");
#else
// embed the CUDA source code in libtcc.so, so that it need not be installed separately
// for runtime compilation
// copy into std::string for '\0' termination
const std::string source =
#include "TCCorrelator.cu"
;
const std::string source(_binary_kernel_TCCorrelator_cu_start, _binary_kernel_TCCorrelator_cu_end);
nvrtc::Program program(source, "TCCorrelator.cu");
#endif
try {
program.compile(options);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment