Commit 09b0a852 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼

move gpu module to top level directory

parent 545d47f0
Pipeline #69531 passed with stages
in 3 minutes and 19 seconds
......@@ -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 {
......
File moved
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment