Bolt  1.3
C++ template library with support for OpenCL
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
bolt::amp::control Class Reference

#include <control.h>

Classes

struct  debug
 

Public Types

enum  e_UseHostMode { NoUseHost, UseHost }
 
enum  e_RunMode { Automatic, SerialCpu, MultiCoreCpu, Gpu }
 
enum  e_AutoTuneMode { NoAutoTune =0x0, AutoTuneDevice =0x1, AutoTuneWorkShape =0x2, AutoTuneAll =0x3 }
 
enum  e_WaitMode { BalancedWait, NiceWait, BusyWait, ClFinish }
 

Public Member Functions

 control (Concurrency::accelerator accel=getDefault().getAccelerator(), e_UseHostMode useHost=getDefault().getUseHost(), unsigned debug=getDefault().getDebug())
 
 control (const control &ref)
 
void setAccelerator (::Concurrency::accelerator accel)
 Set the AMP Accelerator for Bolt algorithms to use.
 
void setUseHost (e_UseHostMode useHost)
 
void setForceRunMode (e_RunMode forceRunMode)
 
void setDebug (unsigned debug)
 
void setWGPerComputeUnit (int wgPerComputeUnit)
 
void setWaitMode (e_WaitMode waitMode)
 
void setUnroll (int unroll)
 
Concurrency::accelerator & getAccelerator ()
 
const Concurrency::accelerator & getAccelerator () const
 
e_UseHostMode getUseHost () const
 
e_RunMode getForceRunMode () const
 
e_RunMode getDefaultPathToRun () const
 
unsigned getDebug () const
 
int const getWGPerComputeUnit () const
 
e_WaitMode getWaitMode () const
 
int getUnroll () const
 

Static Public Member Functions

static controlgetDefault ()
 

Detailed Description

The control class lets you control the parameters of a specific Bolt algorithm call, such as the debug information, load-balancing with the host, and more. Each Bolt Algorithm call accepts the control class as an optional first argument. Additionally, Bolt contains a global default control structure that is used in cases where the control argument is not specified; also, developers can modify this structure. Some examples:

::Concurrency::accelerator accel(::Concurrency::accelerator::default_accelerator);
bolt::amp::control myControl(accel);
int sum = bolt::cl::reduce(myControl, ...);

Developers also can inialize and save control structures to avoid the cost of copying the default on each function call. An example:

class MyClass {
MyClass(...) {
::Concurrency::accelerator accel(::Concurrency::accelerator::default_accelerator);
_boltControl.accelerator(accel);
};
void runIt()
{
int sum = bolt::amp::reduce(_boltControl, ...);
};
private:
bolt::amp::control _boltControl;
}

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