SkePU  1.2
 All Classes Namespaces Files Functions Variables Enumerations Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
skepu::Environment< T > Class Template Reference

A class representing a execution environment. More...

#include <environment.h>

Public Member Functions

void finishAll_CL ()
 
void finishAll_CU (int lowID=-1, int highID=-1)
 
void finishAll ()
 
void createOpenCLProgramForMatrixTranspose ()
 

Static Public Member Functions

static EnvironmentgetInstance ()
 

Public Attributes

std::vector< std::pair< int,
int > > 
m_peerCopyGpuIDsVector
 

Protected Member Functions

 Environment ()
 
virtual ~Environment ()
 

Protected Attributes

std::vector< std::pair< int,
BackEnd > > 
m_groupMapping
 

Detailed Description

template<typename T>
class skepu::Environment< T >

A class representing a execution environment.

The Environment is used by the skeleton objects to define a execution environment for them to use. It mainly keeps track of which devices are available and gives access to them. It is implemented as a singleton so that only one environment is actually used and the skeletons stores a pointer to this instance which is created by the first defined skeleton.

Constructor & Destructor Documentation

template<typename T >
skepu::Environment< T >::Environment ( )
protected

The constructor initializes the devices.

References skepu::measureOrLoadCUDABandwidth().

Here is the call graph for this function:

template<typename T >
skepu::Environment< T >::~Environment ( )
protectedvirtual

The constructor initializes the devices.

Member Function Documentation

template<typename T >
void skepu::Environment< T >::createOpenCLProgramForMatrixTranspose ( )

A function called by the constructor. It creates the OpenCL program for the Matrix Transpose and saves a handle for the kernel. The program is built from a string containing the above mentioned generic transpose kernel. The type and function names in the generic kernel are relpaced by specific code before it is compiled by the OpenCL JIT compiler.

Also handles the use of doubles automatically by including "#pragma OPENCL EXTENSION cl_khr_fp64: enable" if doubles are used.

References skepu::read_file_into_string(), skepu::replaceTextInString(), and skepu::TransposeKernelNoBankConflicts_CL().

Here is the call graph for this function:

template<typename T >
void skepu::Environment< T >::finishAll ( )

Wrapper for CUDA and OpenCL variants. Does not do anything if neither is used. Makes code more portable.

Referenced by skepu::Map< MapFunc >::finishAll(), and skepu::Generate< GenerateFunc >::finishAll().

template<typename T >
void skepu::Environment< T >::finishAll_CL ( )

Finish all OpenCL functions on all devices.

template<typename T >
void skepu::Environment< T >::finishAll_CU ( int  lowID = -1,
int  highID = -1 
)

Finish all CUDA functions on all devices. Optionally can specify a range of IDs to block for.

Parameters
lowIDoptional. specifies the lowest CUDA ID to do synchronization on.
highIDoptional. specifies the highest CUDA ID to do synchronization on.
template<typename T >
Environment< T > * skepu::Environment< T >::getInstance ( )
static

Member Data Documentation

template<typename T>
std::vector<std::pair<int, BackEnd> > skepu::Environment< T >::m_groupMapping
protected

This attribute allows multiple skeleton implementations to be scheduled on the same backend

template<typename T>
std::vector<std::pair<int, int> > skepu::Environment< T >::m_peerCopyGpuIDsVector

0 means not enabled, 1 means enabled between all gpu combinations, -1 means enabled between some of the GPUs


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