# HG changeset patch # User ikkun # Date 1486807929 -32400 # Node ID 898fce27f334f154ceaa3b055984de5b08776fc7 # Parent b46398081fe45a9f00514e865f1911f660e951af use cbccompiler diff -r b46398081fe4 -r 898fce27f334 src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt Sat Feb 11 10:55:36 2017 +0900 +++ b/src/test/CMakeLists.txt Sat Feb 11 19:12:09 2017 +0900 @@ -6,7 +6,7 @@ include_directories("/usr/local/cuda/include") -# set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) +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") # for linux use -lcuda @@ -23,17 +23,12 @@ add_executable(cudaExmple main.o test.c) -add_custom_command(OUTPUT twice.o - DEPENDS twice.cu - COMMAND nvcc ${NVCCFLAG} -c twice.cu -) - add_custom_command(OUTPUT multiply.ptx DEPENDS multiply.cu COMMAND nvcc ${NVCCFLAG} -c multiply.cu -ptx ) -add_executable(twiceExample twice.o multiply.ptx test.c) +add_executable(twiceExample twice.cc multiply.ptx test.c) add_custom_command(OUTPUT vectorAdd_kernel.ptx DEPENDS vectorAdd_kernel.cu diff -r b46398081fe4 -r 898fce27f334 src/test/twice.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/twice.cc Sat Feb 11 19:12:09 2017 +0900 @@ -0,0 +1,154 @@ +#include +#include +#include +#include + +#include + +#include +#include "helper_cuda.h" + +#define LENGTH (10) +#define THREAD (10) + +double +getTime() { + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + (double)tv.tv_usec*1e-6; +} + +void +check_data(float* A, float B, float* C) { + for (int i=0; i -#include -#include -#include - -#include - -#include -#include "helper_cuda.h" - -#define LENGTH (10) -#define THREAD (10) - -double -getTime() { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + (double)tv.tv_usec*1e-6; -} - -void -check_data(float* A, float B, float* C) { - for (int i=0; i