CSol
Public Types | Public Member Functions | Static Public Member Functions | List of all members
CSol_Solver Class Reference

CSol solver base class. More...

#include <csol_solver.h>

Inherited by CSol_SmoothedParticleImpl, and CSol_SW_LBImpl.

Public Types

enum  Buffer_Types {
  Buffer_Type_SW_b, Buffer_Type_SW_c, Buffer_Type_SW_h, Buffer_Type_SW_w,
  Buffer_Type_SW_uh, Buffer_Type_SW_vh, Buffer_Type_User = 100
}
 Solver OpenCL buffer types. More...
 
enum  Grid_Types {
  Grid_Type_SW_b, Grid_Type_SW_h, Grid_Type_SW_w, Grid_Type_SW_uh,
  Grid_Type_SW_vh, Grid_Type_User = 100
}
 Solver two-dimensional grid layer types. More...
 
enum  Lattice_Types { Lattice_Type_SW_LB_f }
 Solver lattice types. More...
 
enum  Var_Types {
  Var_Type_Gravity, Var_Type_Time, Var_Type_TimeStep, Var_Type_Seed,
  Var_Type_User = 100
}
 Solver variable types. More...
 
enum  Vect_Types {
  Vect_Type_x, Vect_Type_y, Vect_Type_z, Vect_Type_r,
  Vect_Type_time
}
 Solver vector types. More...
 

Public Member Functions

 CSol_Solver ()
 CSol_Solver constructor. More...
 
bool get_OpenCLInitialised ()
 
bool getBuffer (int type, cl::Buffer **)
 Get buffer associated with buffer type. More...
 
cl::Context & getContext ()
 Get OpenCL context. More...
 
int getDeviceID ()
 
std::vector< cl::Device > & getDevices ()
 Get OpenCL device list. More...
 
bool getDimensions (int &, int &, int &, int &)
 Get dimensions of set-up. More...
 
QString getError ()
 
bool getGrid (int type, GridScalar **)
 Get grid pointer associated with grid type. More...
 
bool getLattice (int type, GridLattice **)
 Get lattice pointer associated with lattice type. More...
 
cl_ulong getMaxMemorySize ()
 
int getMaxWorkGroupSize ()
 
bool getMetrics (REAL &, REAL &, REAL &, REAL &)
 Get spatial metrics of set-up. More...
 
bool getPoI (unsigned int &, cl::Buffer **)
 Get buffer associated with points-of-interest. More...
 
cl::CommandQueue & getQueue ()
 Get OpenCL queue. More...
 
bool getSize (int &)
 Get OpenCL workgroup-specific size. More...
 
bool getVar (int type, float &)
 Get pointer associated with variable. More...
 
bool getVar (int type, double &)
 
bool getVar (int type, int &)
 
bool getVar (int type, qint64 &)
 
std::vector< double > & getVect (int type)
 Get pointer associated with vector. More...
 
bool initOpenCL ()
 Detect OpenCL platforms and devices, create OpenCL context and run OpenCL test. More...
 
void registerBuffer (int type, cl::Buffer &)
 Set buffer associated with buffer type. More...
 
void registerDimensions (int pnx, int pny, int ppadx, int plocalx)
 
void registerGrid (int type, GridScalar &)
 Set grid pointer associated with grid type. More...
 
void registerLattice (int type, GridLattice &)
 Set lattice pointer associated with lattice type. More...
 
void registerMetrics (REAL phx, REAL phy, REAL pox, REAL poy)
 
void registerPoI (unsigned int npoi_, cl::Buffer &poi_)
 
void registerVar (int type, float)
 Set variable associated with variable type. More...
 
void registerVar (int type, double)
 
void registerVar (int type, int)
 
void registerVar (int type, qint64)
 
bool testOpenCL ()
 Run a simple OpenCL test program and compare results against expected values from the CPU. More...
 

Static Public Member Functions

static void destroyOpenCLInstance ()
 
static CSol_SolvergetOpenCLInstance ()
 
static QString timeFormat (REAL)
 Return a QString from a time value. More...
 

Detailed Description

Contains register and OpenCL handles for inter-processor use.

Member Enumeration Documentation

Enumerator
Buffer_Type_SW_b 

Shallow water base buffer.

Buffer_Type_SW_c 

Shallow water classification buffer.

Buffer_Type_SW_h 

Shallow water height buffer.

Buffer_Type_SW_w 

Shallow water height+base buffer.

Buffer_Type_SW_uh 

Shallow water unit discharge x-component buffer.

Buffer_Type_SW_vh 

Shallow water unit discharge y-component buffer.

Buffer_Type_User 

User data buffer.

enum Grid_Types
Enumerator
Grid_Type_SW_b 

Shallow water base grid.

Grid_Type_SW_h 

Shallow water height grid.

Grid_Type_SW_w 

Shallow water height+base grid.

Grid_Type_SW_uh 

Shallow water unit discharge x-component grid.

Grid_Type_SW_vh 

Shallow water unit discharge y-component grid.

Grid_Type_User 

User data grid.

Enumerator
Lattice_Type_SW_LB_f 

Shallow water population lattice.

enum Var_Types
Enumerator
Var_Type_Gravity 

Gravity variable.

Var_Type_Time 

Time in UTC seconds.

Var_Type_TimeStep 

Time step variable.

Var_Type_Seed 

Random seed.

Var_Type_User 

User data varaible.

enum Vect_Types
Enumerator
Vect_Type_x 

Position x-vector.

Vect_Type_y 

Position y-vector.

Vect_Type_z 

Position z-vector.

Vect_Type_r 

General vector.

Vect_Type_time 

Time vector.

Constructor & Destructor Documentation

Member Function Documentation

void destroyOpenCLInstance ( )
static
bool get_OpenCLInitialised ( )
inline
bool getBuffer ( int  type,
cl::Buffer **  rbuffer 
)
cl::Context & getContext ( )
int getDeviceID ( )
inline
std::vector< cl::Device > & getDevices ( )
bool getDimensions ( int &  rnx,
int &  rny,
int &  rpadx,
int &  rlocalx 
)
QString getError ( )
inline
bool getGrid ( int  type,
GridScalar **  rgrid 
)
bool getLattice ( int  type,
GridLattice **  rlattice 
)
cl_ulong getMaxMemorySize ( )
inline
int getMaxWorkGroupSize ( )
inline
bool getMetrics ( REAL &  rhx,
REAL &  rhy,
REAL &  rox,
REAL &  roy 
)
CSol_Solver * getOpenCLInstance ( )
static
bool getPoI ( unsigned int &  npoi_,
cl::Buffer **  rbuffer 
)
cl::CommandQueue & getQueue ( )
bool getSize ( int &  rpadx)
bool getVar ( int  type,
float &  rvar 
)
bool getVar ( int  type,
double &  rvar 
)
bool getVar ( int  type,
int &  rvar 
)
bool getVar ( int  type,
qint64 &  rvar 
)
std::vector< double > & getVect ( int  type)
bool initOpenCL ( )
void registerBuffer ( int  type,
cl::Buffer &  buffer 
)
void registerDimensions ( int  pnx,
int  pny,
int  ppadx,
int  plocalx 
)
inline
void registerGrid ( int  type,
GridScalar grid 
)
void registerLattice ( int  type,
GridLattice lattice 
)
void registerMetrics ( REAL  phx,
REAL  phy,
REAL  pox,
REAL  poy 
)
inline
void registerPoI ( unsigned int  npoi_,
cl::Buffer &  poi_ 
)
inline
void registerVar ( int  type,
float  var 
)
void registerVar ( int  type,
double  var 
)
void registerVar ( int  type,
int  var 
)
void registerVar ( int  type,
qint64  var 
)
bool testOpenCL ( )
QString timeFormat ( REAL  floatSeconds)
static