A tool consisting in an OpenCL kernel execution. The variables used in the OpenCL kernel are automatically detected.
More...
#include <CalcServer/Kernel.h>
|
static std::vector< cl_kernel > | compile (const std::string source, const std::vector< std::string > names, const std::string flags="") |
| Compile an OpenCL source code and generate the corresponding kernel.
|
|
static cl_kernel | compile_kernel (const std::string source, const std::string kernel_name, const std::string flags="") |
| Compile an OpenCL source code and generate the corresponding kernel.
|
|
A tool consisting in an OpenCL kernel execution. The variables used in the OpenCL kernel are automatically detected.
◆ Kernel()
Aqua::CalcServer::Kernel::Kernel |
( |
const std::string |
tool_name, |
|
|
const std::string |
kernel_path, |
|
|
const std::string |
entry_point = "entry" , |
|
|
const std::string |
n = "N" , |
|
|
bool |
once = false |
|
) |
| |
Constructor.
- Parameters
-
tool_name | Tool name. |
kernel_path | Kernel path. |
n | Number of threads to launch. |
once | Run this tool just once. Useful to make initializations. |
◆ ~Kernel()
Aqua::CalcServer::Kernel::~Kernel |
( |
| ) |
|
|
virtual |
◆ _execute()
cl_event Aqua::CalcServer::Kernel::_execute |
( |
const std::vector< cl_event > |
events | ) |
|
|
protectedvirtual |
Execute the tool
- Parameters
-
events | List of events that shall be waited before safe execution |
- Returns
- OpenCL event to be waited before accessing the dependencies
Reimplemented from Aqua::CalcServer::Tool.
◆ computeGlobalWorkSize()
void Aqua::CalcServer::Kernel::computeGlobalWorkSize |
( |
| ) |
|
|
protected |
Compute the global work size
◆ globalWorkSize()
size_t Aqua::CalcServer::Kernel::globalWorkSize |
( |
| ) |
const |
|
inline |
Get the work group size
- Returns
- Work group size
◆ make()
void Aqua::CalcServer::Kernel::make |
( |
const std::string |
entry_point = "entry" , |
|
|
const std::string |
flags = "" , |
|
|
const std::string |
header = "" |
|
) |
| |
|
protected |
Compile the OpenCL program
- Parameters
-
entry_point | Program entry point method. |
flags | Compiling additional flags. |
header | Header to be append at the start of the source code. |
- Returns
- false if all gone right, true otherwise.
◆ path()
const std::string Aqua::CalcServer::Kernel::path |
( |
| ) |
|
|
inline |
Get the kernel file path.
- Returns
- Tool kernel file path.
◆ setup()
void Aqua::CalcServer::Kernel::setup |
( |
| ) |
|
|
virtual |
Initialize the tool.
- Returns
- false if all gone right, true otherwise.
Reimplemented from Aqua::CalcServer::Tool.
◆ setVariables()
void Aqua::CalcServer::Kernel::setVariables |
( |
| ) |
|
|
protected |
Set the variables to the OpenCL kernel.
The method detects if a variable should be updated or if it already set either.
◆ variables()
void Aqua::CalcServer::Kernel::variables |
( |
const std::string |
entry_point = "main" | ) |
|
|
protected |
Compute the variables required by the program
- Parameters
-
entry_point | Program entry point method. |
- Returns
- false if all gone right, true otherwise.
◆ workGroupSize()
size_t Aqua::CalcServer::Kernel::workGroupSize |
( |
| ) |
const |
|
inline |
Get the work group size
- Returns
- Work group size
The documentation for this class was generated from the following files:
- /home/pepe/SPH/Code/aquagpusph/include/CalcServer/Kernel.h
- /home/pepe/SPH/Code/aquagpusph/src/CalcServer/Kernel.cpp