Complex tool to perform the link-list based on an array. This tool include the following steps:
More...
#include <LinkList.hpp>
|
| LinkList (const std::string tool_name, const std::string input="r", const std::string input_min="r_min", const std::string input_max="r_max", const std::string ihoc="ihoc", const std::string icell="icell", const std::string n_cells="n_cells", const std::string permutations="id_unsorted", const std::string inv_permutations="id_sorted", bool recompute_grid=true, const std::string sorter="radix-sort", bool once=false) |
| ~LinkList () |
void | setup () |
cl_event | getUserEvent () const |
| Get the user event generated by this tool to mark when ncells have been successfully computed and the required memory allocated.
|
| Tool (const std::string tool_name, bool once=false) |
virtual | ~Tool () |
virtual void | execute () |
| Execute the tool measuring the elapsed time.
|
virtual Tool * | next_tool () |
Tool * | prev_tool () const |
void | prev_tool (Tool *tool) |
size_t | allocatedMemory () const |
unsigned int | used_times () const |
void | addElapsedTime (float elapsed_time) |
| Add new data to the average and squared elapsed times.
|
float | elapsedTime (bool averaged=true) const |
float | elapsedTimeVariance () const |
float | elapsedTimeDeviation () const |
virtual int | scope_modifier () const |
std::vector< InputOutput::Variable * > | getInputDependencies () const |
| Get the input depedencies of the tool.
|
std::vector< InputOutput::Variable * > | getOutputDependencies () const |
| Get the output depedencies of the tool.
|
std::tuple< std::vector< InputOutput::Variable * >, std::vector< InputOutput::Variable * > > | getDependencies () const |
| Get the depedencies of the tool.
|
cl_event | getEvent () const |
| Get the tool event.
|
void | parent (Tool *tool) |
| Set the tool parent.
|
Tool * | parent () |
| Get the tool parent.
|
| Named (const std::string name) |
| ~Named () |
void | name (const std::string tool_name) |
const std::string | name () const |
| Get the name.
|
| Profiler () |
| ~Profiler () |
std::vector< Profile * > | substages () const |
| Get the substages.
|
|
enum | dep_events { in = 0x01
, out = 0x02
, all = 0x03
} |
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.
|
Complex tool to perform the link-list based on an array. This tool include the following steps:
- Minimum and maximum positions computations
- Number of cells calculation
- "ihoc" array allocation
- "ihoc" and "icell" calculations
- Radix sort of "icell", computing permutation array "id_sorted" and "id_unsorted" as well.
- Note
- Hardcoded versions of the files CalcServer/LinkList.cl.in and CalcServer/LinkList.hcl.in are internally included as a text array.
- Warning
- This tool is assuming that "support" and "h" variables remains constant
◆ LinkList()
Aqua::CalcServer::LinkList::LinkList |
( |
const std::string | tool_name, |
|
|
const std::string | input = "r", |
|
|
const std::string | input_min = "r_min", |
|
|
const std::string | input_max = "r_max", |
|
|
const std::string | ihoc = "ihoc", |
|
|
const std::string | icell = "icell", |
|
|
const std::string | n_cells = "n_cells", |
|
|
const std::string | permutations = "id_unsorted", |
|
|
const std::string | inv_permutations = "id_sorted", |
|
|
bool | recompute_grid = true, |
|
|
const std::string | sorter = "radix-sort", |
|
|
bool | once = false ) |
Constructor.
- Parameters
-
tool_name | Tool name. |
input | Input array to be used as the particles positions. |
input_min | Minimum of the particles positions. |
input_max | Maximum of the particles positions. |
ihoc | Head of cells array. |
icell | Cell of each particle. |
n_cells | Number of cells. |
permutations | Variable where the permutations will be stored. |
inv_permutations | Variable where the inverse permutations will be stored. |
recompute_grid | Should be input_min and input_max recomputed or readed from the variables. |
sorter | The sorting tool, either "bitonic" or "radix-sort" |
once | Run this tool just once. Useful to make initializations. |
- Note
ihoc
array is marked as reallocatable with Aqua::InputOutput::ArrayVariable::reallocatable(), since it might need to be extended
◆ ~LinkList()
Aqua::CalcServer::LinkList::~LinkList |
( |
| ) |
|
◆ _execute()
cl_event Aqua::CalcServer::LinkList::_execute |
( |
const std::vector< cl_event > | events | ) |
|
|
protected |
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
◆ allocate()
void Aqua::CalcServer::LinkList::allocate |
( |
| ) |
|
|
protected |
Allocate the "ihoc" array.
- Note
- This method is publicly available to make it accessible from an OpenCL callback
◆ getUserEvent()
cl_event Aqua::CalcServer::LinkList::getUserEvent |
( |
| ) |
const |
|
inline |
Get the user event generated by this tool to mark when ncells have been successfully computed and the required memory allocated.
- Returns
- The event
◆ nCells() [1/3]
template<>
void Aqua::CalcServer::LinkList::nCells |
( |
| ) |
|
|
protected |
◆ nCells() [2/3]
template<>
void Aqua::CalcServer::LinkList::nCells |
( |
| ) |
|
|
protected |
◆ nCells() [3/3]
void Aqua::CalcServer::LinkList::nCells |
( |
| ) |
|
|
protected |
Compute the number of cells.
- Note
- This method is publicly available to make it accessible from an OpenCL callback
◆ setup()
void Aqua::CalcServer::LinkList::setup |
( |
| ) |
|
|
virtual |
◆ setVariables()
void Aqua::CalcServer::LinkList::setVariables |
( |
| ) |
|
|
protected |
Update the changed variables.
- Note
- This method is publicly available to make it accessible from an OpenCL callback
The documentation for this class was generated from the following files:
- /home/pepe/SPH/Code/aquagpusph/aquagpusph/CalcServer/LinkList.hpp
- /home/pepe/SPH/Code/aquagpusph/aquagpusph/CalcServer/LinkList.cpp