Skip to content

Commit 4d48e34

Browse files
Third Partyax3l
authored andcommitted
Squashed 'thirdParty/cuda_memtest/' changes from 680636204..8a0e21bea
8a0e21bea Merge pull request #13 from ComputationalRadiationPhysics/topic-wextra 65b082e27 Fix Unused Parameter Warning 5888a7a63 Travis: Werror 34d6e74bc Merge pull request #12 from psychocoderHPC/fix-warningUnusedReturnValue 9d49d4a6d fix warning `result of call is not use` c9fa12e90 Merge pull request #8 from ComputationalRadiationPhysics/topic-cincludes 62e29c061 Includes: C includes in C++ git-subtree-dir: thirdParty/cuda_memtest git-subtree-split: 8a0e21bea7be98a1d0f0f9fc48ae90f87c3ecb81
1 parent 3ee7880 commit 4d48e34

File tree

1,254 files changed

+123
-141769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,254 files changed

+123
-141769
lines changed

.gitignore

Lines changed: 0 additions & 15 deletions
This file was deleted.

thirdParty/cuda_memtest/.travis.yml renamed to .travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ addons:
2727

2828
env:
2929
global:
30+
- CXXFLAGS="-Wall -Wextra -Werror"
3031
- INSTALL_DIR=~/mylibs
3132
- NVML_FILE=cuda_346.46_gdk_linux.run
3233
- NVML_LINK=http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/

CHANGELOG.md

Lines changed: 0 additions & 1028 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 101 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,123 @@
1-
# Copyright 2013-2016 Felix Schmitt, Heiko Burau, Rene Widera, Axel Huebl
2-
#
3-
# This file is part of PIConGPU.
4-
#
5-
# PIConGPU is free software: you can redistribute it and/or modify
6-
# it under the terms of the GNU General Public License as published by
7-
# the Free Software Foundation, either version 3 of the License, or
8-
# (at your option) any later version.
9-
#
10-
# PIConGPU is distributed in the hope that it will be useful,
11-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
# GNU General Public License for more details.
14-
#
15-
# You should have received a copy of the GNU General Public License
16-
# along with PIConGPU.
17-
# If not, see <http://www.gnu.org/licenses/>.
18-
#
19-
201
################################################################################
212
# Required cmake version
223
################################################################################
234

24-
cmake_minimum_required(VERSION 3.3.0)
5+
cmake_minimum_required(VERSION 2.8.5)
256

267

278
################################################################################
28-
# Project
9+
# Project
2910
################################################################################
3011

31-
project(PIConGPU2_full_build)
12+
project(CUDA_memtest)
13+
14+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
15+
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "install prefix" FORCE)
16+
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
17+
18+
# set helper pathes to find libraries and packages
19+
set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/" "$ENV{CUDA_ROOT}")
20+
21+
# own modules for find_packages
22+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
3223

3324

3425
################################################################################
35-
# Disallow in-source build
26+
# Find CUDA
3627
################################################################################
3728

38-
string(FIND "${PIConGPU2_full_build_BINARY_DIR}"
39-
"${PIConGPU2_full_build_SOURCE_DIR}" IN_SRC_POS)
40-
if(IN_SRC_POS GREATER -1)
41-
message(FATAL_ERROR
42-
"PICoNGPU requires an out of source build. "
43-
"Please remove \n"
44-
" - CMakeCache.txt\n"
45-
" - CMakeFiles/\n"
46-
"and create a separate build directory. "
47-
"See: INSTALL.md")
29+
find_package(CUDA REQUIRED)
30+
31+
if(SAME_NVCC_FLAGS_IN_SUBPROJECTS)
32+
set(CUDA_ARCH sm_13 CACHE STRING "set GPU architecture" )
33+
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ${nvcc_flags} -arch=${CUDA_ARCH})
34+
if(CUDA_ARCH STREQUAL "sm_10")
35+
add_definitions(-DSM_10=1)
36+
endif()
37+
38+
if(CUDA_SHOW_CODELINES)
39+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" --source-in-ptx -Xcompiler -rdynamic -lineinfo)
40+
set(CUDA_KEEP_FILES ON CACHE BOOL "activate keep files" FORCE)
41+
endif(CUDA_SHOW_CODELINES)
42+
43+
if(CUDA_SHOW_REGISTER)
44+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" -Xptxas=-v)
45+
endif()
46+
47+
if(CUDA_KEEP_FILES)
48+
make_directory("${PROJECT_BINARY_DIR}/nvcc_tmp")
49+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" --keep --keep-dir "${PROJECT_BINARY_DIR}/nvcc_tmp")
50+
endif()
4851
endif()
4952

50-
unset(IN_SRC_POS)
53+
54+
################################################################################
55+
# Find NVML
56+
################################################################################
57+
58+
set(GPU_DEPLOYMENT_KIT_ROOT_DIR "$ENV{GDK_ROOT}")
59+
find_package(NVML)
60+
61+
if(NVML_FOUND)
62+
include_directories(${NVML_INCLUDE_DIR})
63+
list(APPEND LIBS ${NVML_LIBRARY})
64+
add_definitions(-DENABLE_NVML=1)
65+
else()
66+
add_definitions(-DENABLE_NVML=0)
67+
endif()
5168

5269

5370
################################################################################
54-
# Add PICoNGPU project from sub directory
71+
# Find PThreads
5572
################################################################################
5673

57-
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
58-
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "install prefix" FORCE)
59-
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
74+
find_package(Threads REQUIRED)
75+
list(APPEND LIBS ${CMAKE_THREAD_LIBS_INIT})
76+
77+
# work around for Hypnos (Ubuntu 14.04) with gcc 4.8.2
78+
if(NOT CMAKE_THREAD_LIBS_INIT)
79+
list(APPEND LIBS "-pthread")
80+
endif()
81+
82+
83+
################################################################################
84+
# Build type (debug, release)
85+
################################################################################
86+
87+
option(CUDA_MEMTEST_RELEASE "disable all runtime asserts" ON)
88+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler=-pthread")
89+
if(CUDA_MEMTEST_RELEASE)
90+
add_definitions(-DNDEBUG)
91+
else(CUDA_MEMTEST_RELEASE)
92+
set(CMAKE_BUILD_TYPE Debug)
93+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler=-g")
94+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -g")
95+
endif(CUDA_MEMTEST_RELEASE)
96+
97+
98+
################################################################################
99+
# Warnings
100+
################################################################################
101+
102+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
103+
104+
105+
################################################################################
106+
# Compile & Link cuda_memtest
107+
################################################################################
108+
109+
cuda_add_executable(cuda_memtest
110+
tests.cu
111+
misc.cpp
112+
cuda_memtest.cu
113+
)
114+
115+
target_link_libraries(cuda_memtest ${LIBS} ${CUDA_CUDART_LIBRARY})
116+
117+
118+
################################################################################
119+
# Install cuda_memtest
120+
################################################################################
60121

61-
add_subdirectory("${CMAKE_SOURCE_DIR}/src/picongpu" "${CMAKE_BINARY_DIR}/build_picongpu")
122+
install(TARGETS cuda_memtest
123+
RUNTIME DESTINATION bin)

0 commit comments

Comments
 (0)