CuPP Documentation
0.1.2
The CuPP framework has been developed to ease the integration of CUDA into C++ applications. It enhances CUDA by offering automatic device/host memory management, data structures and a special kernel call semantic, similar to call by reference as it is known from the C++ realm.
Download version 0.1.2 of the CuPP framework
This release of CuPP is only tested on Ubuntu Linux (32bit), but it is expected to work well on other linux flavors. Windows is untested and not expected to work correctly, but maybe in an upcoming release.
The downloadable file contains:
- the CuPP framework itself
- simple example applications demonstrating the usage of CuPP
The CuPP framework requires the following software to be installed:
Detail instructions of how to build CuPP are included in the download file. If you have any problems join us at our google group.
Examples are included in the download file in the subdirectory 'examples'.
- The number of parameters that can be passed to a kernel is limited by the function arity supported by function_traits of Boost.TypeTraits.
The CuPP framework consists of 5 highly interwoven parts of which some replace the existing CUDA counterparts whereas others offer new functionalities.
- Device management
Device management is not done implicit by associating a thread with a device as it is done by CUDA. Instead, the developer is forced to create a device handle (cupp::device), which is passed to all CuPP functions using the device, e.g. kernel calls and memory allocation. - Memory management
Two different memory management concepts are available.
- One is identical to the one offered by CUDA, unless that exceptions are thrown when an error occurs instead of returning an error code. To ease the development with this basic approach, a boost library-compliant shared pointer for global memory is supplied.
- The second type of memory management uses a class called cupp::memory1d. Objects of this class represent a linear block of global memory. The memory is allocated when the object is created and freed when the object is destroyed. Data can be transferred to the memory from any data structure supporting iterators.
- C++ kernel call
The CuPP kernel call is implemented by a C++ functor (cupp::kernel), which adds a call by reference like semantic to basic CUDA kernel calls. This can be used to pass datastructures like cupp::vector to a kernel, so the device can modify them. - Support for classes
Using a technique called "type transformations" generic C++ classes can easily be transferred to and from device memory. - Data structures
Currently only a std::vector wrapper offering automatic memory management is supplied. This class also implements a feature called lazy memory copying, to minimize any memory transfers between device and host memory. Currently no other datastructures are supplied, but can be added with ease.
A document describing all functionalities in detail, can be found in the references section.
An detail description of the CuPP framework can be found in:
- Abe Stephens for his very usefull CUDA CMake script.
- Everyone working on the Boost Libraries for the powerful yet easy to use libraries.
- comp.lang.c++.moderated for some enlightening C++ code snippets.
The CuPP framework is licenced under the BSD licence. The detailed license is included in the downloadable file.