-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (44 loc) · 2.24 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# Copyright (c) 2010 - Ugo Varetto
#
# This source code is free; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This source code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this source code; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
cmake_minimum_required(VERSION 2.6)
project(gpupp-test)
#Automatic discovery supported for NVIDIA only at this time
set(OPENCL_DEF_INCLUDE_DIR "$ENV{CUDA_INC_PATH}")
set(OPENCL_DEF_LINK_DIR "$ENV{CUDA_LIB_PATH}")
set(OPENCL_INCLUDE_DIR ${OPENCL_DEF_INCLUDE_DIR} CACHE PATH "OpenCL include dir" )
set(OPENCL_LINK_DIR ${OPENCL_DEF_LINK_DIR} CACHE PATH "OpenCL lib dir" )
include_directories( ${OPENCL_INCLUDE_DIR} )
#on Cray XK systems libcuda is not in the default path
link_directories( ${OPENCL_LINK_DIR} /opt/cray/nvidia/default/lib64 )
set( COMMON_SRCS utility/ResourceHandler.h utility/Any.h utility/varargs.h utility/CmdLine.h utility/Timer.h )
set( OPENCL_SRCS opencl/gpupp.cpp opencl/gpupp.h opencl/OpenCLDeviceInfoTable.h opencl/OpenCLStatusCodesTable.h )
set( TEST_CL_SRCS gpupp-test-cl.cpp )
set( MATMUL_CL_SRCS gpupp-matmul-cl.cpp )
set( CUDA_SRCS utility/alignment.h cuda/gpupp.cpp cuda/gpupp.h cuda/CUDADeviceInfoTable.h cuda/CUDAStatusCodesTable.h )
set( TEST_CUDA_SRCS gpupp-test-cu.cpp )
include(FindCUDA)
include_directories( ${CUDA_INCLUDE_DIRS} )
message( ${CUDA_LIBRARIES} )
add_executable( gpupp-test-cl ${OPENCL_SRCS} ${COMMON_SRCS} ${TEST_CL_SRCS} )
add_executable( gpupp-matmul-cl ${OPENCL_SRCS} ${COMMON_SRCS} ${MATMUL_CL_SRCS} )
add_executable( gpupp-test-cu ${CUDA_SRCS} ${COMMON_SRCS} ${TEST_CUDA_SRCS} )
set(CLLIB OpenCL)
target_link_libraries( gpupp-test-cl ${CLLIB} )
target_link_libraries( gpupp-matmul-cl ${CLLIB} )
target_link_libraries( gpupp-test-cu ${CUDA_LIBRARIES} )