LibreOffice Module opencl (master) 1
Classes | Functions | Variables
openclwrapper Namespace Reference

Classes

struct  GPUEnv
 
struct  KernelEnv
 

Functions

static bool initializeCommandQueue (GPUEnv &aGpuEnv)
 
void setKernelEnv (KernelEnv *envInfo)
 
bool generatBinFromKernelSource (cl_program program, const char *clFileName)
 
bool buildProgramFromBinary (const char *buildOption, GPUEnv *gpuInfo, const char *filename, int idx)
 
const std::vector< OpenCLPlatformInfo > & fillOpenCLInfo ()
 
bool canUseOpenCL ()
 
bool switchOpenCLDevice (std::u16string_view aDevice, bool bAutoSelect, bool bForceEvaluation, OUString &rOutSelectedDeviceVersionIDString)
 Used to set or switch between OpenCL devices. More...
 
void getOpenCLDeviceInfo (size_t &rDeviceId, size_t &rPlatformId)
 
void getOpenCLDeviceName (OUString &rDeviceName, OUString &rPlatformName)
 
void setOpenCLCmdQueuePosition (int nPos)
 Set the current command queue position in case of multiple command queues for a given device. More...
 
const char * errorString (cl_int nError)
 Return a textual representation of an OpenCL error code. More...
 

Variables

GPUEnv gpuEnv
 
sal_uInt64 kernelFailures = 0
 

Function Documentation

◆ buildProgramFromBinary()

OPENCL_DLLPUBLIC bool openclwrapper::buildProgramFromBinary ( const char *  buildOption,
GPUEnv gpuInfo,
const char *  filename,
int  idx 
)

◆ canUseOpenCL()

OPENCL_DLLPUBLIC bool openclwrapper::canUseOpenCL ( )

Definition at line 752 of file openclwrapper.cxx.

References env.

Referenced by fillOpenCLInfo(), getOpenCLDeviceInfo(), getOpenCLDeviceName(), and switchOpenCLDevice().

◆ errorString()

OPENCL_DLLPUBLIC const char * openclwrapper::errorString ( cl_int  nError)

Return a textual representation of an OpenCL error code.

(Currently the symbolic name sans the CL_ prefix.)

Definition at line 881 of file openclwrapper.cxx.

References CASE, and SUCCESS.

Referenced by initializeCommandQueue(), and switchOpenCLDevice().

◆ fillOpenCLInfo()

OPENCL_DLLPUBLIC const std::vector< OpenCLPlatformInfo > & openclwrapper::fillOpenCLInfo ( )

Definition at line 666 of file openclwrapper.cxx.

References canUseOpenCL(), i, nState, and OPENCL_DLL_NAME.

Referenced by switchOpenCLDevice().

◆ generatBinFromKernelSource()

OPENCL_DLLPUBLIC bool openclwrapper::generatBinFromKernelSource ( cl_program  program,
const char *  clFileName 
)

Definition at line 250 of file openclwrapper.cxx.

References CHECK_OPENCL, and SAL_INFO.

◆ getOpenCLDeviceInfo()

OPENCL_DLLPUBLIC void openclwrapper::getOpenCLDeviceInfo ( size_t &  rDeviceId,
size_t &  rPlatformId 
)

◆ getOpenCLDeviceName()

OPENCL_DLLPUBLIC void openclwrapper::getOpenCLDeviceName ( OUString &  rDeviceName,
OUString &  rPlatformName 
)

◆ initializeCommandQueue()

static bool openclwrapper::initializeCommandQueue ( GPUEnv aGpuEnv)
static

◆ setKernelEnv()

OPENCL_DLLPUBLIC void openclwrapper::setKernelEnv ( KernelEnv envInfo)

◆ setOpenCLCmdQueuePosition()

OPENCL_DLLPUBLIC void openclwrapper::setOpenCLCmdQueuePosition ( int  nPos)

Set the current command queue position in case of multiple command queues for a given device.

Definition at line 872 of file openclwrapper.cxx.

References gpuEnv, openclwrapper::GPUEnv::mnCmdQueuePos, nPos, and OPENCL_CMDQUEUE_SIZE.

Referenced by switchOpenCLDevice().

◆ switchOpenCLDevice()

OPENCL_DLLPUBLIC bool openclwrapper::switchOpenCLDevice ( std::u16string_view  aDevice,
bool  bAutoSelect,
bool  bForceEvaluation,
OUString &  rOutSelectedDeviceVersionIDString 
)

Used to set or switch between OpenCL devices.

Parameters
aDeviceIdthe id of the opencl device of type cl_device_id, "" means use software calculation
bAutoSelectuse the algorithm to select the best OpenCL device
rOutSelectedDeviceVersionIDStringreturns the selected device's version string.
Returns
returns true if there is a valid opencl device that has been set up

Definition at line 762 of file openclwrapper.cxx.

References ds_device::aDeviceID, canUseOpenCL(), env, errorString(), ds_device::eType, fillOpenCLInfo(), getDeviceInfoString(), getDeviceSelection(), gpuEnv, openclwrapper::GPUEnv::mpDevID, nState, OPENCL_DLL_NAME, OpenCLDevice, releaseOpenCLEnv(), SAL_INFO, SAL_WARN, and setOpenCLCmdQueuePosition().

Variable Documentation

◆ gpuEnv

OPENCL_DLLPUBLIC GPUEnv openclwrapper::gpuEnv

◆ kernelFailures

OPENCL_DLLPUBLIC sal_uInt64 openclwrapper::kernelFailures = 0

Definition at line 68 of file openclwrapper.cxx.