Class Context¶
Defined in File context.hpp
Class Documentation¶
-
class
legion::core::compute
::
Context
¶ Wraps a cl_context in a neater interface.
Public Static Functions
-
static void
init
()¶ Initializes the OpenCL context.
- Pre
initialized
-
static bool
initialized
()¶ Checks if the OpenCL context is initialized.
-
static Program
createProgram
(const filesystem::basic_resource &resource)¶ Creates a Program from a basic resource (can be file or buffer).
- Return
A Program Object that supports execution
- Parameters
resource
: The Buffer you want to create the Program from You can for instance use fs::view.get()
-
template<class
T
>
static inline BuffercreateBuffer
(std::vector<T> &container, buffer_type type, std::string name = "")¶ Creates an OpenCL Native Buffer (GPU or similar) with a host buffer.
-
static inline Buffer
createBuffer
(byte *data, size_type size, buffer_type type, std::string name = "")¶
-
static inline Buffer
createImage
(image &img, buffer_type type, std::string name = "")¶
-
static inline Buffer
createImageFromOpenGLImage
(uint target, uint texture, buffer_type type, std::string name = "", uint mip_level = 0)¶
-
static inline Buffer
createImageFromOpenGLBuffer
(uint bufferid, buffer_type type, std::string name = "")¶
-
static inline Buffer
createImageFromOpenGLRenderBuffer
(uint bufferid, buffer_type type, std::string name = "")¶
-
static inline cl_device_id
getDeviceId
()¶ Returns the OpenCL device-id associated with this context.
-
static void