open_iA  2020.01
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Macros | Functions
cl_common.h File Reference
#include <itkMacro.h>
#include <QtGui>
#include <QMessageBox>
#include "iAmat4.h"
#include "CL/cl.hpp"
Include dependency graph for cl_common.h:

Macros

#define CL_TARGET_OPENCL_VERSION   120
 
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
 
#define itk_clSafeCall(err)
 
#define itk_clThrowBuildLog(log)
 

Functions

void cl_init (cl::Device &device_out, cl::Context &context_out, cl::CommandQueue &queue_out, cl_device_type devType=CL_DEVICE_TYPE_GPU)
 
const char * descriptionOfError (cl_int err)
 
int generateEmbeddableSource (QString src_filename, QString output_filename)
 
size_t GetLocalForKernel (const cl::Kernel kernel, const size_t global, const cl::Device device)
 Get best fitting 1D local size given the global size and an OpenCL kernel. More...
 
QString readFile (QString filename)
 
cl_float4 Vec3_to_cl_float4 (const iAVec3f &v)
 

Macro Definition Documentation

◆ CL_TARGET_OPENCL_VERSION

#define CL_TARGET_OPENCL_VERSION   120

◆ CL_USE_DEPRECATED_OPENCL_1_1_APIS

#define CL_USE_DEPRECATED_OPENCL_1_1_APIS

◆ itk_clSafeCall

#define itk_clSafeCall (   err)
Value:
if(CL_SUCCESS != err)\
{\
char buffer[200];\
sprintf (buffer, "An error occurred in OpenCL function call! Error: \"%s\"", descriptionOfError(err));\
throw itk::ExceptionObject(__FILE__, __LINE__, buffer);\
}

◆ itk_clThrowBuildLog

#define itk_clThrowBuildLog (   log)
Value:
{\
char buffer[99999];\
sprintf (buffer, "An error occurred during OpenCL build. Log:\n \"%s\"", log.data());\
throw itk::ExceptionObject(__FILE__, __LINE__, buffer);\
}

Function Documentation

◆ cl_init()

void cl_init ( cl::Device &  device_out,
cl::Context &  context_out,
cl::CommandQueue &  queue_out,
cl_device_type  devType = CL_DEVICE_TYPE_GPU 
)
inline

◆ descriptionOfError()

const char* descriptionOfError ( cl_int  err)
inline

◆ generateEmbeddableSource()

int generateEmbeddableSource ( QString  src_filename,
QString  output_filename 
)
inline

◆ GetLocalForKernel()

size_t GetLocalForKernel ( const cl::Kernel  kernel,
const size_t  global,
const cl::Device  device 
)
inline

Get best fitting 1D local size given the global size and an OpenCL kernel.

Global size should be dividable by local size. And local size should not be more than the maximum number of threads that kernel can handle.

◆ readFile()

QString readFile ( QString  filename)
inline

◆ Vec3_to_cl_float4()

cl_float4 Vec3_to_cl_float4 ( const iAVec3f v)
inline
descriptionOfError
const char * descriptionOfError(cl_int err)
Definition: cl_common.h:20