Basic Image AlgorithmS Library
2.8.0
|
OpenCL Context wrapper. More...
#include <OpenCLFramework/clfContext.hh>
Public Types | |
enum | clfDeviceType { clfContextTypeCPU = 0, clfContextTypeGPU } |
Public Member Functions | |
void | AcquireGLObject (clfMemory &buffer) |
acquire a buffer allocated from opengl, call glfinish first! More... | |
clfContext (bool useGLsharing=false, clfDeviceType deviceType=clfContextTypeGPU) | |
Create clfContext for first GPU device found. More... | |
clfBuffer * | CreateBuffer () |
create buffer object More... | |
clfImage2D * | CreateImage2D () |
create buffer object More... | |
clfImage3D * | CreateImage3D () |
create buffer object More... | |
clfProgram * | CreateProgram () |
create program object More... | |
int | DivUp (const int mod, int val) |
void | Finish () |
force finishing the command queue More... | |
unsigned int | GetActiveDevice () |
clfDeviceInfo | GetDeviceInfo (unsigned int device=0) |
unsigned int | GetNumDevices () |
bool | IsSharedGLContext () |
void | PrintDeviceInfo (unsigned int device=0, bool verbose=false, std::ostream &out=std::cout) |
print info on computing device More... | |
void | PrintPlatformsInfo (std::ostream &out=std::cout) |
print info on available platforms More... | |
void | ReleaseGLObject (clfMemory &buffer) |
release a buffer allocated from opengl, call Finish first! More... | |
void | RunOn1DRange (clfProgram &program, std::string kernelname, unsigned int globalrange, unsigned int localrange=0) |
run a kernel on a 1D memory range More... | |
void | RunOn2DRange (clfProgram &program, std::string kernelname, unsigned int globalrangeX, unsigned int globalrangeY, unsigned int localrangeX=0, unsigned int localrangeY=0) |
run a kernel on a 2D memory range More... | |
void | RunOn3DRange (clfProgram &program, std::string kernelname, unsigned int globalrangeX, unsigned int globalrangeY, unsigned int globalrangeZ, unsigned int localrangeX=0, unsigned int localrangeY=0, unsigned int localrangeZ=0) |
run a kernel on a 3D memory range More... | |
void | SetActiveDevice (unsigned int device) |
virtual | ~clfContext () |
deletes context and queue, making objects created from this context invalid! More... | |
Protected Member Functions | |
void | QueryDeviceInfo_ (unsigned int device=0) |
Static Protected Member Functions | |
static void | clnotify (const char *p1, const void *p2, size_t p3, clfContext *p4) |
internal notification function for status from clf context More... | |
OpenCL Context wrapper.
OpenCLContext bundles one context and one command queue. After creation, use OpenCLContext to instantiate buffer objects and programs valid for this context.
Definition at line 49 of file clfContext.hh.
Enumerator | |
---|---|
clfContextTypeCPU | |
clfContextTypeGPU |
Definition at line 51 of file clfContext.hh.
BIAS::clfContext::clfContext | ( | bool | useGLsharing = false , |
clfDeviceType | deviceType = clfContextTypeGPU |
||
) |
Create clfContext for first GPU device found.
useGLsharing | true if you want to share GL objects. A valid GL context must be available! |
Definition at line 39 of file clfContext.cpp.
|
virtual |
deletes context and queue, making objects created from this context invalid!
Definition at line 118 of file clfContext.cpp.
void BIAS::clfContext::AcquireGLObject | ( | clfMemory & | buffer | ) |
acquire a buffer allocated from opengl, call glfinish first!
buffer | the buffer object |
Definition at line 271 of file clfContext.cpp.
References BIAS::clfMemory::memory().
Referenced by BIAS::clfTrimmedICP::ComputeNearestPoints_(), and BIAS::clfTrimmedICP::ComputeOptimalMotion_().
|
staticprotected |
internal notification function for status from clf context
Definition at line 121 of file clfContext.cpp.
|
inline |
create buffer object
Definition at line 79 of file clfContext.hh.
Referenced by BIAS::clfGradientGauss< InputStorageType, OutputStorageType >::clfGradientGauss(), BIAS::clfRadixSort::clfRadixSort(), BIAS::clfTrimmedICP::clfTrimmedICP(), BIAS::clfTrimmedICP::SetDataFromDepthMap(), and BIAS::clfTrimmedICP::SetModelFromDepthMap().
|
inline |
create buffer object
Definition at line 87 of file clfContext.hh.
Referenced by BIAS::clfFilter< InputStorageType, OutputStorageType >::clfFilter(), BIAS::clfRecursiveGauss::FilterGrey(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfRecursiveGauss::FilterX(), BIAS::clfRecursiveGauss::FilterY(), BIAS::clfUnifiedMultilateralFilter::Init(), BIAS::clfUnifiedMultilateralFilter::InitColorFilter(), and BIAS::clfUnifiedMultilateralFilter::InitDepthFilter().
|
inline |
|
inline |
create program object
Definition at line 71 of file clfContext.hh.
Referenced by BIAS::clfColorConversion::clfColorConversion(), BIAS::clfSimpleFilter::clfSimpleFilter(), BIAS::clfTrimmedICP::clfTrimmedICP(), and BIAS::clfAlgorithm::InitInternal_().
int BIAS::clfContext::DivUp | ( | const int | mod, |
int | val | ||
) |
Definition at line 416 of file clfContext.cpp.
Referenced by BIAS::clfRadixSort::ApplyPermutation(), and BIAS::clfResampleImage::Filter().
void BIAS::clfContext::Finish | ( | ) |
force finishing the command queue
Definition at line 289 of file clfContext.cpp.
Referenced by BIAS::clfUnifiedMultilateralFilter::Compute(), BIAS::clfTrimmedICP::ComputeNearestPoints_(), BIAS::clfTrimmedICP::ComputeOptimalMotion_(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfRadixSort::Histogram(), BIAS::clfRadixSort::Host2GPU(), BIAS::clfRadixSort::RecupGPU(), BIAS::clfRadixSort::Reorder(), BIAS::clfRadixSort::ScanHistogram(), BIAS::clfRadixSort::SetData(), and BIAS::clfRadixSort::Transpose().
unsigned int BIAS::clfContext::GetActiveDevice | ( | ) |
Definition at line 411 of file clfContext.cpp.
|
inline |
Definition at line 141 of file clfContext.hh.
Referenced by BIAS::clfTrimmedICP::clfTrimmedICP(), BIAS::clfTVL1Flow::clfTVL1Flow(), and BIAS::clfAlgorithm::InitInternal_().
|
inline |
Definition at line 137 of file clfContext.hh.
|
inline |
Definition at line 145 of file clfContext.hh.
Referenced by BIAS::clfAlgorithm::InitInternal_().
void BIAS::clfContext::PrintDeviceInfo | ( | unsigned int | device = 0 , |
bool | verbose = false , |
||
std::ostream & | out = std::cout |
||
) |
print info on computing device
Definition at line 127 of file clfContext.cpp.
void BIAS::clfContext::PrintPlatformsInfo | ( | std::ostream & | out = std::cout | ) |
print info on available platforms
Definition at line 204 of file clfContext.cpp.
|
protected |
Definition at line 297 of file clfContext.cpp.
void BIAS::clfContext::ReleaseGLObject | ( | clfMemory & | buffer | ) |
release a buffer allocated from opengl, call Finish first!
buffer | the buffer object |
Definition at line 280 of file clfContext.cpp.
References BIAS::clfMemory::memory().
Referenced by BIAS::clfTrimmedICP::ComputeNearestPoints_(), and BIAS::clfTrimmedICP::ComputeOptimalMotion_().
void BIAS::clfContext::RunOn1DRange | ( | clfProgram & | program, |
std::string | kernelname, | ||
unsigned int | globalrange, | ||
unsigned int | localrange = 0 |
||
) |
run a kernel on a 1D memory range
globalrange | overall memory size in byte, should be multiple of compute units on device |
localrange | memory range in byte handled by each thread, should be even divisor of compute units on device (or 0) |
Definition at line 220 of file clfContext.cpp.
Referenced by BIAS::clfRadixSort::ApplyPermutation(), BIAS::clfTrimmedICP::ComputeNearestPoints_(), BIAS::clfTrimmedICP::ComputeOptimalMotion_(), BIAS::clfRecursiveGauss::FilterGrey(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfRecursiveGauss::FilterX(), BIAS::clfRecursiveGauss::FilterY(), BIAS::clfRadixSort::Histogram(), BIAS::clfRadixSort::Reorder(), and BIAS::clfRadixSort::ScanHistogram().
void BIAS::clfContext::RunOn2DRange | ( | clfProgram & | program, |
std::string | kernelname, | ||
unsigned int | globalrangeX, | ||
unsigned int | globalrangeY, | ||
unsigned int | localrangeX = 0 , |
||
unsigned int | localrangeY = 0 |
||
) |
run a kernel on a 2D memory range
Definition at line 234 of file clfContext.cpp.
Referenced by BIAS::clfUnifiedMultilateralFilter::Compute(), BIAS::clfCopy::Copy(), BIAS::clfImageOperator::CutOffMinThreshold(), BIAS::clfImageOperator::Difference(), BIAS::clfSimpleFilter::Filter(), BIAS::clfStructureTensor::Filter(), BIAS::clfExtractLocalMaxima::Filter(), BIAS::clfScaleImage::Filter(), BIAS::clfResampleImage::Filter(), BIAS::clfRecursiveGauss::FilterGrey(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfSimpleFilter::FilterScale(), and BIAS::clfRadixSort::Transpose().
void BIAS::clfContext::RunOn3DRange | ( | clfProgram & | program, |
std::string | kernelname, | ||
unsigned int | globalrangeX, | ||
unsigned int | globalrangeY, | ||
unsigned int | globalrangeZ, | ||
unsigned int | localrangeX = 0 , |
||
unsigned int | localrangeY = 0 , |
||
unsigned int | localrangeZ = 0 |
||
) |
run a kernel on a 3D memory range
Definition at line 251 of file clfContext.cpp.
void BIAS::clfContext::SetActiveDevice | ( | unsigned int | device | ) |
Definition at line 403 of file clfContext.cpp.
Referenced by BIAS::clfAlgorithm::InitInternal_().