AQUAgpusph 5.0.4
|
Calculation server name space. More...
Namespaces | |
namespace | Reports |
Runtime outputs name space. |
Data Structures | |
struct | _ProfilingSample |
Profiling sample. More... | |
struct | _ProfilingSnapshot |
Profiling snapshot. More... | |
class | ArgSetter |
class | Assert |
Check that a condition holds true, or throw a fatal error otherwise. More... | |
class | CalcServer |
Entity that perform the main work of the simulation. More... | |
class | Conditional |
Base class for conditional tools like While or If. More... | |
class | Copy |
Copy an array component by component. More... | |
class | End |
Close the scope open by a previous conditional tool, like While or If. More... | |
class | EventProfile |
Profiler for tools based on OpenCL enqueued commands. More... | |
class | If |
Execute all the tools in its scope if the condition is fulfilled. More... | |
class | Kernel |
A tool consisting in an OpenCL kernel execution. The variables used in the OpenCL kernel are automatically detected. More... | |
class | LinkList |
Complex tool to perform the link-list based on an array. This tool include the following steps: More... | |
class | MPISync |
Synchronize arrays between processes. More... | |
class | Named |
A helper class for named objects. More... | |
class | Profile |
Profiler subinstance base class. More... | |
class | Profiler |
Profiling base class. More... | |
class | ProfilingInfo |
A FIFO list of profiling snapshots. More... | |
class | Python |
Execute a Python script. More... | |
class | RadixSort |
Methods to perform a radix sort using the GPU (or any device supported by OpenCL). The code has 3 steps: More... | |
class | Reduction |
Reductions, like scans, prefix sums, maximum or minimum, etc... More... | |
class | ScalarExpression |
Base class for tools that has to evaluate a scalar expression. More... | |
class | ScalarProfile |
Profiler for tools based on scalar solvers. More... | |
class | Set |
Set all the components of an array with the desired value. More... | |
class | SetScalar |
Set a scalar variable. More... | |
class | Sort |
Methods to perform a vector sorting using the GPU (or any device supported by OpenCL). More... | |
class | Tool |
Tools base class. More... | |
class | UnSort |
Recover the original id of each particle. More... | |
class | user_interruption |
Exception raised when the user manually interrupts the simulation. More... | |
class | While |
Execute all the tools in its scope until the condition becomes unfulfilled. More... |
Typedefs | |
typedef InputOutput::ProblemSetup::sphSettings::debug_opts | debug_opts |
typedef struct Aqua::CalcServer::_ProfilingSample | ProfilingSample |
Profiling sample. | |
typedef struct Aqua::CalcServer::_ProfilingSnapshot | ProfilingSnapshot |
Profiling snapshot. |
Functions | |
void | sigint_handler (int UNUSED_PARAM s) |
Handle SIGINT signals. | |
std::atomic< CalcServer * > | g_calcserver_singleton_ptr (nullptr) |
Singleton instance of Aqua::CalcServer::CalcServer. | |
cl_command_queue | create_command_queue (cl_context context, cl_device_id device, cl_int *errcode_ret) |
Create an OpenCL command queue. | |
std::tuple< unsigned int, unsigned int > | opencl_version (std::string version) |
Get the OpenCL major and minor version from the string returned by clGetPlatformInfo() and clGetDeviceInfo() | |
std::tuple< unsigned int, unsigned int > | opencl_version (cl_platform_id platform) |
Get the paltform's OpenCL major and minor version. | |
std::tuple< unsigned int, unsigned int > | opencl_version (cl_device_id device) |
Get the device's OpenCL major and minor version. | |
std::string | getDeviceInfoStr (cl_device_id device, cl_device_info param_name) |
Wrapper to clGetDeviceInfo() for strings related operations. | |
void CL_CALLBACK | context_error_notify (const char *errinfo, const void UNUSED_PARAM *private_info, size_t UNUSED_PARAM cb, void *user_data) |
Runtime error reporting tool. | |
void CL_CALLBACK | device_timer_sampler (cl_event event, cl_int UNUSED_PARAM event_command_status, void *user_data) |
Sample both the system clock and the devie timer to compute the offset. | |
void CL_CALLBACK | event_profile_cb (cl_event UNUSED_PARAM n_event, cl_int UNUSED_PARAM cmd_exec_status, void *user_data) |
Callback called when the profiler ending event has finished. | |
void | debug_arg (unsigned int i, InputOutput::Variable *var, cl_kernel kernel, TLogLevel log_level=L_DEBUG, const char *indent="\t\t") |
Auxiliar function to print information about arguments. | |
void CL_CALLBACK | cbUserEventSync (cl_event n_event, cl_int cmd_exec_status, void *user_data) |
Syncing utility to set an user event status to the same status of another OpenCL event. | |
void | sync_user_event (cl_event user_event, cl_event event) |
Synchronize an user event with another OpenCL event. | |
bool | isKernelArgReadOnly (cl_kernel kernel, cl_uint arg_index) |
void CL_CALLBACK | populator (cl_event event, cl_int event_command_status, void *user_data) |
Callback called when Aqua::CalcServer::Reduction already set the new value on the output value. | |
void CL_CALLBACK | solver (cl_event event, cl_int event_command_status, void *user_data) |
Callback called when all the dependencies of the Aqua::CalcServer::ScalarExpression tool are fulfilled. | |
void CL_CALLBACK | exec_status_check (cl_event event, cl_int event_command_status, void *user_data) |
bool | need_new_cmd (const Tool *prev_tool, std::vector< cl_event > events) |
void | debug_event (cl_event event, CalcServer *C, TLogLevel log_level=L_DEBUG, const char *indent="\t\t") |
Auxiliar function to print information about events, for debugging purposes. |
Variables | |
static bool | sigint_received = false |
Have been a SIGINT already registered? | |
std::mutex | profiling_mutex |
A mutex to avoid several threads writing profiling samples simultaneously. | |
std::string | LINKLIST_INC = xxd2string(LinkList_hcl_in, LinkList_hcl_in_len) |
std::string | LINKLIST_SRC = xxd2string(LinkList_cl_in, LinkList_cl_in_len) |
std::string | RADIXSORT_INC = xxd2string(RadixSort_hcl_in, RadixSort_hcl_in_len) |
std::string | RADIXSORT_SRC = xxd2string(RadixSort_cl_in, RadixSort_cl_in_len) |
std::string | REDUCTION_INC = xxd2string(Reduction_hcl_in, Reduction_hcl_in_len) |
std::string | REDUCTION_SRC = xxd2string(Reduction_cl_in, Reduction_cl_in_len) |
std::string | SET_INC = xxd2string(Set_hcl_in, Set_hcl_in_len) |
std::string | SET_SRC = xxd2string(Set_cl_in, Set_cl_in_len) |
std::string | SORT_INC = xxd2string(Sort_hcl_in, Sort_hcl_in_len) |
std::string | SORT_SRC = xxd2string(Sort_cl_in, Sort_cl_in_len) |
std::string | UNSORT_INC = xxd2string(UnSort_hcl_in, UnSort_hcl_in_len) |
std::string | UNSORT_SRC = xxd2string(UnSort_cl_in, UnSort_cl_in_len) |
Calculation server name space.
Profiling sample.
Profiling snapshot.
void CL_CALLBACK Aqua::CalcServer::cbUserEventSync | ( | cl_event | n_event, |
cl_int | cmd_exec_status, | ||
void * | user_data ) |
Syncing utility to set an user event status to the same status of another OpenCL event.
This utility shall be used by means of sync_user_event()
n_event | Associated event |
cmd_exec_status | Triggering status |
user_data | Recasted cl_event pointer |
void CL_CALLBACK Aqua::CalcServer::context_error_notify | ( | const char * | errinfo, |
const void UNUSED_PARAM * | private_info, | ||
size_t UNUSED_PARAM | cb, | ||
void * | user_data ) |
Runtime error reporting tool.
Errors reported in this way directly depends on the implementation.
errinfo | is a pointer to an error string. |
private_info | pointer to binary data that is returned by the OpenCL implementation that can be used to log additional information helpful in debugging the error. |
cb | Size of the binary data, #private_info. |
user_data | Current tool name. |
cl_command_queue Aqua::CalcServer::create_command_queue | ( | cl_context | context, |
cl_device_id | device, | ||
cl_int * | errcode_ret ) |
Create an OpenCL command queue.
This function is just a wrapper for backguard compatibility. More specifically, clCreateCommandQueue is deprecated since OpenCL 1.2
context | OpenCL context |
device | OpenCL device |
errcode_ret | Returning error code |
void Aqua::CalcServer::debug_arg | ( | unsigned int | i, |
InputOutput::Variable * | var, | ||
cl_kernel | kernel, | ||
TLogLevel | log_level = L_DEBUG, | ||
const char * | indent = "\t\t" ) |
Auxiliar function to print information about arguments.
i | The index of the argument |
var | The variable to be set |
kernel | The kernel where the variable has to be set |
C | The CalcServer instance |
log_level | The log level |
indent | Base indent level |
void Aqua::CalcServer::debug_event | ( | cl_event | event, |
CalcServer * | C, | ||
TLogLevel | log_level = L_DEBUG, | ||
const char * | indent = "\t\t" ) |
Auxiliar function to print information about events, for debugging purposes.
event | The event to debug |
C | The CalcServer instance |
log_level | The log level |
indent | Base indent level |
void CL_CALLBACK Aqua::CalcServer::device_timer_sampler | ( | cl_event | event, |
cl_int UNUSED_PARAM | event_command_status, | ||
void * | user_data ) |
Sample both the system clock and the devie timer to compute the offset.
event | The triggering event |
event_command_status | CL_COMPLETE |
user_data | A casted pointer to the Aqua::CalcServer::CalcServer::_device_timer_offset value |
void CL_CALLBACK Aqua::CalcServer::event_profile_cb | ( | cl_event UNUSED_PARAM | n_event, |
cl_int UNUSED_PARAM | cmd_exec_status, | ||
void * | user_data ) |
Callback called when the profiler ending event has finished.
event | The Ending event |
cmd_exec_status | Event status |
user_data | Recasted EventProfile pointer |
void CL_CALLBACK Aqua::CalcServer::exec_status_check | ( | cl_event | event, |
cl_int | event_command_status, | ||
void * | user_data ) |
std::atomic< CalcServer * > Aqua::CalcServer::g_calcserver_singleton_ptr | ( | nullptr | ) |
Singleton instance of Aqua::CalcServer::CalcServer.
std::string Aqua::CalcServer::getDeviceInfoStr | ( | cl_device_id | device, |
cl_device_info | param_name ) |
Wrapper to clGetDeviceInfo() for strings related operations.
device | The device |
param_name | The parameter |
bool Aqua::CalcServer::isKernelArgReadOnly | ( | cl_kernel | kernel, |
cl_uint | arg_index ) |
std::tuple< unsigned int, unsigned int > Aqua::CalcServer::opencl_version | ( | cl_device_id | device | ) |
Get the device's OpenCL major and minor version.
platform | The platform identifier |
std::tuple< unsigned int, unsigned int > Aqua::CalcServer::opencl_version | ( | cl_platform_id | platform | ) |
Get the paltform's OpenCL major and minor version.
platform | The platform identifier |
std::tuple< unsigned int, unsigned int > Aqua::CalcServer::opencl_version | ( | std::string | version | ) |
Get the OpenCL major and minor version from the string returned by clGetPlatformInfo() and clGetDeviceInfo()
version | The version string |
void CL_CALLBACK Aqua::CalcServer::populator | ( | cl_event | event, |
cl_int | event_command_status, | ||
void * | user_data ) |
Callback called when Aqua::CalcServer::Reduction already set the new value on the output value.
This function is just populating the variable
event | The triggering event |
event_command_status | CL_COMPLETE upon all dependencies successfully fulfilled. A negative integer if one or mor dependencies failed. |
user_data | A casted pointer to the Aqua::CalcServer::ScalarExpression tool (or the inherited one) |
void Aqua::CalcServer::sigint_handler | ( | int UNUSED_PARAM | s | ) |
Handle SIGINT signals.
The first time a SIGINT is received, Aqua::CalcServer::sigint_received is set to true, such that, at the end of the current time step the simulation will stop, the last output will be printed, and the resources will be correctly released.
If SIGINT is received twice, then this handler will enforce the inmediate program exit.
s | Recevied signal, SIGINT |
void CL_CALLBACK Aqua::CalcServer::solver | ( | cl_event | event, |
cl_int | event_command_status, | ||
void * | user_data ) |
Callback called when all the dependencies of the Aqua::CalcServer::ScalarExpression tool are fulfilled.
This function is just redirecting the work to Aqua::CalcServer::ScalarExpression::solve()
event | The triggering event |
event_command_status | CL_COMPLETE upon all dependencies successfully fulfilled. A negative integer if one or mor dependencies failed. |
user_data | A casted pointer to the Aqua::CalcServer::ScalarExpression tool (or the inherited one) |
void Aqua::CalcServer::sync_user_event | ( | cl_event | user_event, |
cl_event | event ) |
Synchronize an user event with another OpenCL event.
clReleaseEvent() will be called on both events. Thus, call clRetainEvent() if you want to further keep them
user_event | User event to be synced |
event | Associated OpenCL event |
std::string Aqua::CalcServer::LINKLIST_INC = xxd2string(LinkList_hcl_in, LinkList_hcl_in_len) |
std::string Aqua::CalcServer::LINKLIST_SRC = xxd2string(LinkList_cl_in, LinkList_cl_in_len) |
std::mutex Aqua::CalcServer::profiling_mutex |
A mutex to avoid several threads writing profiling samples simultaneously.
std::string Aqua::CalcServer::RADIXSORT_INC = xxd2string(RadixSort_hcl_in, RadixSort_hcl_in_len) |
std::string Aqua::CalcServer::RADIXSORT_SRC = xxd2string(RadixSort_cl_in, RadixSort_cl_in_len) |
std::string Aqua::CalcServer::REDUCTION_INC = xxd2string(Reduction_hcl_in, Reduction_hcl_in_len) |
std::string Aqua::CalcServer::REDUCTION_SRC = xxd2string(Reduction_cl_in, Reduction_cl_in_len) |
std::string Aqua::CalcServer::SET_INC = xxd2string(Set_hcl_in, Set_hcl_in_len) |
std::string Aqua::CalcServer::SET_SRC = xxd2string(Set_cl_in, Set_cl_in_len) |
|
static |
Have been a SIGINT already registered?
std::string Aqua::CalcServer::SORT_INC = xxd2string(Sort_hcl_in, Sort_hcl_in_len) |
std::string Aqua::CalcServer::SORT_SRC = xxd2string(Sort_cl_in, Sort_cl_in_len) |
std::string Aqua::CalcServer::UNSORT_INC = xxd2string(UnSort_hcl_in, UnSort_hcl_in_len) |
std::string Aqua::CalcServer::UNSORT_SRC = xxd2string(UnSort_cl_in, UnSort_cl_in_len) |