Permalink
Browse files

Added recognition of CUDA sources in ADD_TORCH_PACKAGE

  • Loading branch information...
1 parent b105bdd commit 811c5e03605cd0dadff47898bdb92b13bcff6783 @borisfom borisfom committed Feb 26, 2016
Showing with 10 additions and 3 deletions.
  1. +10 −3 cmake/TorchPackage.cmake
@@ -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"

0 comments on commit 811c5e0

Please sign in to comment.