Methods to perform a radix sort using the GPU (or any device supported by OpenCL). The code has 3 steps:
More...
#include <CalcServer/RadixSort.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.
|
|
Methods to perform a radix sort using the GPU (or any device supported by OpenCL). The code has 3 steps:
- Create the histogram.
- Scan the histogram to create the accumulated one.
- Permut the variables. To learn more about this code, please see also http://code.google.com/p/ocl-radix-sort/updates/list.
- Note
- Hardcoded versions of the files CalcServer/RadixSort.cl.in and CalcServer/RadixSort.hcl.in are internally included as a text array.
◆ RadixSort()
Aqua::CalcServer::RadixSort::RadixSort |
( |
const std::string |
tool_name, |
|
|
const std::string |
variable = "icell" , |
|
|
const std::string |
permutations = "id_unsorted" , |
|
|
const std::string |
inv_permutations = "id_sorted" , |
|
|
bool |
once = false |
|
) |
| |
Constructor.
- Parameters
-
tool_name | Tool name. |
variable | Variable to sort. |
permutations | Variable where the permutations will be stored. |
inv_permutations | Variable where the inverse permutations will be stored. |
once | Run this tool just once. Useful to make initializations. |
◆ ~RadixSort()
Aqua::CalcServer::RadixSort::~RadixSort |
( |
| ) |
|
◆ _execute()
cl_event Aqua::CalcServer::RadixSort::_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 accesing the dependencies
Reimplemented from Aqua::CalcServer::Tool.
◆ setup()
void Aqua::CalcServer::RadixSort::setup |
( |
| ) |
|
|
virtual |
The documentation for this class was generated from the following files:
- /home/pepe/SPH/Code/aquagpusph/include/CalcServer/RadixSort.h
- /home/pepe/SPH/Code/aquagpusph/src/CalcServer/RadixSort.cpp