mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
move gpu module to top level directory
This commit is contained in:
parent
3f119896e9
commit
5361c1d20d
9 changed files with 35 additions and 18 deletions
2
fpga/.gitmodules
vendored
2
fpga/.gitmodules
vendored
|
@ -5,7 +5,7 @@
|
|||
path = thirdparty/libxil
|
||||
url = https://git.rwth-aachen.de/acs/public/villas/libxil.git
|
||||
[submodule "lib/gpu/gdrcopy"]
|
||||
path = lib/gpu/gdrcopy
|
||||
path = gpu/thirdparty/gdrcopy
|
||||
url = https://github.com/daniel-k/gdrcopy.git
|
||||
[submodule "thirdparty/udmabuf"]
|
||||
path = thirdparty/udmabuf
|
||||
|
|
|
@ -33,6 +33,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
|
|||
include(CheckLanguage)
|
||||
check_language(CUDA)
|
||||
|
||||
if(CMAKE_CUDA_COMPILER)
|
||||
add_subdirectory(gpu)
|
||||
else()
|
||||
message("No CUDA support, not building GPU library")
|
||||
endif()
|
||||
|
||||
include_directories(thirdparty/CLI11)
|
||||
include_directories(thirdparty/rang)
|
||||
|
||||
|
|
|
@ -27,22 +27,35 @@ project(villas-gpu
|
|||
DESCRIPTION "VILLASgpu"
|
||||
LANGUAGES C CXX CUDA)
|
||||
|
||||
add_subdirectory(gdrcopy)
|
||||
add_subdirectory(thirdparty/gdrcopy)
|
||||
|
||||
add_library(villas-gpu SHARED gpu.cpp kernels.cu)
|
||||
add_library(villas-gpu
|
||||
SHARED
|
||||
src/gpu.cpp
|
||||
src/kernels.cu
|
||||
)
|
||||
|
||||
target_compile_options(villas-gpu PRIVATE -g)
|
||||
|
||||
set_source_files_properties(gpu.cpp PROPERTIES
|
||||
LANGUAGE CUDA)
|
||||
set_source_files_properties(src/gpu.cpp PROPERTIES
|
||||
LANGUAGE CUDA
|
||||
)
|
||||
|
||||
target_include_directories(villas-gpu PRIVATE /opt/cuda/include)
|
||||
target_include_directories(villas-gpu
|
||||
PRIVATE
|
||||
/opt/cuda/include
|
||||
)
|
||||
|
||||
target_link_libraries(villas-gpu
|
||||
PUBLIC villas-common gdrapi cuda)
|
||||
PUBLIC
|
||||
villas-common
|
||||
gdrapi
|
||||
cuda
|
||||
)
|
||||
|
||||
target_include_directories(villas-gpu
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}/include
|
||||
${CMAKE_CURRENT_LIST_DIR}/include
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR})
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
|
@ -24,11 +24,12 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include <villas/gpu.hpp>
|
||||
#include "kernels.hpp"
|
||||
|
||||
#include "cuda_runtime.h"
|
||||
#include <cuda_runtime.h>
|
||||
#include <cuda.h>
|
||||
|
||||
#include "kernels.hpp"
|
||||
|
||||
namespace villas {
|
||||
namespace gpu {
|
||||
|
|
@ -55,13 +55,6 @@ add_library(villas-fpga SHARED ${SOURCES})
|
|||
|
||||
target_link_libraries(villas-fpga PUBLIC villas-common)
|
||||
|
||||
if(CMAKE_CUDA_COMPILER)
|
||||
add_subdirectory(gpu)
|
||||
target_link_libraries(villas-fpga PUBLIC villas-gpu)
|
||||
else()
|
||||
message("No CUDA support, not building GPU library")
|
||||
endif()
|
||||
|
||||
target_compile_definitions(villas-fpga PRIVATE
|
||||
BUILDID=\"abc\"
|
||||
_GNU_SOURCE
|
||||
|
@ -83,6 +76,10 @@ target_link_libraries(villas-fpga PUBLIC
|
|||
villas-common
|
||||
)
|
||||
|
||||
if(CMAKE_CUDA_COMPILER)
|
||||
target_link_libraries(villas-fpga PUBLIC villas-gpu)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
install(TARGETS villas-fpga
|
||||
|
|
Loading…
Add table
Reference in a new issue