Skip to content

Commit ddeae86

Browse files
committed
Merge pull request #56 from ComputationalRadiationPhysics/dev
mallocMC release 2.0.0crp
2 parents ec9c8e0 + 509036f commit ddeae86

Some content is hidden

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

48 files changed

+4921
-1308
lines changed

.travis.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ language: cpp
33
compiler:
44
- gcc
55

6+
env:
7+
global:
8+
- INSTALL_DIR=~/mylibs
9+
610
script:
711
- mkdir build_tmp && cd build_tmp
8-
- cmake $TRAVIS_BUILD_DIR
12+
- cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR $TRAVIS_BUILD_DIR
913
- make
14+
- make install
15+
- make examples
1016

1117
before_script:
1218
- sudo apt-get update -qq
@@ -17,4 +23,9 @@ before_script:
1723
- sudo apt-get install -qq nvidia-common
1824
- sudo apt-get install -qq nvidia-current
1925
- sudo apt-get install -qq nvidia-cuda-toolkit nvidia-cuda-dev
26+
- sudo apt-get install -qq libboost1.48-dev
2027
- sudo find /usr/ -name libcuda*.so
28+
29+
after_script:
30+
- ls -halR $INSTALL_DIR
31+

CHANGELOG.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
1-
Change Log / Release Log for ScatterAlloc
1+
Change Log / Release Log for mallocMC
22
================================================================
33

4+
2.0.0crp
5+
-------------
6+
**Date:** 2014-06-02
7+
8+
This release introduces mallocMC, which contains the previous algorithm and
9+
much code from ScatterAlloc 1.0.2crp. The project was renamed due to massive
10+
restructurization and because the code uses ScatterAlloc as a reference
11+
algorithm, but can be extended to include other allocators in the future.
12+
We closed all issues documented in
13+
[Milestone *Get Lib ready for PIConGPU*](https://github.com/ComputationalRadiationPhysics/mallocMC/issues?milestone=2&state=closed)
14+
15+
### Changes to ScatterAlloc 1.0.2crp
16+
17+
**Features**
18+
- completely split into policies #17
19+
- configuration through structs instead of macro #17
20+
- function `getAvailableSlots()` #5
21+
- selectable data alignment #14
22+
- function `finalizeHeap()` #11
23+
24+
**Bug fixes:**
25+
- build warning for cmake #33
26+
27+
**Misc:**
28+
- verification code and examples #35
29+
- install routines #4
30+
- See the full changes at https://github.com/ComputationalRadiationPhysics/mallocMC/compare/1.0.2crp...2.0.0crp
31+
32+
433
1.0.2crp
534
-------------
635
**Date:** 2014-01-07
736

837
This is our first bug fix release.
938
We closed all issues documented in
10-
[Milestone *Bug fixes*](https://github.com/ComputationalRadiationPhysics/scatteralloc/issues?milestone=1&state=closed)
39+
[Milestone *Bug fixes*](https://github.com/ComputationalRadiationPhysics/mallocMC/issues?milestone=1&state=closed)
1140

1241
### Changes to 1.0.1
1342

CMakeLists.txt

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,72 @@
1-
project(ScatterAlloc)
2-
cmake_minimum_required(VERSION 2.6)
3-
4-
find_package(CUDA REQUIRED)
5-
set(CUDA_NVCC_FLAGS "-arch=sm_20;-use_fast_math;")
6-
set(CUDA_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
7-
include_directories(${CUDA_INCLUDE_DIRS})
8-
cuda_include_directories(${CUDA_INCLUDE_DIRS})
9-
10-
OPTION(CUDA_OUTPUT_INTERMEDIATE_CODE "Output ptx code" OFF)
11-
if(CUDA_OUTPUT_INTERMEDIATE_CODE)
12-
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xptxas;-v;--keep")
13-
endif(CUDA_OUTPUT_INTERMEDIATE_CODE)
14-
15-
SET(CUDA_OPTIMIZATION_TYPE "unset" CACHE STRING "CUDA Optimization")
16-
set_property(CACHE CUDA_OPTIMIZATION_TYPE PROPERTY STRINGS "unset;-G0;-O0;-O1;-O2;-O3")
17-
if(NOT ${CUDA_OPTIMIZATION_TYPE} STREQUAL "unset")
18-
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};${CUDA_OPTIMIZATION_TYPE}")
19-
endif()
20-
21-
cuda_add_executable(ScatterAllocExample
22-
example.cu )
1+
project(mallocMC)
2+
cmake_minimum_required(VERSION 2.8.5)
3+
4+
# helper for libs and packages
5+
set(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/"
6+
"$ENV{CUDA_ROOT}" "$ENV{BOOST_ROOT}")
7+
8+
9+
###############################################################################
10+
# CUDA
11+
###############################################################################
12+
find_package(CUDA REQUIRED)
13+
set(CUDA_NVCC_FLAGS "-arch=sm_20;-use_fast_math;")
14+
set(CUDA_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
15+
include_directories(${CUDA_INCLUDE_DIRS})
16+
cuda_include_directories(${CUDA_INCLUDE_DIRS})
17+
18+
OPTION(CUDA_OUTPUT_INTERMEDIATE_CODE "Output ptx code" OFF)
19+
if(CUDA_OUTPUT_INTERMEDIATE_CODE)
20+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xptxas;-v;--keep")
21+
endif(CUDA_OUTPUT_INTERMEDIATE_CODE)
22+
23+
SET(CUDA_OPTIMIZATION_TYPE "unset" CACHE STRING "CUDA Optimization")
24+
set_property(CACHE CUDA_OPTIMIZATION_TYPE PROPERTY STRINGS "unset;-G0;-O0;-O1;-O2;-O3")
25+
if(NOT ${CUDA_OPTIMIZATION_TYPE} STREQUAL "unset")
26+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};${CUDA_OPTIMIZATION_TYPE}")
27+
endif()
28+
29+
30+
###############################################################################
31+
# Boost
32+
###############################################################################
33+
find_package(Boost 1.48.0 REQUIRED)
34+
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
35+
set(LIBS ${LIBS} ${Boost_LIBRARIES})
36+
37+
# nvcc + boost 1.55 work around
38+
if(Boost_VERSION EQUAL 105500)
39+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} \"-DBOOST_NOINLINE=__attribute__((noinline))\" ")
40+
endif(Boost_VERSION EQUAL 105500)
41+
42+
###############################################################################
43+
# Installation
44+
###############################################################################
45+
46+
# copy include folder to install folder
47+
INSTALL(
48+
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/include/."
49+
DESTINATION include
50+
PATTERN ".git" EXCLUDE
51+
PATTERN "mallocMC_config.hpp" EXCLUDE
52+
)
53+
54+
55+
###############################################################################
56+
# Executables
57+
###############################################################################
58+
add_custom_target(examples DEPENDS mallocMC_Example01 mallocMC_Example02 VerifyHeap)
59+
60+
cuda_add_executable(mallocMC_Example01
61+
EXCLUDE_FROM_ALL
62+
examples/mallocMC_example01.cu )
63+
cuda_add_executable(mallocMC_Example02
64+
EXCLUDE_FROM_ALL
65+
examples/mallocMC_example02.cu )
66+
cuda_add_executable(VerifyHeap
67+
EXCLUDE_FROM_ALL
68+
tests/verify_heap.cu )
69+
70+
target_link_libraries(mallocMC_Example01 ${LIBS})
71+
target_link_libraries(mallocMC_Example02 ${LIBS})
72+
target_link_libraries(VerifyHeap ${LIBS})

INSTALL.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Install
2+
-------
3+
### Dependencies
4+
- `gcc` 4.4 - 4.8 (depends on current CUDA version)
5+
- *Debian/Ubuntu:* `sudo apt-get install gcc-4.4 build-essential`
6+
- *Arch Linux:* `sudo pacman -S base-devel`
7+
- [CUDA 5.0](https://developer.nvidia.com/cuda-downloads) or higher
8+
- *Debian/Ubuntu:* `sudo apt-get install nvidia-common nvidia-current nvidia-cuda-toolkit nvidia-cuda-dev`
9+
- *Arch Linux:* `sudo pacman -S cuda`
10+
- one Nvidia **CUDA** compatible **GPU** with compute capability >= 2.0
11+
- [full list](https://developer.nvidia.com/cuda-gpus) of CUDA GPUs and their *compute capability*
12+
- `boost` >= 1.48
13+
- compile time headers
14+
- `boost::program_options`
15+
- *Debian/Ubuntu:* `sudo apt-get install libboost-dev libboost-program-options-dev`
16+
- *Arch Linux:* `sudo pacman -S boost`
17+
- or download from [http://www.boost.org/](http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz/download)
18+
- `CMake` >= 2.8.5
19+
- *Debian/Ubuntu:* `sudo apt-get install cmake file cmake-curses-gui`
20+
- *Arch Linux:* `sudo pacman -S cmake`
21+
- `git` >= 1.7.9.5
22+
- *Debian/Ubuntu:* `sudo apt-get install git`
23+
- *Arch Linux:* `sudo pacman -S git`
24+
25+
26+
### Mandatory environment variables
27+
- `CUDA_ROOT`: CUDA installation directory, e.g. `export CUDA_ROOT=<CUDA_INSTALL>`
28+
- this might be already set through your CUDA toolkit
29+
- `BOOST_ROOT`: Boost installation directory, e.g. `export BOOST_ROOT=<BOOST_INSTALL>`
30+
31+
### Examples
32+
This is an example how to compile `mallocMC` and test the example code snippets
33+
34+
1. **Setup directories:**
35+
- `mkdir -p build`
36+
2. **Download the source code:**
37+
- `git clone https://github.com/ComputationalRadiationPhysics/mallocMC.git`
38+
3. **Build**
39+
- `cd build`
40+
- `cmake ../mallocMC -DCMAKE_INSTALL_PREFIX=$HOME/libs`
41+
- `make examples`
42+
- `make install` (optional)
43+
4. **Run the examples**
44+
- `./mallocMC_Example01`
45+
- `./mallocMC_Example02`
46+
- `./VerifyHeap`
47+
- additional options: see `./VerifyHeap --help`

LICENSE

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
1-
/*
2-
ScatterAlloc: Massively Parallel Dynamic Memory Allocation for the GPU.
3-
http://www.icg.tugraz.at/project/mvp
4-
https://www.hzdr.de/crp
5-
6-
Copyright (C) 2012 Institute for Computer Graphics and Vision,
7-
Graz University of Technology
8-
Copyright (C) 2014 Institute of Radiation Physics,
9-
Helmholtz-Zentrum Dresden - Rossendorf
10-
11-
Author(s): Markus Steinberger - steinberger ( at ) icg.tugraz.at
12-
Bernhard Kainz - kainz ( at ) icg.tugraz.at
13-
Michael Kenzel - kenzel ( at ) icg.tugraz.at
14-
Rene Widera - r.widera ( at ) hzdr.de
15-
16-
Permission is hereby granted, free of charge, to any person obtaining a copy
17-
of this software and associated documentation files (the "Software"), to deal
18-
in the Software without restriction, including without limitation the rights
19-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20-
copies of the Software, and to permit persons to whom the Software is
21-
furnished to do so, subject to the following conditions:
22-
23-
The above copyright notice and this permission notice shall be included in
24-
all copies or substantial portions of the Software.
25-
26-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32-
THE SOFTWARE.
33-
*/
1+
/*
2+
mallocMC: Memory Allocation for Many Core Architectures
3+
4+
based on the work of ScatterAlloc:
5+
Massively Parallel Dynamic Memory Allocation for the GPU
6+
7+
http://www.icg.tugraz.at/project/mvp
8+
https://www.hzdr.de/crp
9+
10+
Copyright (C) 2012 Institute for Computer Graphics and Vision,
11+
Graz University of Technology
12+
Copyright (C) 2014 Institute of Radiation Physics,
13+
Helmholtz-Zentrum Dresden - Rossendorf
14+
15+
Author(s): Markus Steinberger - steinberger ( at ) icg.tugraz.at
16+
Bernhard Kainz - kainz ( at ) icg.tugraz.at
17+
Michael Kenzel - kenzel ( at ) icg.tugraz.at
18+
Rene Widera - r.widera ( at ) hzdr.de
19+
Axel Huebl - a.huebl ( at ) hzdr.de
20+
Carlchristian Eckert - c.eckert ( at ) hzdr.de
21+
22+
Permission is hereby granted, free of charge, to any person obtaining a copy
23+
of this software and associated documentation files (the "Software"), to deal
24+
in the Software without restriction, including without limitation the rights
25+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26+
copies of the Software, and to permit persons to whom the Software is
27+
furnished to do so, subject to the following conditions:
28+
29+
The above copyright notice and this permission notice shall be included in
30+
all copies or substantial portions of the Software.
31+
32+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
38+
THE SOFTWARE.
39+
*/

README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
ScatterAlloc
2-
============
1+
mallocMC
2+
=============
33

4-
ScatterAlloc: Massively Parallel Dynamic Memory Allocation for the GPU
4+
mallocMC: *Memory Allocator for Many Core Architectures*
55

6-
This project provides a **fast memory manager** for **Nvidia GPUs** with
7-
compute capability `sm_20` or higher.
6+
This project provides a framework for **fast memory managers** on **many core
7+
accelerators**. Currently, it supports **NVIDIA GPUs** of compute capability
8+
`sm_20` or higher through the *ScatterAlloc* algorithm.
9+
10+
11+
On the ScatterAlloc Algorithm
12+
-----------------------------
13+
14+
This library implements the *ScatterAlloc* algorithm, originally
15+
[forked](https://en.wikipedia.org/wiki/Fork_%28software_development%29)
16+
from the **ScatterAlloc** project, developed by the
17+
[Managed Volume Processing](http://www.icg.tugraz.at/project/mvp)
18+
group at [Institute for Computer Graphics and Vision](http://www.icg.tugraz.at),
19+
TU Graz (kudos!).
820

921
From http://www.icg.tugraz.at/project/mvp/downloads :
1022
```quote
@@ -25,35 +37,26 @@ Original Homepage: http://www.icg.tugraz.at/project/mvp
2537
Our Homepage: https://www.hzdr.de/crp
2638

2739

28-
About This Repository
29-
---------------------
30-
31-
This repository is a
32-
[fork](https://en.wikipedia.org/wiki/Fork_%28software_development%29)
33-
of the **ScatterAlloc** project from the
34-
[Managed Volume Processing](http://www.icg.tugraz.at/project/mvp)
35-
group at [Institute for Computer Graphics and Vision](http://www.icg.tugraz.at),
36-
TU Graz (kudos!).
37-
38-
Our aim is to improve the implementation, add new features and to fix some
39-
minor bugs.
40-
41-
4240
Branches
4341
--------
4442

45-
**master:** our stable new releases
43+
| *branch* | *state* | *description* |
44+
| ----------- | ------- | ----------------------- |
45+
| **master** | [![Build Status Master](https://travis-ci.org/ComputationalRadiationPhysics/mallocMC.png?branch=master)](https://travis-ci.org/ComputationalRadiationPhysics/mallocMC "master") | our stable new releases |
46+
| **dev** | [![Build Status Development](https://travis-ci.org/ComputationalRadiationPhysics/mallocMC.png?branch=dev)](https://travis-ci.org/ComputationalRadiationPhysics/mallocMC "dev") | our development branch - start and merge new branches here |
47+
| **tugraz** | n/a | *ScatterAlloc* "upstream" branch: not backwards compatible mirror for algorithmic changes |
48+
4649

47-
**dev:** our development branch - start and merge new branches here
50+
Install
51+
-------
4852

49-
**tugraz:** kind-of the "upstream" branch - only used to receive new releases
50-
from the TU Graz group
53+
Installation notes can be found in [INSTALL.md](INSTALL.md).
5154

5255

5356
Literature
5457
----------
5558

56-
Just a random link collection:
59+
Just an incomplete link collection for now:
5760

5861
- [Paper](http://www.icg.tugraz.at/Members/steinber/scatteralloc-1) by
5962
Markus Steinberger, Michael Kenzel, Bernhard Kainz and Dieter Schmalstieg

0 commit comments

Comments
 (0)