Skip to content

Commit

Permalink
Merge branch 'gangliao-master'
Browse files Browse the repository at this point in the history
Should fix PaddlePaddle#60
  • Loading branch information
Jared Casper committed Jan 4, 2017
2 parents bd535c8 + c9beca9 commit f6efaf4
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ include_directories(include)
FIND_PACKAGE(CUDA 6.5)
MESSAGE(STATUS "cuda found ${CUDA_FOUND}")

option(WITH_GPU "compile warp-ctc with cuda." ${CUDA_FOUND})
option(WITH_OMP "compile warp-ctc with openmp." ON)

if(NOT WITH_OMP)
add_definitions(-DCTC_DISABLE_OMP)
endif()

# need to be at least 30 or __shfl_down in reduce wont compile
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_30,code=sm_30 -O2")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_35,code=sm_35")
Expand Down Expand Up @@ -53,7 +60,7 @@ ELSE()
ENDIF()


IF (CUDA_FOUND)
IF (WITH_GPU)

MESSAGE(STATUS "Building shared library with GPU support")

Expand All @@ -70,9 +77,11 @@ IF (CUDA_FOUND)
TARGET_LINK_LIBRARIES(test_gpu warpctc ${CUDA_curand_LIBRARY})

INSTALL(TARGETS warpctc
RUNTIME DESTINATION "${CMAKE_BINARY_DIR}"
LIBRARY DESTINATION "${CMAKE_BINARY_DIR}"
ARCHIVE DESTINATION "${CMAKE_BINARY_DIR}")
RUNTIME DESTINATION "bin"
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib")

INSTALL(FILES include/ctc.h DESTINATION "include")

IF (Torch_FOUND)
MESSAGE(STATUS "Building Torch Bindings with GPU support")
Expand Down Expand Up @@ -112,9 +121,11 @@ ELSE()
SET_TARGET_PROPERTIES(test_cpu PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")

INSTALL(TARGETS warpctc
RUNTIME DESTINATION "${CMAKE_BINARY_DIR}"
LIBRARY DESTINATION "${CMAKE_BINARY_DIR}"
ARCHIVE DESTINATION "${CMAKE_BINARY_DIR}")
RUNTIME DESTINATION "bin"
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib")

INSTALL(FILES include/ctc.h DESTINATION "include")

IF (Torch_FOUND)
MESSAGE(STATUS "Building Torch Bindings with no GPU support")
Expand Down

0 comments on commit f6efaf4

Please sign in to comment.