Skip to content

Commit

Permalink
Merge pull request #209 from alpaka-group/release-2.5.0crp
Browse files Browse the repository at this point in the history
merge release 2.5.0 to master
  • Loading branch information
sbastrakov authored Feb 18, 2021
2 parents dce5c92 + 8974db4 commit 5d61eec
Show file tree
Hide file tree
Showing 524 changed files with 115,142 additions and 3,206 deletions.
24 changes: 20 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# tmp files
*~

# Compiled Object files
*.slo
*.lo
*.o
/build

# Compiled Dynamic libraries
*.so
Expand All @@ -12,7 +16,19 @@
*.la
*.a

*~
/nbproject
/.vs
/build
# netbeans project files
/nbproject/

# Code::Blocks project files
/*.cbp
/*.layout

# Visual Studio Code configuration files
.vscode
.vs

# JetBrains project files
.idea/

# original backup files
*.orig
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ sudo: required

dist: bionic

cache:
apt: true
directories:
- $HOME/.cache/cmake-3.15.0

compiler:
- gcc

env:
global:
- INSTALL_DIR=~/mylibs
- CXXFLAGS="-Werror"
- PATH: $HOME/.cache/cmake-3.15.0/bin:$PATH

install:
if [ ! -f $HOME/.cache/cmake-3.15.0/bin/cmake ]; then
wget -O cmake.sh https://cmake.org/files/v3.15/cmake-3.15.0-Linux-x86_64.sh &&
sh cmake.sh --skip-license --exclude-subdir --prefix=$HOME/.cache/cmake-3.15.0 &&
rm cmake.sh;
fi;

script:
- mkdir build_tmp && cd build_tmp
Expand All @@ -19,6 +32,7 @@ script:
- make
- make install
- make examples
- make tests

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

after_script:
- ls -halR $INSTALL_DIR
Expand Down
52 changes: 52 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"title":"mallocMC - Memory Allocator for Many Core Architectures",
"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.",
"keywords":[
"mallocMC",
"CUDA",
"manycore",
"GPU",
"allocator"
],
"language":"eng",
"access_right":"open",
"license":{
"id":"MIT"
},
"creators":[
{
"name":"Eckert, Carlchristian",
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf, TU Dresden",
"orcid":"0000-0002-6459-0842"
},
{
"name":"Widera, René",
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
"orcid":"0000-0003-1642-0459"
},
{
"name":"Huebl, Axel",
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
"orcid":"0000-0003-1943-7141"
},
{
"name":"Gruber, Bernhard Manfred",
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf, CASUS, CERN",
"orcid":"0000-0001-7848-1690"
},
{
"name":"Bastrakov, Sergei",
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
"orcid":"0000-0003-3396-6154"
},
{
"name":"Worpitz, Benjamin"
},
{
"name":"Grund, Alexander",
"affiliation":"Helmholtz-Zentrum Dresden-Rossendorf",
"orcid":"0000-0002-7196-8452"
}
]
}

27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
Change Log / Release Log for mallocMC
================================================================

2.5.0crp
--------
**Date:** 2021-02-18

This release removes the native usage of CUDA by alpaka.
Attention: This release depends on an unreleased [alpaka 0.5.0dev](https://github.com/alpaka-group/alpaka/commit/34870a73ecf702069465aa030fbdf301c4d22c61)
version before the heavy alpaka namespace refactoring.

### Changes to mallocMC 2.4.0crp

**Features**
- Port to alpaka #173

**Bug fixes**
- fix HIP support (warpsize, activemask, compile issues) #182
- fix data race and printf issue #189
- fix data races in `Scatter.hpp` #190
- fix clang cuda compile #192

**Misc:**
- Added alpaka subtree and switched to C++14 #176
- Added 3rd party catch.hpp and made CMake find it #179
- Update documentation after switch to alpaka #194
- Update .clang-format and apply clang-format #197

Thanks to Bernhard Manfred Gruber and Rene Widera for contributing to this release!

2.4.0crp
--------
**Date:** 2020-05-28
Expand Down
122 changes: 63 additions & 59 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,83 +1,87 @@
project(mallocMC LANGUAGES CUDA CXX)
project(mallocMC LANGUAGES CXX)
cmake_minimum_required(VERSION 3.8)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# helper for libs and packages
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
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
################################################################################

if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()


###############################################################################
# CUDA
###############################################################################
if(NOT DEFINED COMPUTE_CAPABILITY)
set(COMPUTE_CAPABILITY "30")
# 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()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=sm_${COMPUTE_CAPABILITY} -use_fast_math")

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

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(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CUDA_OPTIMIZATION_TYPE}")
# 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
################################################################################
# warnings
add_library(warnings INTERFACE)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wshadow -Wno-unknown-pragmas -Wextra -Wno-unused-parameter -Wno-unused-local-typedefs")
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 -Wshadow")
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
###############################################################################
file(GLOB_RECURSE headers src/include/**)
add_custom_target(mallocMC SOURCES ${headers}) # create a target with the header files for IDE projects
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})

include_directories(${CMAKE_CURRENT_LIST_DIR}/src/include)
add_executable(mallocMC_Example01 EXCLUDE_FROM_ALL examples/mallocMC_example01.cu examples/mallocMC_example01_config.hpp)
add_executable(mallocMC_Example02 EXCLUDE_FROM_ALL examples/mallocMC_example02.cu)
add_executable(mallocMC_Example03 EXCLUDE_FROM_ALL examples/mallocMC_example03.cu)
add_executable(VerifyHeap EXCLUDE_FROM_ALL tests/verify_heap.cu tests/verify_heap_config.hpp)
add_custom_target(examples DEPENDS mallocMC_Example01 mallocMC_Example02 mallocMC_Example03 VerifyHeap)
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()

add_custom_target(examples DEPENDS mallocMC_Example01 mallocMC_Example03 VerifyHeap)
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ Suport for clang-format is built-in since Visual Studio 2017 15.7 and CLion 2019
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.

### Bash
First install clang-format. Instructions therefore can be found on the web. To format you can run this command in bash:
First install clang-format. Instructions therefore can be found on the web.
To format your changes since branching off `dev`, you can run this command in bash:
```
find -iname *.cu -o -iname *.hpp | xargs clang-format-10 -i
git clang-format dev
```
To format all code in your working copy, you can run this command in bash:
```
find -iname *.cpp -o -iname *.hpp | xargs clang-format -i
```
Loading

0 comments on commit 5d61eec

Please sign in to comment.