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/mallocMC/' changes from e2533d141..569313f1a
569313f1a Merge pull request ComputationalRadiationPhysics#190 from psychocoderHPC/fix-dataRaces c2505573d Merge pull request ComputationalRadiationPhysics#189 from psychocoderHPC/fix-mallocMCExample03 cbfa6a2bc fix data races in `Scatter.hpp` b744e97aa fix data race and printf issue 520441e5b Merge pull request ComputationalRadiationPhysics#188 from psychocoderHPC/topic-updateAlpaka 136f73013 Merge commit '01e9abcfa60f1a5c9a1373321e9286374c57027c' into topic-updateAlpaka 01e9abcfa Squashed 'alpaka/' changes from 3e8567126..34870a73e 47b3e4c9b Refactoring (ComputationalRadiationPhysics#181) 25076a35d Merge pull request ComputationalRadiationPhysics#185 from psychocoderHPC/topic-updateAlpakaSubtree c1e596b3f Merge pull request ComputationalRadiationPhysics#187 from psychocoderHPC/topic-gitIgnoreUpdate b7aac310d Merge pull request ComputationalRadiationPhysics#186 from psychocoderHPC/topic-updateDevVersion 97c420697 update gitignore f658ad286 update evrsion to 2.5.0-crp-dev 9d6e21640 Squashed 'alpaka/' changes from b2a80b16..3e856712 63e5a3762 Merge commit '9d6e216402149143b07efe610265a171fe7ed062' into topic-updateAlpakaSubtree 2dc0bef38 Merge commit 'f2a664bcc2f3a201a309e48f3e0ced11e1a0667e' into topic-updateAlpakaSubtree f2a664bcc Squashed 'alpaka/' changes from a5a8277c..b2a80b16 5bced863b Merge pull request ComputationalRadiationPhysics#182 from psychocoderHPC/fix-HIPSupport c3605a691 fix HIP support 31f9b3c3f version update 2.4.0crp and changelog (ComputationalRadiationPhysics#157) cc54375b1 Port to alpaka (ComputationalRadiationPhysics#173) a2ed3ae92 Merge pull request ComputationalRadiationPhysics#179 from bernhardmgruber/catch 8dd82718e added 3rd party catch.hpp and made CMake find it 67bdc1b59 Merge pull request ComputationalRadiationPhysics#176 from bernhardmgruber/addAlpaka 5dd1d036c switching to C++14 2bb2f3e6d * using alpaka from added git subtree 90bb1ebc6 Squashed 'alpaka/' content from commit a5a8277cd ea7317878 Merge commit '90bb1ebc63d8281718381494e1d91733ac79c405' as 'alpaka' e0be7743e Merge pull request ComputationalRadiationPhysics#178 from psychocoderHPC/fix-travisCmakeUsage2 28b81447f fix used cmake version be77c4c60 Merge pull request ComputationalRadiationPhysics#174 from psychocoderHPC/topic-updateCmakeTo3.15.0 90d284197 update cmake to 3.15.0 7a3d1cebd Merge pull request ComputationalRadiationPhysics#172 from bernhardmgruber/format 018543832 added CONTRIBUTING.md with instructions how to use clang-format 4a416a2ec formatting (after clang-tidy) 8aec2cbf3 using trailing return types 5661a80fc formatting 669443d55 * setting column limit and allowing short loops * regrouping includes edc10db7c added .clang-format file 8c5a8617d Merge pull request ComputationalRadiationPhysics#171 from bernhardmgruber/cleaning 95c3223f2 replaced remaining typedefs by using directives d008ddba6 added .vs and build folders to ignores 5c16da78a applied clang-tidy 6404efdf6 * added a custom target for mallocMC headers * added header files to projects 43754615d Merge pull request ComputationalRadiationPhysics#169 from bernhardmgruber/cleaning 28561514d * requiring only C++11 * removed a TODO 507111408 a little modernization of the CMakeLists * using CUDA via project language instead of deprecated find_package * setting CUDA standard to have C++14 inside CUDA as well 73e21de40 * removed check that pagesize is unsigned * made pagesizes signed literals again 25e0de345 renamed variables with 2 leading underscores 240d4ea63 Suggested during review d37e9ed21 addressed review comments dafc9b794 * replaced usage of boost::mpl by static constexpr members * dropped dependency on boost 4962156bf some cleanup * requiring C++14 * using cstdint instead of boost/cstdint.hpp * using std::tuple instead of boost::tuple * using nullptr * using static_assert * using constexpr * adding const and static where appropriate * removed a few empty lines * replaced std::endl by \n where flush was probably not intended e383f3cd8 Merge pull request ComputationalRadiationPhysics#170 from ax3l/topic-ciBionic 42aed7eaf Travis CI: GCC 5.5.0 + CUDA 9.1.85 36cb7f9f0 Merge pull request ComputationalRadiationPhysics#165 from sbastrakov/topic-nvccComputeCapabilityGuard d911d0cbb Add a guard around COMPUTE_CAPABILITY cmake variable eff012d66 Merge pull request ComputationalRadiationPhysics#161 from sbastrakov/topic-cudaDeviceGetArrribute efd20bce5 Merge pull request ComputationalRadiationPhysics#164 from sbastrakov/fix-nvccComputeCapability 450c73d3a Choose the value for the -arch nvcc flag depending on CUDA version ce377f18e Use cudaDeviceGetAttribute() for querying the compute capability git-subtree-dir: thirdParty/mallocMC git-subtree-split: 569313f1adb06ed2a221a975e7d909e4bcef6339
- Loading branch information
1 parent
044f2f1
commit f9dc138
Showing
531 changed files
with
116,259 additions
and
4,090 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: AlwaysBreak | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: DontAlign | ||
AlignOperands: false | ||
AlignTrailingComments: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: true | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: false | ||
BreakBeforeBinaryOperators: All | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: AfterColon | ||
BreakInheritanceList: AfterColon | ||
BreakStringLiterals: true | ||
ColumnLimit: 80 | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 8 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
FixNamespaceComments: false | ||
IncludeBlocks: Regroup | ||
IndentCaseLabels: false | ||
IndentPPDirectives: None | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
Language: Cpp | ||
NamespaceIndentation: All | ||
PointerAlignment: Middle | ||
ReflowComments: true | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterTemplateKeyword: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: Never | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyParentheses: false | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Cpp11 | ||
UseTab: Never | ||
... |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
Checks: '*,-llvm-header-guard,-fuchsia-default-arguments-declarations,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-misc-non-private-member-variables-in-classes' | ||
HeaderFilterRegex: '.*' |
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 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 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 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,114 +1,87 @@ | ||
project(mallocMC) | ||
cmake_minimum_required(VERSION 2.8.12.2) | ||
project(mallocMC LANGUAGES CXX) | ||
cmake_minimum_required(VERSION 3.8) | ||
|
||
# helper for libs and packages | ||
set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/" | ||
"$ENV{CUDA_ROOT}" "$ENV{BOOST_ROOT}") | ||
|
||
|
||
################################################################################ | ||
# CMake policies | ||
# | ||
# Search in <PackageName>_ROOT: | ||
# https://cmake.org/cmake/help/v3.12/policy/CMP0074.html | ||
################################################################################ | ||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
if(POLICY CMP0074) | ||
cmake_policy(SET CMP0074 NEW) | ||
cmake_policy(SET CMP0074 NEW) | ||
endif() | ||
|
||
|
||
############################################################################### | ||
# CUDA | ||
############################################################################### | ||
find_package(CUDA REQUIRED) | ||
set(CUDA_NVCC_FLAGS "-arch=sm_20;-use_fast_math;") | ||
set(CUDA_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) | ||
include_directories(${CUDA_INCLUDE_DIRS}) | ||
cuda_include_directories(${CUDA_INCLUDE_DIRS}) | ||
|
||
OPTION(CUDA_OUTPUT_INTERMEDIATE_CODE "Output ptx code" OFF) | ||
if(CUDA_OUTPUT_INTERMEDIATE_CODE) | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xptxas;-v;--keep") | ||
endif(CUDA_OUTPUT_INTERMEDIATE_CODE) | ||
|
||
SET(CUDA_OPTIMIZATION_TYPE "unset" CACHE STRING "CUDA Optimization") | ||
set_property(CACHE CUDA_OPTIMIZATION_TYPE PROPERTY STRINGS "unset;-G0;-O0;-O1;-O2;-O3") | ||
if(NOT ${CUDA_OPTIMIZATION_TYPE} STREQUAL "unset") | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};${CUDA_OPTIMIZATION_TYPE}") | ||
# find alpaka | ||
set(mallocMC_ALPAKA_PROVIDER "intern" CACHE STRING "Select which alpaka is used") | ||
set_property(CACHE mallocMC_ALPAKA_PROVIDER PROPERTY STRINGS "intern;extern") | ||
mark_as_advanced(mallocMC_ALPAKA_PROVIDER) | ||
if(${mallocMC_ALPAKA_PROVIDER} STREQUAL "intern") | ||
set(alpaka_BUILD_EXAMPLES OFF) | ||
set(BUILD_TESTING OFF) | ||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/alpaka ${CMAKE_BINARY_DIR}/alpaka) | ||
else() | ||
find_package(alpaka HINTS $ENV{ALPAKA_ROOT}) | ||
endif() | ||
|
||
if(NOT TARGET alpaka::alpaka) | ||
message(FATAL "Required mallocMC dependency alpaka could not be found!") | ||
endif() | ||
|
||
############################################################################### | ||
# Boost | ||
############################################################################### | ||
find_package(Boost 1.48.0 REQUIRED) | ||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) | ||
set(LIBS ${LIBS} ${Boost_LIBRARIES}) | ||
|
||
# nvcc + boost 1.55 work around | ||
if(Boost_VERSION EQUAL 105500) | ||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} \"-DBOOST_NOINLINE=__attribute__((noinline))\" ") | ||
endif(Boost_VERSION EQUAL 105500) | ||
# Catch2 | ||
set(mallocMC_CATCH2_PROVIDER "intern" CACHE STRING "Select which Catch2 is used") | ||
set_property(CACHE mallocMC_CATCH2_PROVIDER PROPERTY STRINGS "intern;extern") | ||
mark_as_advanced(mallocMC_CATCH2_PROVIDER) | ||
if(${mallocMC_CATCH2_PROVIDER} STREQUAL "intern") | ||
add_library(Catch2::Catch2 INTERFACE IMPORTED) | ||
target_include_directories(Catch2::Catch2 INTERFACE ${CMAKE_CURRENT_LIST_DIR}/thirdParty/catch2/include) | ||
else() | ||
find_package(Catch2 CONFIG REQUIRED) | ||
endif() | ||
|
||
# for installation, just copy include folder to install folder | ||
install( | ||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/include/." | ||
DESTINATION include | ||
) | ||
|
||
################################################################################ | ||
# Warnings | ||
################################################################################ | ||
# GNU | ||
# warnings | ||
add_library(warnings INTERFACE) | ||
if(CMAKE_COMPILER_IS_GNUCXX) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") | ||
# new warning in gcc 4.8 (flag ignored in previous version) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") | ||
# ICC | ||
target_compile_options(warnings INTERFACE -Wall -Wshadow -Wno-unknown-pragmas -Wextra -Wno-unused-parameter -Wno-unused-local-typedefs) | ||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_NO_VARIADIC_TEMPLATES") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_NO_CXX11_VARIADIC_TEMPLATES") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_NO_FENV_H") | ||
# PGI | ||
target_compile_options(warnings INTERFACE -Wall -Wshadow) | ||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=inform") | ||
target_compile_options(warnings INTERFACE -Minform=inform) | ||
endif() | ||
|
||
|
||
############################################################################### | ||
# Installation | ||
############################################################################### | ||
|
||
# copy include folder to install folder | ||
INSTALL( | ||
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/include/." | ||
DESTINATION include | ||
PATTERN ".git" EXCLUDE | ||
PATTERN "mallocMC_config.hpp" EXCLUDE | ||
) | ||
|
||
|
||
############################################################################### | ||
# Executables | ||
############################################################################### | ||
add_custom_target(examples DEPENDS mallocMC_Example01 mallocMC_Example02 mallocMC_Example03 VerifyHeap) | ||
|
||
cuda_add_executable(mallocMC_Example01 | ||
EXCLUDE_FROM_ALL | ||
examples/mallocMC_example01.cu ) | ||
cuda_add_executable(mallocMC_Example02 | ||
EXCLUDE_FROM_ALL | ||
examples/mallocMC_example02.cu ) | ||
cuda_add_executable(mallocMC_Example03 | ||
EXCLUDE_FROM_ALL | ||
examples/mallocMC_example03.cu ) | ||
cuda_add_executable(VerifyHeap | ||
EXCLUDE_FROM_ALL | ||
tests/verify_heap.cu ) | ||
file(GLOB_RECURSE headers src/include/**) | ||
add_custom_target(mallocMCIde SOURCES ${headers}) # create a target with the header files for IDE projects | ||
source_group(TREE ${CMAKE_CURRENT_LIST_DIR}/src/include FILES ${headers}) | ||
|
||
alpaka_add_executable(mallocMC_Example01 EXCLUDE_FROM_ALL examples/mallocMC_example01.cpp) | ||
target_include_directories(mallocMC_Example01 PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include) | ||
target_link_libraries(mallocMC_Example01 PUBLIC alpaka::alpaka warnings) | ||
|
||
alpaka_add_executable(mallocMC_Example03 EXCLUDE_FROM_ALL examples/mallocMC_example03.cpp) | ||
target_include_directories(mallocMC_Example03 PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include) | ||
target_link_libraries(mallocMC_Example03 PUBLIC alpaka::alpaka warnings) | ||
|
||
alpaka_add_executable(VerifyHeap EXCLUDE_FROM_ALL tests/verify_heap.cpp tests/verify_heap_config.hpp) | ||
target_include_directories(VerifyHeap PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include) | ||
target_link_libraries(VerifyHeap PUBLIC alpaka::alpaka warnings) | ||
|
||
if (CUDA_VERSION VERSION_LESS 10.2) # TODO(bgruber): I do not know exactly where it breaks. 9.1 does not work, 10.2 works | ||
# the catch2 main needs to be in a non-CUDA file before CUDA 10.2, because nvcc fails to compile the catch2 header | ||
# TODO: merge the test_main back into the tests exe, once CUDA 10.2 is the minimum version | ||
add_library(tests_main EXCLUDE_FROM_ALL tests/main.cpp) | ||
target_include_directories(tests_main PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include) | ||
target_link_libraries(tests_main PUBLIC Catch2::Catch2 warnings) | ||
|
||
alpaka_add_executable(tests EXCLUDE_FROM_ALL tests/dimensions.cpp tests/policies.cpp) | ||
target_include_directories(tests PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include) | ||
target_link_libraries(tests PUBLIC tests_main alpaka::alpaka Catch2::Catch2 warnings) | ||
else() | ||
alpaka_add_executable(tests EXCLUDE_FROM_ALL tests/main.cpp tests/dimensions.cpp tests/policies.cpp) | ||
target_include_directories(tests PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include) | ||
target_link_libraries(tests PUBLIC alpaka::alpaka Catch2::Catch2 warnings) | ||
endif() | ||
|
||
target_link_libraries(mallocMC_Example01 ${LIBS}) | ||
target_link_libraries(mallocMC_Example02 ${LIBS}) | ||
target_link_libraries(mallocMC_Example03 ${LIBS}) | ||
target_link_libraries(VerifyHeap ${LIBS}) | ||
add_custom_target(examples DEPENDS mallocMC_Example01 mallocMC_Example03 VerifyHeap) |
Oops, something went wrong.