Skip to content

Commit

Permalink
Added recognition of CUDA sources in ADD_TORCH_PACKAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfom committed Feb 26, 2016
1 parent b105bdd commit 811c5e0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmake/TorchPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ MACRO(ADD_TORCH_PACKAGE package src luasrc)
# As per CMake doc, macro arguments are not variables, so simple test syntax not working
IF(NOT "${src}" STREQUAL "")

ADD_LIBRARY(${package} MODULE ${src})
if(BUILD_STATIC)
ADD_LIBRARY(${package}_static STATIC ${src})
if ("${src}" MATCHES "cu$" OR "${src}" MATCHES "cu;")
CUDA_ADD_LIBRARY(${package} MODULE ${src})
if(BUILD_STATIC)
CUDA_ADD_LIBRARY(${package}_static STATIC ${src})
endif()
else()
ADD_LIBRARY(${package} MODULE ${src})
if(BUILD_STATIC)
ADD_LIBRARY(${package}_static STATIC ${src})
endif()
endif()

### Torch packages supposes libraries prefix is "lib"
Expand Down

0 comments on commit 811c5e0

Please sign in to comment.