Converts data for transmission to OpenCL device. More...
#include <opencl_converter.h>
Public Types | |
| typedef t_Type::OpenCLType | Type |
Static Public Member Functions | |
| static Type | Convert (t_Type const &source) |
Converts data for transmission to OpenCL device.
| t_Type | Host type from which to convert. |
This class, and its specializations, are inspired by the way that boost::serialization works. Every convertable host type has two associated pieces of information: the OpenCL type to which it converts (stored in the Type typedef), and a function for actually performing the conversion (the Convert static function).
The default specialization of this class maps t_Type::OpenCLType to Type, and t_Type::OpenCLConvert to Convert. Hence, if you don't want to explicitly specialize this class for your type, you can instead add these two members, and they'll be used automatically.
This class is primarily used by Synchronized::Heap and Synchronized::TextureHeap, which keep the host state synchronized with OpenCL by, for every convertable object on the host, allocating a corresponding block of memory on the OpenCL device, and using this class to convert objects before transferring them over, whenever the host object changes.
Definition at line 77 of file opencl_converter.h.
1.8.1.2