![]() |
Clover Git
OpenCL 1.1 software implementation
|
#include <sampler.h>
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 |
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.
Sampler::Sampler | ( | Context * | ctx, |
cl_bool | normalized_coords, | ||
cl_addressing_mode | addressing_mode, | ||
cl_filter_mode | filter_mode, | ||
cl_int * | errcode_ret | ||
) |
Constructor.
ctx | parent Coal::Context |
normalized_coords | true if the coords given to the built-in image functions are normalized, false otherwise |
addressing_mode | addressing mode used to read images |
filter_mode | filter mode used to read images |
errcode_ret | return 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.
ctx | parent Coal::Context |
bitfield | bitfield already calculated |
Definition at line 101 of file sampler.cpp.
References checkImageAvailability().
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);
param_name | Name of the property to retrieve |
param_value_size | Size of the application-allocated buffer in which to put the value. |
param_value | Pointer to an application-allocated buffer where the property data will be stored. Ignored if NULL. |
param_value_size_ret | Size of the value retrieved, ignored if NULL. |
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().
unsigned int Coal::Sampler::p_bitfield [private] |
Definition at line 105 of file sampler.h.
Referenced by bitfield(), info(), and Sampler().