spla
Public Member Functions | Static Public Member Functions | List of all members
spla::Library Class Referencefinal

Library global state automatically instantiated on lib init. More...

#include <library.hpp>

Public Member Functions

 Library ()
 
 ~Library ()
 
 Library (const Library &)=delete
 
 Library (Library &&)=delete
 
void finalize ()
 Finalize library execution. More...
 
Status set_accelerator (AcceleratorType accelerator)
 Set accelerator to be used in library computations. More...
 
Status set_platform (int index)
 Selects platform for computations for current accelerator. More...
 
Status set_device (int index)
 Selects device for computations for current accelerator. More...
 
Status set_queues_count (int count)
 Set number of GPU queues for parallel ops execution. More...
 
Status set_message_callback (MessageCallback callback)
 Set callback function called on library message event. More...
 
Status set_default_callback ()
 Sets default library callback to log messages to console. More...
 
Status set_force_no_acceleration (bool value)
 Sets option to force cpu only usage without acceleration. More...
 
bool is_set_force_no_acceleration ()
 
Status get_accelerator_info (std::string &info)
 Get acc info in a form of a string. More...
 
Status time_profile_dump ()
 Dumps to default output current time profile. More...
 
Status time_profile_reset ()
 Reset current time profile. More...
 
class Acceleratorget_accelerator ()
 
class Registryget_registry ()
 
class Dispatcherget_dispatcher ()
 
class Loggerget_logger ()
 
class TimeProfilerget_time_profiler ()
 

Static Public Member Functions

static Libraryget ()
 Access global library instance. More...
 

Detailed Description

Library global state automatically instantiated on lib init.

Constructor & Destructor Documentation

◆ Library() [1/3]

spla::Library::Library ( )

◆ ~Library()

spla::Library::~Library ( )
default

◆ Library() [2/3]

spla::Library::Library ( const Library )
delete

◆ Library() [3/3]

spla::Library::Library ( Library &&  )
delete

Member Function Documentation

◆ finalize()

void spla::Library::finalize ( )

Finalize library execution.

Finalize method must be called at the end after application to correctly shutdown global library state, release any enabled acceleration device and release any pending device resources.

Warning
Must be called after application execution
After this call no other library function call is allowed

◆ get()

Library * spla::Library::get ( )
static

Access global library instance.

Global library state instantiate once on first request to the library. Call this function to access library and configure it first before any computations.

Note
Only single global instance of the library allowed.
Returns
Global library instance

◆ get_accelerator()

class Accelerator * spla::Library::get_accelerator ( )
Warning
Internal usage only!
Returns
Library computations accelerator if presented

◆ get_accelerator_info()

Status spla::Library::get_accelerator_info ( std::string &  info)

Get acc info in a form of a string.

Parameters
[out]infoString to store info
Returns
Function call status

◆ get_dispatcher()

class Dispatcher * spla::Library::get_dispatcher ( )
Warning
Internal usage only!
Returns
Library algorithms dispatcher

◆ get_logger()

class Logger * spla::Library::get_logger ( )
Warning
Internal usage only!
Returns
Library logger

◆ get_registry()

class Registry * spla::Library::get_registry ( )
Warning
Internal usage only!
Returns
Library algorithms registry

◆ get_time_profiler()

class TimeProfiler * spla::Library::get_time_profiler ( )
Warning
Internal usage only!
Returns
Library time profiler

◆ is_set_force_no_acceleration()

bool spla::Library::is_set_force_no_acceleration ( )

◆ set_accelerator()

Status spla::Library::set_accelerator ( AcceleratorType  accelerator)

Set accelerator to be used in library computations.

Sets type of the accelerator to be used in library computations. By default library attempts automatically init OpenCL accelerator if OpenCL runtime present in the system. Set None to disable acceleration.

Parameters
acceleratorAccelerate type
Returns
Function call status

◆ set_default_callback()

Status spla::Library::set_default_callback ( )

Sets default library callback to log messages to console.

Returns
Function call status

◆ set_device()

Status spla::Library::set_device ( int  index)

Selects device for computations for current accelerator.

Parameters
indexDevice index in current platform devices
Returns
Function call status

◆ set_force_no_acceleration()

Status spla::Library::set_force_no_acceleration ( bool  value)

Sets option to force cpu only usage without acceleration.

Parameters
valueTrue to disable any acceleration
Returns
Function call status

◆ set_message_callback()

Status spla::Library::set_message_callback ( MessageCallback  callback)

Set callback function called on library message event.

Parameters
callbackFunction to be called
Returns
Function call status

◆ set_platform()

Status spla::Library::set_platform ( int  index)

Selects platform for computations for current accelerator.

Parameters
indexPlatform index to select in current PC supported list.
Returns
Function call status

◆ set_queues_count()

Status spla::Library::set_queues_count ( int  count)

Set number of GPU queues for parallel ops execution.

Parameters
countNumber of queues to set
Returns
Function call status

◆ time_profile_dump()

Status spla::Library::time_profile_dump ( )

Dumps to default output current time profile.

Returns
Function call status

◆ time_profile_reset()

Status spla::Library::time_profile_reset ( )

Reset current time profile.

Returns
Function call status

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