forked from tiermak/cuq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from biocad/akhoroshev/conan-cmake
Update Conan
- Loading branch information
Showing
6 changed files
with
73 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
stages: | ||
- build | ||
- deploy | ||
|
||
build-test: | ||
extends: .cuda-build-test | ||
|
||
build-test-upload: | ||
build-test-upload-branch: | ||
extends: .cuda-build-test-upload | ||
only: | ||
- branches | ||
except: | ||
- master | ||
|
||
build-test-upload-tag: | ||
extends: .cuda-build-test-upload | ||
only: | ||
- tags | ||
|
||
deploy-hpc: | ||
extends: .cuda-deploy-hpc | ||
|
||
include: | ||
- project: 'biocad/bcd-ci-common' | ||
ref: master | ||
file: '/build/cuda/build-test.yaml' | ||
|
||
- project: 'biocad/bcd-ci-common' | ||
ref: master | ||
ref: akhoroshev/update-cuda-pipelines | ||
file: '/build/cuda/build-test-upload.yaml' | ||
|
||
- project: 'biocad/bcd-ci-common' | ||
ref: master | ||
file: '/build/cuda/cuda-deploy.yaml' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(cuq LANGUAGES CXX) | ||
project(cuq LANGUAGES CXX CUDA) | ||
|
||
set(CMAKE_CUDA_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
set(CMAKE_CUDA_FLAGS "-lineinfo") | ||
|
||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler -Werror") #flags to host compiler behind the nvcc | ||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Werror cross-execution-space-call,reorder,deprecated-declarations") | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_FLAGS "-O2 -Wall -Wextra -Wshadow -Wpedantic -Wnon-virtual-dtor -Wunused -Wdouble-promotion") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") | ||
|
||
|
||
include_directories("${PROJECT_SOURCE_DIR}/include") | ||
|
||
# | ||
# Library | ||
# | ||
add_library(cuq SHARED | ||
src/cuq.cpp | ||
src/device_selection.cu | ||
) | ||
target_link_libraries(cuq rt cudart nvidia-ml) | ||
add_library(cuq | ||
src/cuq.cpp | ||
src/device_selection.cu | ||
) | ||
target_include_directories(cuq PUBLIC include/) | ||
target_include_directories(cuq PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) | ||
target_link_libraries(cuq cudart nvidia-ml) | ||
set_target_properties( | ||
cuq | ||
PROPERTIES | ||
CUDA_SEPARABLE_COMPILATION ON | ||
CUDA_RESOLVE_DEVICE_SYMBOLS ON | ||
POSITION_INDEPENDENT_CODE ON | ||
) | ||
|
||
install(TARGETS cuq DESTINATION lib) | ||
install(FILES include/cuq.h DESTINATION include) | ||
|
||
add_executable(concurrent_gpu_test | ||
examples/concurrent_gpu_demo.cu | ||
) | ||
set_target_properties( concurrent_gpu_test | ||
PROPERTIES CUDA_SEPARABLE_COMPILATION ON | ||
POSITION_INDEPENDENT_CODE ON | ||
) | ||
target_link_libraries(concurrent_gpu_test PRIVATE cudart cuq) | ||
|
||
# | ||
# Tests sub directory | ||
# | ||
add_subdirectory(tests) | ||
# Example | ||
add_executable(concurrent_gpu_demo | ||
examples/concurrent_gpu_demo.cu | ||
) | ||
target_link_libraries(concurrent_gpu_demo cuq) | ||
|
||
# Tests | ||
include(CTest) | ||
add_test (all_tests tests/all_tests) | ||
|
||
# set(CMAKE_BUILD_TYPE Debug) | ||
add_subdirectory(tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
from conans import ConanFile | ||
from conans import ConanFile, CMake | ||
|
||
|
||
class Conan(ConanFile): | ||
python_requires = "BcdConanRecipe/v1.0.0@biocad/biocad" | ||
python_requires_extend ="BcdConanRecipe.BcdConanRecipe" | ||
name = "cuq" | ||
url = "https://github.com/biocad/cuq" | ||
description = "CUDA multi-GPU concurrent tasks queue" | ||
settings = "os", "build_type", "arch","compiler","CUDA" | ||
options = {"shared": [True, False]} | ||
default_options = "shared=True" | ||
generators = "cmake_find_package" | ||
exports_sources="*" | ||
settings = "os", "build_type", "arch", "compiler", "CUDA" | ||
generators = "cmake" | ||
exports_sources = "*" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
cmake.parallel = False | ||
cmake.test() | ||
|
||
def package(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.install() | ||
|
||
def package_info(self): | ||
self.cpp_info.libs = ["cuq"] | ||
# users will be able to link statically with our library | ||
# but this requires the following system libraries | ||
self.cpp_info.system_libs = ["cudart", "nvidia-ml", "stdc++"] | ||
self.cpp_info.libdirs.append("/usr/local/cuda/lib64") | ||
|
||
def deploy(self): | ||
self.copy("*", dst="include", src="include") | ||
self.copy("*", dst="lib", src="lib") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#pragma once | ||
|
||
#include <mutex> | ||
#include <queue> | ||
#include <functional> | ||
|
||
#pragma once | ||
|
||
class GPUTask { | ||
public: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
include_directories("${PROJECT_SOURCE_DIR}/tests") | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
add_executable(all_tests | ||
device_selection/device_selection_tests.cu | ||
) | ||
|
||
set_target_properties(all_tests PROPERTIES | ||
CUDA_SEPARABLE_COMPILATION ON | ||
POSITION_INDEPENDENT_CODE ON | ||
add_executable(device_selection_test | ||
device_selection/device_selection_tests.cu | ||
) | ||
target_link_libraries(all_tests PRIVATE cuq cudart) | ||
target_include_directories(device_selection_test PRIVATE catch2) | ||
|
||
target_link_libraries(device_selection_test cuq) | ||
add_test( | ||
NAME device_selection_test | ||
COMMAND device_selection_test | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters