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 @@ ...@@ -5,7 +5,7 @@
path = thirdparty/libxil path = thirdparty/libxil
url = https://git.rwth-aachen.de/acs/public/villas/libxil.git url = https://git.rwth-aachen.de/acs/public/villas/libxil.git
[submodule "lib/gpu/gdrcopy"] [submodule "lib/gpu/gdrcopy"]
path = lib/gpu/gdrcopy path = gpu/thirdparty/gdrcopy
url = https://github.com/daniel-k/gdrcopy.git url = https://github.com/daniel-k/gdrcopy.git
[submodule "thirdparty/udmabuf"] [submodule "thirdparty/udmabuf"]
path = thirdparty/udmabuf path = thirdparty/udmabuf
......
...@@ -33,6 +33,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") ...@@ -33,6 +33,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
include(CheckLanguage) include(CheckLanguage)
check_language(CUDA) 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/CLI11)
include_directories(thirdparty/rang) include_directories(thirdparty/rang)
......
...@@ -27,22 +27,35 @@ project(villas-gpu ...@@ -27,22 +27,35 @@ project(villas-gpu
DESCRIPTION "VILLASgpu" DESCRIPTION "VILLASgpu"
LANGUAGES C CXX CUDA) 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) target_compile_options(villas-gpu PRIVATE -g)
set_source_files_properties(gpu.cpp PROPERTIES set_source_files_properties(src/gpu.cpp PROPERTIES
LANGUAGE CUDA) 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 target_link_libraries(villas-gpu
PUBLIC villas-common gdrapi cuda) PUBLIC
villas-common
gdrapi
cuda
)
target_include_directories(villas-gpu target_include_directories(villas-gpu
PUBLIC PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include ${CMAKE_CURRENT_LIST_DIR}/include
PRIVATE PRIVATE
${CMAKE_CURRENT_LIST_DIR}) ${CMAKE_CURRENT_LIST_DIR}
)
...@@ -24,11 +24,12 @@ ...@@ -24,11 +24,12 @@
#include <stdio.h> #include <stdio.h>
#include <villas/gpu.hpp> #include <villas/gpu.hpp>
#include "kernels.hpp"
#include "cuda_runtime.h" #include <cuda_runtime.h>
#include <cuda.h> #include <cuda.h>
#include "kernels.hpp"
namespace villas { namespace villas {
namespace gpu { namespace gpu {
......
File moved
...@@ -55,13 +55,6 @@ add_library(villas-fpga SHARED ${SOURCES}) ...@@ -55,13 +55,6 @@ add_library(villas-fpga SHARED ${SOURCES})
target_link_libraries(villas-fpga PUBLIC villas-common) 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 target_compile_definitions(villas-fpga PRIVATE
BUILDID=\"abc\" BUILDID=\"abc\"
_GNU_SOURCE _GNU_SOURCE
...@@ -83,6 +76,10 @@ target_link_libraries(villas-fpga PUBLIC ...@@ -83,6 +76,10 @@ target_link_libraries(villas-fpga PUBLIC
villas-common villas-common
) )
if(CMAKE_CUDA_COMPILER)
target_link_libraries(villas-fpga PUBLIC villas-gpu)
endif()
include(GNUInstallDirs) include(GNUInstallDirs)
install(TARGETS villas-fpga 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