Clover Git
OpenCL 1.1 software implementation
Public Member Functions | Private Member Functions | Private Attributes

Coal::Sampler Class Reference

Sampler. More...

#include <sampler.h>

Inheritance diagram for Coal::Sampler:
Collaboration diagram for Coal::Sampler:

List of all members.

Public Member Functions

 Sampler (Context *ctx, cl_bool normalized_coords, cl_addressing_mode addressing_mode, cl_filter_mode filter_mode, cl_int *errcode_ret)
 Constructor.
 Sampler (Context *ctx, unsigned int bitfield)
 Simpler constructor.
unsigned int bitfield () const
 Bitfield value usable by the kernels.
cl_int info (cl_sampler_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret) const
 Get information about the sampler.

Private Member Functions

cl_int checkImageAvailability () const

Private Attributes

unsigned int p_bitfield

Detailed Description

Sampler.

This object doesn't do anything intersting, it only converts a set of host OpenCL constants to constants that will be used by the kernels and the image reading and writing built-in functions.

Definition at line 67 of file sampler.h.


Constructor & Destructor Documentation

Sampler::Sampler ( Context ctx,
cl_bool  normalized_coords,
cl_addressing_mode  addressing_mode,
cl_filter_mode  filter_mode,
cl_int *  errcode_ret 
)

Constructor.

Parameters:
ctxparent Coal::Context
normalized_coordstrue if the coords given to the built-in image functions are normalized, false otherwise
addressing_modeaddressing mode used to read images
filter_modefilter mode used to read images
errcode_retreturn code (CL_SUCCESS if all is good)

Definition at line 43 of file sampler.cpp.

References checkImageAvailability(), CLK_ADDRESS_CLAMP, CLK_ADDRESS_CLAMP_TO_EDGE, CLK_ADDRESS_MIRRORED_REPEAT, CLK_ADDRESS_NONE, CLK_ADDRESS_REPEAT, CLK_FILTER_LINEAR, CLK_FILTER_NEAREST, CLK_NORMALIZED_COORDS_FALSE, CLK_NORMALIZED_COORDS_TRUE, and p_bitfield.

Sampler::Sampler ( Context ctx,
unsigned int  bitfield 
)

Simpler constructor.

Parameters:
ctxparent Coal::Context
bitfieldbitfield already calculated

Definition at line 101 of file sampler.cpp.

References checkImageAvailability().


Member Function Documentation

unsigned int Sampler::bitfield ( ) const

Bitfield value usable by the kernels.

Definition at line 163 of file sampler.cpp.

References p_bitfield.

cl_int Sampler::checkImageAvailability ( ) const [private]

Definition at line 107 of file sampler.cpp.

References Coal::DeviceInterface::info(), info(), and Coal::Object::parent().

Referenced by Sampler().

cl_int Sampler::info ( cl_sampler_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
) const

Get information about the sampler.

This function is used to retrieve information about an object. Sometimes, the size of the data retrieved is unknown (for example, a string). The application can call this function twice, the first time to get the size, then it allocates a buffer, and finally get the data.

 const char *string = 0;
 size_t len;

 object->info(FOO_PROPERTY_STRING, 0, 0, &len);
 string = std::malloc(len);
 object->info(FOO_PROPERTY_STRING, len, string, 0);
Parameters:
param_nameName of the property to retrieve
param_value_sizeSize of the application-allocated buffer in which to put the value.
param_valuePointer to an application-allocated buffer where the property data will be stored. Ignored if NULL.
param_value_size_retSize of the value retrieved, ignored if NULL.
Returns:
CL_SUCCESS in case of success, otherwise a CL error code.

Definition at line 168 of file sampler.cpp.

References CLK_ADDRESS_CLAMP, CLK_ADDRESS_CLAMP_TO_EDGE, CLK_ADDRESS_MIRRORED_REPEAT, CLK_ADDRESS_MODE_MASK, CLK_ADDRESS_NONE, CLK_ADDRESS_REPEAT, CLK_FILTER_LINEAR, CLK_FILTER_MASK, CLK_FILTER_NEAREST, CLK_NORMALIZED_COORDS_MASK, p_bitfield, Coal::Object::parent(), Coal::Object::references(), and SIMPLE_ASSIGN.

Referenced by checkImageAvailability().


Member Data Documentation

unsigned int Coal::Sampler::p_bitfield [private]

Definition at line 105 of file sampler.h.

Referenced by bitfield(), info(), and Sampler().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines