Skip to content

Commit 5d61eec

Browse files
authored
Merge pull request #209 from alpaka-group/release-2.5.0crp
merge release 2.5.0 to master
2 parents dce5c92 + 8974db4 commit 5d61eec

File tree

524 files changed

+115142
-3206
lines changed

Some content is hidden

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

524 files changed

+115142
-3206
lines changed

.gitignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
# tmp files
2+
*~
3+
14
# Compiled Object files
25
*.slo
36
*.lo
47
*.o
8+
/build
59

610
# Compiled Dynamic libraries
711
*.so
@@ -12,7 +16,19 @@
1216
*.la
1317
*.a
1418

15-
*~
16-
/nbproject
17-
/.vs
18-
/build
19+
# netbeans project files
20+
/nbproject/
21+
22+
# Code::Blocks project files
23+
/*.cbp
24+
/*.layout
25+
26+
# Visual Studio Code configuration files
27+
.vscode
28+
.vs
29+
30+
# JetBrains project files
31+
.idea/
32+
33+
# original backup files
34+
*.orig

.travis.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ sudo: required
44

55
dist: bionic
66

7+
cache:
8+
apt: true
9+
directories:
10+
- $HOME/.cache/cmake-3.15.0
11+
712
compiler:
813
- gcc
914

1015
env:
1116
global:
1217
- INSTALL_DIR=~/mylibs
1318
- CXXFLAGS="-Werror"
19+
- PATH: $HOME/.cache/cmake-3.15.0/bin:$PATH
20+
21+
install:
22+
if [ ! -f $HOME/.cache/cmake-3.15.0/bin/cmake ]; then
23+
wget -O cmake.sh https://cmake.org/files/v3.15/cmake-3.15.0-Linux-x86_64.sh &&
24+
sh cmake.sh --skip-license --exclude-subdir --prefix=$HOME/.cache/cmake-3.15.0 &&
25+
rm cmake.sh;
26+
fi;
1427

1528
script:
1629
- mkdir build_tmp && cd build_tmp
@@ -19,6 +32,7 @@ script:
1932
- make
2033
- make install
2134
- make examples
35+
- make tests
2236

2337
before_script:
2438
- cat /etc/apt/sources.list
@@ -28,14 +42,14 @@ before_script:
2842
- sudo dpkg --configure -a
2943
- sudo apt-get install -f -qq
3044
- sudo dpkg --get-selections | grep hold || { echo "All packages OK."; }
31-
- sudo apt-get install -q -y cmake-data cmake
3245
- sudo apt-get install -qq build-essential g++-5
3346
- gcc-5 --version && g++-5 --version # 5.5.0
3447
- apt-cache search nvidia-*
3548
- sudo apt-get install -qq nvidia-common
3649
- sudo apt-get install -qq nvidia-cuda-dev nvidia-cuda-toolkit # 9.1.85
3750
- sudo apt-get install -qq libboost-dev # 1.65.1
3851
- sudo find /usr/ -name libcuda*.so
52+
- cmake --version
3953

4054
after_script:
4155
- ls -halR $INSTALL_DIR

.zenodo.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"title":"mallocMC - Memory Allocator for Many Core Architectures",
3+
"description":"This project provides a framework for fast memory managers on many core accelerators. It is based on alpaka to run on many different accelerators and implements the ScatterAlloc algorithm.",
4+
"keywords":[
5+
"mallocMC",
6+
"CUDA",
7+
"manycore",
8+
"GPU",
9+
"allocator"
10+
],
11+
"language":"eng",
12+
"access_right":"open",
13+
"license":{
14+
"id":"MIT"
15+
},
16+
"creators":[
17+
{
18+
"name":"Eckert, Carlchristian",
19+
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf, TU Dresden",
20+
"orcid":"0000-0002-6459-0842"
21+
},
22+
{
23+
"name":"Widera, René",
24+
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
25+
"orcid":"0000-0003-1642-0459"
26+
},
27+
{
28+
"name":"Huebl, Axel",
29+
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
30+
"orcid":"0000-0003-1943-7141"
31+
},
32+
{
33+
"name":"Gruber, Bernhard Manfred",
34+
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf, CASUS, CERN",
35+
"orcid":"0000-0001-7848-1690"
36+
},
37+
{
38+
"name":"Bastrakov, Sergei",
39+
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
40+
"orcid":"0000-0003-3396-6154"
41+
},
42+
{
43+
"name":"Worpitz, Benjamin"
44+
},
45+
{
46+
"name":"Grund, Alexander",
47+
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
48+
"orcid":"0000-0002-7196-8452"
49+
}
50+
]
51+
}
52+

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
Change Log / Release Log for mallocMC
22
================================================================
33

4+
2.5.0crp
5+
--------
6+
**Date:** 2021-02-18
7+
8+
This release removes the native usage of CUDA by alpaka.
9+
Attention: This release depends on an unreleased [alpaka 0.5.0dev](https://github.com/alpaka-group/alpaka/commit/34870a73ecf702069465aa030fbdf301c4d22c61)
10+
version before the heavy alpaka namespace refactoring.
11+
12+
### Changes to mallocMC 2.4.0crp
13+
14+
**Features**
15+
- Port to alpaka #173
16+
17+
**Bug fixes**
18+
- fix HIP support (warpsize, activemask, compile issues) #182
19+
- fix data race and printf issue #189
20+
- fix data races in `Scatter.hpp` #190
21+
- fix clang cuda compile #192
22+
23+
**Misc:**
24+
- Added alpaka subtree and switched to C++14 #176
25+
- Added 3rd party catch.hpp and made CMake find it #179
26+
- Update documentation after switch to alpaka #194
27+
- Update .clang-format and apply clang-format #197
28+
29+
Thanks to Bernhard Manfred Gruber and Rene Widera for contributing to this release!
30+
431
2.4.0crp
532
--------
633
**Date:** 2020-05-28

CMakeLists.txt

Lines changed: 63 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,87 @@
1-
project(mallocMC LANGUAGES CUDA CXX)
1+
project(mallocMC LANGUAGES CXX)
22
cmake_minimum_required(VERSION 3.8)
33

4-
set(CMAKE_CXX_STANDARD 11)
4+
set(CMAKE_CXX_STANDARD 14)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66

7-
# helper for libs and packages
8-
set(CMAKE_CUDA_STANDARD 11)
9-
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
10-
set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/"
11-
"$ENV{CUDA_ROOT}" "$ENV{BOOST_ROOT}")
12-
13-
14-
################################################################################
15-
# CMake policies
16-
#
17-
# Search in <PackageName>_ROOT:
18-
# https://cmake.org/cmake/help/v3.12/policy/CMP0074.html
19-
################################################################################
20-
217
if(POLICY CMP0074)
228
cmake_policy(SET CMP0074 NEW)
239
endif()
2410

25-
26-
###############################################################################
27-
# CUDA
28-
###############################################################################
29-
if(NOT DEFINED COMPUTE_CAPABILITY)
30-
set(COMPUTE_CAPABILITY "30")
11+
# find alpaka
12+
set(mallocMC_ALPAKA_PROVIDER "intern" CACHE STRING "Select which alpaka is used")
13+
set_property(CACHE mallocMC_ALPAKA_PROVIDER PROPERTY STRINGS "intern;extern")
14+
mark_as_advanced(mallocMC_ALPAKA_PROVIDER)
15+
if(${mallocMC_ALPAKA_PROVIDER} STREQUAL "intern")
16+
set(alpaka_BUILD_EXAMPLES OFF)
17+
set(BUILD_TESTING OFF)
18+
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/alpaka ${CMAKE_BINARY_DIR}/alpaka)
19+
else()
20+
find_package(alpaka HINTS $ENV{ALPAKA_ROOT})
3121
endif()
32-
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=sm_${COMPUTE_CAPABILITY} -use_fast_math")
3322

34-
OPTION(CUDA_OUTPUT_INTERMEDIATE_CODE "Output ptx code" OFF)
35-
if(CUDA_OUTPUT_INTERMEDIATE_CODE)
36-
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xptxas -v --keep")
23+
if(NOT TARGET alpaka::alpaka)
24+
message(FATAL "Required mallocMC dependency alpaka could not be found!")
3725
endif()
3826

39-
SET(CUDA_OPTIMIZATION_TYPE "unset" CACHE STRING "CUDA Optimization")
40-
set_property(CACHE CUDA_OPTIMIZATION_TYPE PROPERTY STRINGS "unset;-G0;-O0;-O1;-O2;-O3")
41-
if(NOT ${CUDA_OPTIMIZATION_TYPE} STREQUAL "unset")
42-
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CUDA_OPTIMIZATION_TYPE}")
27+
# Catch2
28+
set(mallocMC_CATCH2_PROVIDER "intern" CACHE STRING "Select which Catch2 is used")
29+
set_property(CACHE mallocMC_CATCH2_PROVIDER PROPERTY STRINGS "intern;extern")
30+
mark_as_advanced(mallocMC_CATCH2_PROVIDER)
31+
if(${mallocMC_CATCH2_PROVIDER} STREQUAL "intern")
32+
add_library(Catch2::Catch2 INTERFACE IMPORTED)
33+
target_include_directories(Catch2::Catch2 INTERFACE ${CMAKE_CURRENT_LIST_DIR}/thirdParty/catch2/include)
34+
else()
35+
find_package(Catch2 CONFIG REQUIRED)
4336
endif()
4437

38+
# for installation, just copy include folder to install folder
39+
install(
40+
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/include/."
41+
DESTINATION include
42+
)
4543

46-
################################################################################
47-
# Warnings
48-
################################################################################
44+
# warnings
45+
add_library(warnings INTERFACE)
4946
if(CMAKE_COMPILER_IS_GNUCXX)
50-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wshadow -Wno-unknown-pragmas -Wextra -Wno-unused-parameter -Wno-unused-local-typedefs")
47+
target_compile_options(warnings INTERFACE -Wall -Wshadow -Wno-unknown-pragmas -Wextra -Wno-unused-parameter -Wno-unused-local-typedefs)
5148
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
52-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wshadow")
49+
target_compile_options(warnings INTERFACE -Wall -Wshadow)
5350
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")
54-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=inform")
51+
target_compile_options(warnings INTERFACE -Minform=inform)
5552
endif()
5653

57-
58-
###############################################################################
59-
# Installation
60-
###############################################################################
61-
62-
# copy include folder to install folder
63-
INSTALL(
64-
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/include/."
65-
DESTINATION include
66-
PATTERN ".git" EXCLUDE
67-
PATTERN "mallocMC_config.hpp" EXCLUDE
68-
)
69-
70-
71-
###############################################################################
7254
# Executables
73-
###############################################################################
7455
file(GLOB_RECURSE headers src/include/**)
75-
add_custom_target(mallocMC SOURCES ${headers}) # create a target with the header files for IDE projects
56+
add_custom_target(mallocMCIde SOURCES ${headers}) # create a target with the header files for IDE projects
7657
source_group(TREE ${CMAKE_CURRENT_LIST_DIR}/src/include FILES ${headers})
7758

78-
include_directories(${CMAKE_CURRENT_LIST_DIR}/src/include)
79-
add_executable(mallocMC_Example01 EXCLUDE_FROM_ALL examples/mallocMC_example01.cu examples/mallocMC_example01_config.hpp)
80-
add_executable(mallocMC_Example02 EXCLUDE_FROM_ALL examples/mallocMC_example02.cu)
81-
add_executable(mallocMC_Example03 EXCLUDE_FROM_ALL examples/mallocMC_example03.cu)
82-
add_executable(VerifyHeap EXCLUDE_FROM_ALL tests/verify_heap.cu tests/verify_heap_config.hpp)
83-
add_custom_target(examples DEPENDS mallocMC_Example01 mallocMC_Example02 mallocMC_Example03 VerifyHeap)
59+
alpaka_add_executable(mallocMC_Example01 EXCLUDE_FROM_ALL examples/mallocMC_example01.cpp)
60+
target_include_directories(mallocMC_Example01 PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include)
61+
target_link_libraries(mallocMC_Example01 PUBLIC alpaka::alpaka warnings)
62+
63+
alpaka_add_executable(mallocMC_Example03 EXCLUDE_FROM_ALL examples/mallocMC_example03.cpp)
64+
target_include_directories(mallocMC_Example03 PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include)
65+
target_link_libraries(mallocMC_Example03 PUBLIC alpaka::alpaka warnings)
66+
67+
alpaka_add_executable(VerifyHeap EXCLUDE_FROM_ALL tests/verify_heap.cpp tests/verify_heap_config.hpp)
68+
target_include_directories(VerifyHeap PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include)
69+
target_link_libraries(VerifyHeap PUBLIC alpaka::alpaka warnings)
70+
71+
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
72+
# the catch2 main needs to be in a non-CUDA file before CUDA 10.2, because nvcc fails to compile the catch2 header
73+
# TODO: merge the test_main back into the tests exe, once CUDA 10.2 is the minimum version
74+
add_library(tests_main EXCLUDE_FROM_ALL tests/main.cpp)
75+
target_include_directories(tests_main PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include)
76+
target_link_libraries(tests_main PUBLIC Catch2::Catch2 warnings)
77+
78+
alpaka_add_executable(tests EXCLUDE_FROM_ALL tests/dimensions.cpp tests/policies.cpp)
79+
target_include_directories(tests PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include)
80+
target_link_libraries(tests PUBLIC tests_main alpaka::alpaka Catch2::Catch2 warnings)
81+
else()
82+
alpaka_add_executable(tests EXCLUDE_FROM_ALL tests/main.cpp tests/dimensions.cpp tests/policies.cpp)
83+
target_include_directories(tests PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/include)
84+
target_link_libraries(tests PUBLIC alpaka::alpaka Catch2::Catch2 warnings)
85+
endif()
86+
87+
add_custom_target(examples DEPENDS mallocMC_Example01 mallocMC_Example03 VerifyHeap)

CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ Suport for clang-format is built-in since Visual Studio 2017 15.7 and CLion 2019
99
The .clang-format file in the repository will be automatically detected and formatting is done as you type, or triggered when pressing the format hotkey.
1010

1111
### Bash
12-
First install clang-format. Instructions therefore can be found on the web. To format you can run this command in bash:
12+
First install clang-format. Instructions therefore can be found on the web.
13+
To format your changes since branching off `dev`, you can run this command in bash:
1314
```
14-
find -iname *.cu -o -iname *.hpp | xargs clang-format-10 -i
15+
git clang-format dev
16+
```
17+
To format all code in your working copy, you can run this command in bash:
18+
```
19+
find -iname *.cpp -o -iname *.hpp | xargs clang-format -i
1520
```

0 commit comments

Comments
 (0)