Skip to content

Commit

Permalink
added -keep option to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
harrism committed Apr 27, 2012
1 parent 94dab38 commit c86ccb0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion runtime/CMakeLists.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ option(COMPILE_SM30
"On to enable SM30 compilation" "On to enable SM30 compilation"
ON ON
) )

option(CUDA_KEEP_INTERMEDIATE_FILES
"On to enable -keep"
OFF
)


FIND_PACKAGE(CUDA REQUIRED) FIND_PACKAGE(CUDA REQUIRED)


Expand Down Expand Up @@ -98,6 +103,10 @@ source_group("CUDA Source Files" FILES ${CUFILES} ${CUHFILES})
set(GENCODE_SM20 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_20,code=compute_20) set(GENCODE_SM20 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_20,code=compute_20)
set(GENCODE_SM30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_30,code=compute_30) set(GENCODE_SM30 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_30,code=compute_30)


if (CUDA_KEEP_INTERMEDIATE_FILES)
set(KEEP -keep)
endif(CUDA_KEEP_INTERMEDIATE_FILES)

if (CUDA_VERBOSE_PTXAS) if (CUDA_VERBOSE_PTXAS)
set(VERBOSE_PTXAS --ptxas-options=-v) set(VERBOSE_PTXAS --ptxas-options=-v)
endif (CUDA_VERBOSE_PTXAS) endif (CUDA_VERBOSE_PTXAS)
Expand Down Expand Up @@ -158,7 +167,7 @@ cuda_add_executable(bonsai2
${CCFILES} ${CCFILES}
${HFILES} ${HFILES}
${CUFILES} ${CUFILES}
OPTIONS ${GENCODE} ${VERBOSE_PTXAS} ${DEVICE_DEBUGGING} OPTIONS ${GENCODE} ${VERBOSE_PTXAS} ${DEVICE_DEBUGGING} ${KEEP}
) )


target_link_libraries(bonsai2 ${ALL_LIBRARIES}) target_link_libraries(bonsai2 ${ALL_LIBRARIES})
Expand Down

0 comments on commit c86ccb0

Please sign in to comment.