CLOGS
C++ library for sorting and searching in OpenCL applications
clogs::Algorithm Class Reference

Base class for all algorithm classes. More...

#include <core.h>

Inheritance diagram for clogs::Algorithm:

Public Member Functions

void setEventCallback (void(*callback)(const cl::Event &, void *), void *userData, void(*free)(void *)=NULL)
 Set a callback function that will receive a list of all underlying events. More...
 
template<typename T >
void setEventCallback (const T &callback)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The provided function object will be passed a cl::Event. More...
 
void setEventCallback (void(*callback)(cl_event, void *), void *userData, void(*free)(void *)=NULL)
 

Protected Member Functions

void moveConstruct (Algorithm &other)
 Constructs this by stealing the pointer from other.
 
detail::Algorithm * moveAssign (Algorithm &other)
 Sets this by stealing the pointer from other, and returning the previous value.
 
void swap (Algorithm &other)
 Swaps the pointers between this and other.
 
detail::Algorithm * getDetail () const
 Returns the embedded pointer.
 
detail::Algorithm * getDetailNonNull () const
 Returns the embedded pointer. More...
 
void setDetail (detail::Algorithm *ptr)
 Set the value of the embedded pointer. More...
 

Detailed Description

Base class for all algorithm classes.

Member Function Documentation

detail::Algorithm* clogs::Algorithm::getDetailNonNull ( ) const
protected

Returns the embedded pointer.

Exceptions
std::logic_errorif the pointer is null.
void clogs::Algorithm::setDetail ( detail::Algorithm *  ptr)
protected

Set the value of the embedded pointer.

Note that this overwrites the previous value without freeing it.

void clogs::Algorithm::setEventCallback ( void(*)(const cl::Event &, void *)  callback,
void *  userData,
void(*)(void *)  free = NULL 
)
inline

Set a callback function that will receive a list of all underlying events.

The callback will be called multiple times during each enqueue, because the implementation uses multiple commands. This allows profiling information to be extracted from the events once they complete.

The callback may also be set to NULL to disable it.

Note
This is not an event completion callback: it is called during enqueue, generally before the events complete.
Parameters
callbackThe callback function.
userDataArbitrary data to be passed to the callback.
freePassed userData when this object is destroyed.
template<typename T >
void clogs::Algorithm::setEventCallback ( const T &  callback)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The provided function object will be passed a cl::Event.

The function object type must be copyable.

void clogs::Algorithm::setEventCallback ( void(*)(cl_event, void *)  callback,
void *  userData,
void(*)(void *)  free = NULL 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


The documentation for this class was generated from the following file: