-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
217 additions
and
307 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
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ dependencies: | |
- pip>=19.3 | ||
- cudatoolkit=10.0 | ||
- pip: | ||
- poetry==1.1.7 | ||
- poetry==1.1.10 |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,17 +1,46 @@ | ||
cmake_minimum_required(VERSION 3.17) | ||
cmake_minimum_required(VERSION 3.17...3.21) | ||
project(amanda_pybind) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
include(CMakePrintHelpers) | ||
|
||
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard to use") | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
find_program(CCACHE_PROGRAM ccache) | ||
if(CCACHE_PROGRAM) | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | ||
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") # CMake 3.9+ | ||
cmake_print_variables(CMAKE_CXX_COMPILER_LAUNCHER) | ||
endif() | ||
|
||
set(default_build_type "Release") | ||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.") | ||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE | ||
STRING "Choose the type of build." FORCE) | ||
# Set the possible values of build type for cmake-gui | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS | ||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo") | ||
endif() | ||
|
||
find_package(Python COMPONENTS Interpreter Development) | ||
find_package(Python REQUIRED COMPONENTS Interpreter Development) | ||
find_package(Torch REQUIRED) | ||
find_package(pybind11 CONFIG) | ||
|
||
find_library(TORCH_PYTHON_LIBRARY torch_python PATHS "${TORCH_INSTALL_PREFIX}/lib") | ||
cmake_print_variables(TORCH_PYTHON_LIBRARY) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}") | ||
|
||
include_directories(SYSTEM ${Python_INCLUDE_DIRS}) | ||
|
||
pybind11_add_module(amanda_pybind amanda_pybind.cpp) | ||
target_link_libraries(amanda_pybind PRIVATE ${PYTHON_LIBRARIES}) | ||
target_link_libraries(amanda_pybind PRIVATE ${TORCH_LIBRARIES}) | ||
target_link_libraries(amanda_pybind PRIVATE ${TORCH_PYTHON_LIBRARY}) | ||
|
||
add_executable(listener_test listener.cpp) | ||
target_link_libraries(listener_test PRIVATE ${PYTHON_LIBRARIES}) | ||
target_link_libraries(listener_test PRIVATE ${TORCH_LIBRARIES}) | ||
target_link_libraries(listener_test PRIVATE ${TORCH_PYTHON_LIBRARY}) |
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
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
Oops, something went wrong.