ParallelME Runtime Environment
Public Member Functions | List of all members
Runtime Class Reference

#include <Runtime.hpp>

Public Member Functions

 Runtime (JavaVM *jvm=nullptr, jobject androidContext=nullptr, std::shared_ptr< Scheduler > &&sched=std::make_shared< SchedulerFCFS >())
 
 Runtime (const Runtime &)=delete
 
Runtimeoperator= (const Runtime &)=delete
 
void submitTask (std::unique_ptr< Task > task)
 
void finish ()
 
DeviceVector & devices ()
 

Detailed Description

The Runtime class is responsible for managing all the contexts used by ParallelME's runtime to execute a given kernel. It encapsulates the OpenCL structures and the RenderScript context, for example, and is needed when creating a CLProgram or a RSProgram. When creating the runtime, a pointer to the JavaVM and the android context can be passed to the constructor, along with changing the scheduler policy to one different to the default (FCFS). To make the runtime run in an Android device, at least the JavaVM pointer must be given, and to support RenderScript a pointer to the android context (the "this" in the main activity) is also required.

Constructor & Destructor Documentation

Runtime::Runtime ( JavaVM *  jvm = nullptr,
jobject  androidContext = nullptr,
std::shared_ptr< Scheduler > &&  sched = std::make_shared<SchedulerFCFS>() 
)
inline

Constructs the runtime.

Parameters
schedthe scheduler to be used by the runtime, defaulting to First Come First Served.
jvmA pointer to the JavaVM. If this is specified, the worker threads of the runtime will be linked to the JavaVM.
androidContextThe Android Context class of the application. This normally is the "this" member of the main activity. If this is not specified, programming platforms that depend on this context (such as RenderScript) will not be used as potential devices. This context also depends on specifying a valid JavaVM on the first parameter.

Member Function Documentation

DeviceVector& Runtime::devices ( )
inline

Returns the available devices from all platforms.

void Runtime::finish ( )

Waits for all tasks to finish before returning.

void Runtime::submitTask ( std::unique_ptr< Task task)

Submits a task for execution. The runtime claims ownership to this class, which will be deleted by it after the execution.


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