# HG changeset patch # User Shinji KONO # Date 1486688886 -32400 # Node ID 8236e4ca69837df01be1eba95f6695944e0897cf # Parent f6770c0a24c25b3b2a5d1a9e7f8a5d30518611cb use ptx (SEGV) diff -r f6770c0a24c2 -r 8236e4ca6983 src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt Fri Feb 10 09:55:44 2017 +0900 +++ b/src/test/CMakeLists.txt Fri Feb 10 10:08:06 2017 +0900 @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 2.8) -# add_definitions("-Wall -g -O0") +add_definitions("-Wall -g -O0") + +set(NVCCFLAG "-std=c++11" "-g" "-O0" ) set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) set(CUDA_LINK_FLAGS "-framework CUDA -lc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Developer/NVIDIA/CUDA-8.0/lib/libcudart_static.a -Wl,-rpath,/usr/local/cuda/lib") @@ -11,22 +13,22 @@ add_custom_command(OUTPUT main.o DEPENDS main.cu - COMMAND nvcc -O -c main.cu + COMMAND nvcc ${NVCCFLAG} -c main.cu ) add_executable(cudaExmple main.o test.c) add_custom_command(OUTPUT twice.o DEPENDS twice.cu - COMMAND nvcc -O -c twice.cu + COMMAND nvcc ${NVCCFLAG} -c twice.cu ) -add_custom_command(OUTPUT multiply.o +add_custom_command(OUTPUT multiply.ptx DEPENDS multiply.cu - COMMAND nvcc -std=c++11 -O -c multiply.cu + COMMAND nvcc ${NVCCFLAG} -c multiply.cu -ptx ) -add_executable(twiceExample twice.o multiply.o test.c) +add_executable(twiceExample twice.o multiply.ptx test.c) # target_link_libraries(twiceExample ${CUDA_LIBRARIES} ${MPI_LIBRARIES} ${OPENGL_LIBRARIES})