This class represents a specific CUDA program containing the CUDA kernel. More...
#include <program.hpp>
Public Member Functions | |
program (hpx::future< hpx::naming::id_type > &&gid) | |
hpx::lcos::future< void > | build (std::vector< std::string > compilerFlags, std::vector< std::string > modulenames, unsigned int debug=0) |
This method compiles the set source code. | |
void | build_sync (std::vector< std::string > compilerFlags, std::string modulename, unsigned int debug=0) |
Synchronous compilation of the source code. | |
hpx::lcos::future< void > | build (std::vector< std::string > compilerFlags, std::string modulename, unsigned int debug=0) |
void | build_sync (std::vector< std::string > compilerFlags, std::vector< std::string > modulenames, unsigned int debug=0) |
Synchronous compilation of the source code. | |
void | set_source_sync (std::string source) |
Synchronous setting source code. | |
hpx::lcos::future< void > | run (std::vector< hpx::cuda::buffer > args, std::string modulename, hpx::cuda::server::program::Dim3 grid, hpx::cuda::server::program::Dim3 block, int stream=-1) |
This method executes the kernel, compiled or set to this program. | |
hpx::lcos::future< void > | run (std::vector< hpx::cuda::buffer > args, std::string modulename, hpx::cuda::server::program::Dim3 grid, hpx::cuda::server::program::Dim3 block, std::vector< hpx::cuda::buffer > dependencies, int stream=-1) |
This method executes the kernel, compiled or set to this program. | |
hpx::lcos::future< void > | run (std::vector< hpx::cuda::buffer > args, std::string modulename, hpx::cuda::server::program::Dim3 grid, hpx::cuda::server::program::Dim3 block, hpx::cuda::buffer dependency, int stream=-1) |
hpx::lcos::future< unsigned int > | get_streams_size () |
This method returns the number of streams at this device. | |
hpx::lcos::future< unsigned int > | create_stream () |
This method returns the id of this created stream at the device. |
This class represents a specific CUDA program containing the CUDA kernel.
This class manage the execution of a specific CUDA kernel. The CUDA kernel is compiled on run time with the nvrtc library.
A program contain one default cudaStream where the kernel are attached to, if there is no stream defined. For multi-streaming applications new streams can be created within a program. The kernel related to this program are pinned to this streams.
hpx::lcos::future<void> hpx::cuda::program::build | ( | std::vector< std::string > | compilerFlags, |
std::vector< std::string > | modulenames, | ||
unsigned int | debug = 0 |
||
) | [inline] |
This method compiles the set source code.
This methods uses the nvrtc library to compile the CUDA source code. You should use this method only for compiling small CUDA kernels for testing or for only accelerating small parts of your existing code.
compilerFlags | A list with all compiler flags passed to the nvcc compiler |
modulename | Name of the kernel, which to be compiled |
debug | Compile with debug flags |
hpx::lcos::future<unsigned int> hpx::cuda::program::create_stream | ( | ) | [inline] |
This method returns the id of this created stream at the device.
hpx::lcos::future<unsigned int> hpx::cuda::program::get_streams_size | ( | ) | [inline] |
This method returns the number of streams at this device.
hpx::lcos::future<void> hpx::cuda::program::run | ( | std::vector< hpx::cuda::buffer > | args, |
std::string | modulename, | ||
hpx::cuda::server::program::Dim3 | grid, | ||
hpx::cuda::server::program::Dim3 | block, | ||
int | stream = -1 |
||
) | [inline] |
This method executes the kernel, compiled or set to this program.
modulename | The name of the kernel |
args | The function arguments passed to the kernel |
grid | The dimensions of the grid size |
block | The dimensions of the block size |
stream | The stream at which the kernel is attached to |
hpx::lcos::future<void> hpx::cuda::program::run | ( | std::vector< hpx::cuda::buffer > | args, |
std::string | modulename, | ||
hpx::cuda::server::program::Dim3 | grid, | ||
hpx::cuda::server::program::Dim3 | block, | ||
std::vector< hpx::cuda::buffer > | dependencies, | ||
int | stream = -1 |
||
) | [inline] |
This method executes the kernel, compiled or set to this program.
modulename | The name of the kernel |
args | The function arguments passed to the kernel |
grid | The dimensions of the grid size |
block | The dimensions of the block size |
dependencies | The data, the kernel execution depends on |
stream | The stream at which the kernel is attached to |