This repository contains a simple reduction implemented in Many-Core
Levels (MCL). The kernel is written on the highest level of
abstraction perfect, conform to an idealized many-core device. To
verify the outcome it is possible to run the CPU version as well.
The repository contains two source directories cpp and mcl. The
mcl directory contains the MCL kernel that should be compiled with
the MCL compiler. This directory has its own Makefile. By means of
the Makefile, the MCL compiler generates a header file, a C++ file,
and an OpenCL file in the directory cpp/reduction that
will subsequently be compiled by the C++ compiler.
The cpp directory contains the main application that will call the
MCL kernel. As discussed above, it will contain a generated directory
reduction with C++ files generated by MCL. This
directory has its own Makefile that will create the binary reduce.
The main applications uses three libraries in the directory cpp/lib
that are provided with git submodules. The three libraries
lib-io-data, lib-timer, and lib-opencl-wrapper are independent
and each have their own Makefile.
This application has the following prerequisites:
- An OpenCL device, see the specifics below
- A C++ compiler (tested with GCC)
- make (tested with GNU make)
- MCL version 0.1.5 with the binary
mclin the path
We currently support the following devices:
- A CPU with an OpewnCL runtime installed (default), tested with OpenCL 1.2 LINUX with an Intel Core i7 device.
- An Intel GPU by means of the Beignet library, tested with Beignet 1.3.2.
To use this, choose as target
intel_gpufor compilation below. - A CUDA device, at least of architecture Fermi with an NVIDIA CUDA
OpenCL runtime (tested with CUDA 9, OpenCL 1.2). To use this,
choose as target
fermifor compilation below.
We first clone and enter this repository:
git clone https://github.com/JungleComputing/reduction-mcl.git
cd reduction-mclWe then fetch the submodules:
git submodule init
git submodule updateAs mentioned earlier, each directory contains its own Makefile, but
there is a global one in the root directory as well. To build all the
sources, perform:
make allCurrently, the target hardware description is xeon_e5620 that
describes the Xeon e5620 CPU. It is possible to run this on any CPU.
To choose an alternate target, choose one from intel_gpu or fermi,
and build with:
make TGT=<your choice> allTo run the application, move to directory cpp:
cd cppAnd call the reduce program:
./reduce