forked from ComputationalRadiationPhysics/picongpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
1,254 changed files
with
123 additions
and
141,769 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,123 @@ | ||
# Copyright 2013-2016 Felix Schmitt, Heiko Burau, Rene Widera, Axel Huebl | ||
# | ||
# This file is part of PIConGPU. | ||
# | ||
# PIConGPU is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# PIConGPU 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 General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with PIConGPU. | ||
# If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
################################################################################ | ||
# Required cmake version | ||
################################################################################ | ||
|
||
cmake_minimum_required(VERSION 3.3.0) | ||
cmake_minimum_required(VERSION 2.8.5) | ||
|
||
|
||
################################################################################ | ||
# Project | ||
# Project | ||
################################################################################ | ||
|
||
project(PIConGPU2_full_build) | ||
project(CUDA_memtest) | ||
|
||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "install prefix" FORCE) | ||
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
|
||
# set helper pathes to find libraries and packages | ||
set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/" "$ENV{CUDA_ROOT}") | ||
|
||
# own modules for find_packages | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) | ||
|
||
|
||
################################################################################ | ||
# Disallow in-source build | ||
# Find CUDA | ||
################################################################################ | ||
|
||
string(FIND "${PIConGPU2_full_build_BINARY_DIR}" | ||
"${PIConGPU2_full_build_SOURCE_DIR}" IN_SRC_POS) | ||
if(IN_SRC_POS GREATER -1) | ||
message(FATAL_ERROR | ||
"PICoNGPU requires an out of source build. " | ||
"Please remove \n" | ||
" - CMakeCache.txt\n" | ||
" - CMakeFiles/\n" | ||
"and create a separate build directory. " | ||
"See: INSTALL.md") | ||
find_package(CUDA REQUIRED) | ||
|
||
if(SAME_NVCC_FLAGS_IN_SUBPROJECTS) | ||
set(CUDA_ARCH sm_13 CACHE STRING "set GPU architecture" ) | ||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ${nvcc_flags} -arch=${CUDA_ARCH}) | ||
if(CUDA_ARCH STREQUAL "sm_10") | ||
add_definitions(-DSM_10=1) | ||
endif() | ||
|
||
if(CUDA_SHOW_CODELINES) | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" --source-in-ptx -Xcompiler -rdynamic -lineinfo) | ||
set(CUDA_KEEP_FILES ON CACHE BOOL "activate keep files" FORCE) | ||
endif(CUDA_SHOW_CODELINES) | ||
|
||
if(CUDA_SHOW_REGISTER) | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" -Xptxas=-v) | ||
endif() | ||
|
||
if(CUDA_KEEP_FILES) | ||
make_directory("${PROJECT_BINARY_DIR}/nvcc_tmp") | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" --keep --keep-dir "${PROJECT_BINARY_DIR}/nvcc_tmp") | ||
endif() | ||
endif() | ||
|
||
unset(IN_SRC_POS) | ||
|
||
################################################################################ | ||
# Find NVML | ||
################################################################################ | ||
|
||
set(GPU_DEPLOYMENT_KIT_ROOT_DIR "$ENV{GDK_ROOT}") | ||
find_package(NVML) | ||
|
||
if(NVML_FOUND) | ||
include_directories(${NVML_INCLUDE_DIR}) | ||
list(APPEND LIBS ${NVML_LIBRARY}) | ||
add_definitions(-DENABLE_NVML=1) | ||
else() | ||
add_definitions(-DENABLE_NVML=0) | ||
endif() | ||
|
||
|
||
################################################################################ | ||
# Add PICoNGPU project from sub directory | ||
# Find PThreads | ||
################################################################################ | ||
|
||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "install prefix" FORCE) | ||
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
find_package(Threads REQUIRED) | ||
list(APPEND LIBS ${CMAKE_THREAD_LIBS_INIT}) | ||
|
||
# work around for Hypnos (Ubuntu 14.04) with gcc 4.8.2 | ||
if(NOT CMAKE_THREAD_LIBS_INIT) | ||
list(APPEND LIBS "-pthread") | ||
endif() | ||
|
||
|
||
################################################################################ | ||
# Build type (debug, release) | ||
################################################################################ | ||
|
||
option(CUDA_MEMTEST_RELEASE "disable all runtime asserts" ON) | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler=-pthread") | ||
if(CUDA_MEMTEST_RELEASE) | ||
add_definitions(-DNDEBUG) | ||
else(CUDA_MEMTEST_RELEASE) | ||
set(CMAKE_BUILD_TYPE Debug) | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler=-g") | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -g") | ||
endif(CUDA_MEMTEST_RELEASE) | ||
|
||
|
||
################################################################################ | ||
# Warnings | ||
################################################################################ | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") | ||
|
||
|
||
################################################################################ | ||
# Compile & Link cuda_memtest | ||
################################################################################ | ||
|
||
cuda_add_executable(cuda_memtest | ||
tests.cu | ||
misc.cpp | ||
cuda_memtest.cu | ||
) | ||
|
||
target_link_libraries(cuda_memtest ${LIBS} ${CUDA_CUDART_LIBRARY}) | ||
|
||
|
||
################################################################################ | ||
# Install cuda_memtest | ||
################################################################################ | ||
|
||
add_subdirectory("${CMAKE_SOURCE_DIR}/src/picongpu" "${CMAKE_BINARY_DIR}/build_picongpu") | ||
install(TARGETS cuda_memtest | ||
RUNTIME DESTINATION bin) |
Oops, something went wrong.