cl::sycl::context Class Reference
Interface for abstracting and interacting with an underlying cl_context object. More...
#include <context.h>
Public Member Functions | |
context (const property_list &propList={}) | |
Constructs a host context. More... | |
context (async_handler asyncHandler, const property_list &propList={}) | |
Constructs a context object in host mode. More... | |
context (cl_context clContext, async_handler asyncHandler=nullptr) | |
Constructs a context object using a cl_context object. More... | |
COMPUTECPP_DEPRECATED_BY_SYCL_VER (201703, "OpenGL interop is no longer available.") context(const device_selector &deviceSelector | |
Constructs a context object using a device_selector object. More... | |
context (const device &dev, const property_list &propList={}) | |
Constructs a context using the provided device. More... | |
context (const device &dev, async_handler asyncHandler, const property_list &propList={}) | |
Constructs a context object using a device object. More... | |
context (const platform &plt, const property_list &propList={}) | |
Constructs a context using devices available on the provided platform. More... | |
context (const platform &plt, async_handler asyncHandler, const property_list &propList={}) | |
Constructs a context object using a platform object. More... | |
context (const vector_class< device > &deviceList, const property_list &propList={}) | |
Constructs a context using a list of devices. More... | |
context (const vector_class< device > &deviceList, async_handler asyncHandler, const property_list &propList={}) | |
Constructs a context object using a vector_class of device objects. More... | |
context (const context &rhs)=default | |
Constructs a context object from another device object and retains the cl_context object if the context is not in host mode. More... | |
context (context &&rhs)=default | |
Constructs a context object by moving another device object. More... | |
context & | operator= (const context &rhs)=default |
Completely assigns the contents of the context to that of another and retains the cl_context object if the context is not in host mode. More... | |
context & | operator= (context &&rhs)=default |
Completely moves the contents of the context to that of another. More... | |
COMPUTECPP_TEST_VIRTUAL | ~context ()=default |
Destroys the implementation object. More... | |
COMPUTECPP_TEST_VIRTUAL cl_context | get () const |
Returns the underlying cl_context object. More... | |
COMPUTECPP_TEST_VIRTUAL bool | is_host () const |
Specifies whether the context is in host mode. More... | |
template<info::context param> | |
COMPUTECPP_EXPORT info::param_traits< info::context, param >::return_type | get_info () const |
Gets OpenCL information for the underlying cl_context. More... | |
COMPUTECPP_TEST_VIRTUAL platform | get_platform () const |
Retrieves the platform associated with this context. More... | |
COMPUTECPP_TEST_VIRTUAL vector_class< cl::sycl::device > | get_devices () const |
Returns the list of devices from the current context. More... | |
dcontext_shptr | get_impl () const |
Returns an opaque pointer to the implementation object. More... | |
context (cl::sycl::detail::context *detail) | |
context (dcontext_shptr detail) | |
Public Attributes | |
info::gl_context_interop | interopFlag |
info::gl_context_interop async_handler | asyncHandler = nullptr) |
Protected Attributes | |
dcontext_shptr | m_impl |
Implementation of the context. More... | |
Friends | |
bool | operator== (const context &lhs, const context &rhs) |
Determines if lhs and rhs are equal. More... | |
bool | operator!= (const context &lhs, const context &rhs) |
Determines if lhs and rhs are not equal. More... | |
Detailed Description
Interface for abstracting and interacting with an underlying cl_context object.
Constructor & Destructor Documentation
◆ context() [1/13]
|
explicit |
Constructs a host context.
- Parameters
-
propList Additional properties
◆ context() [2/13]
|
explicit |
Constructs a context object in host mode.
- Parameters
-
asyncHandler Handler for asynchronous exceptions propList Additional properties
◆ context() [3/13]
|
explicit |
Constructs a context object using a cl_context object.
- Parameters
-
clContext A cl_context object. asyncHandler Handler for asynchronous exceptions
◆ context() [4/13]
cl::sycl::context::context | ( | const device & | dev, |
const property_list & | propList = {} |
||
) |
Constructs a context using the provided device.
- Parameters
-
dev Device to associate with the context propList Additional properties
◆ context() [5/13]
cl::sycl::context::context | ( | const device & | dev, |
async_handler | asyncHandler, | ||
const property_list & | propList = {} |
||
) |
Constructs a context object using a device object.
The context is constructed with the device object provided.
- Parameters
-
dev Device to associate with the context asyncHandler Handler for asynchronous exceptions propList Additional properties
◆ context() [6/13]
cl::sycl::context::context | ( | const platform & | plt, |
const property_list & | propList = {} |
||
) |
Constructs a context using devices available on the provided platform.
- Parameters
-
plt Platform containing devices to associate with the context propList Additional properties
◆ context() [7/13]
cl::sycl::context::context | ( | const platform & | plt, |
async_handler | asyncHandler, | ||
const property_list & | propList = {} |
||
) |
Constructs a context object using a platform object.
The context is constructed with all the devices available under the platform object provided.
- Parameters
-
plt Platform containing devices to associate with the context asyncHandler Handler for asynchronous exceptions propList Additional properties
◆ context() [8/13]
cl::sycl::context::context | ( | const vector_class< device > & | deviceList, |
const property_list & | propList = {} |
||
) |
Constructs a context using a list of devices.
- Parameters
-
deviceList List of devices to associate with the context propList Additional properties
◆ context() [9/13]
cl::sycl::context::context | ( | const vector_class< device > & | deviceList, |
async_handler | asyncHandler, | ||
const property_list & | propList = {} |
||
) |
Constructs a context object using a vector_class of device objects.
The context is constructed with the devices provided.
- Parameters
-
deviceList A vector_class of device objects. asyncHandler Handler for asynchronous exceptions propList Additional properties
◆ context() [10/13]
|
default |
Constructs a context object from another device object and retains the cl_context object if the context is not in host mode.
◆ context() [11/13]
|
default |
Constructs a context object by moving another device object.
◆ ~context()
|
default |
Destroys the implementation object.
◆ context() [12/13]
|
explicit |
◆ context() [13/13]
|
explicit |
Member Function Documentation
◆ COMPUTECPP_DEPRECATED_BY_SYCL_VER()
cl::sycl::context::COMPUTECPP_DEPRECATED_BY_SYCL_VER | ( | 201703 | , |
"OpenGL interop is no longer available." | |||
) | const & |
Constructs a context object using a device_selector object.
The context is constructed with a single device retrieved from the device_selector object provided.
- Parameters
-
deviceSelector A reference to a device_selector object. interopFlag Specify whether to use the context for OpenGL interop. asyncHandler An optional parameter to specify the async_handler associated with the context.
- Deprecated:
- OpenGL interop no longer supported in SYCL 1.2.1
◆ get()
COMPUTECPP_TEST_VIRTUAL cl_context cl::sycl::context::get | ( | ) | const |
Returns the underlying cl_context object.
- Returns
- The cl_context object.
◆ get_devices()
COMPUTECPP_TEST_VIRTUAL vector_class<cl::sycl::device> cl::sycl::context::get_devices | ( | ) | const |
Returns the list of devices from the current context.
◆ get_impl()
dcontext_shptr cl::sycl::context::get_impl | ( | ) | const |
Returns an opaque pointer to the implementation object.
- Returns
- A pointer to the implementation object.
◆ get_info()
COMPUTECPP_EXPORT info::param_traits<info::context, param>::return_type cl::sycl::context::get_info | ( | ) | const |
Gets OpenCL information for the underlying cl_context.
- Template Parameters
-
param A cl_int specifying the info parameter.
- Returns
- The retrieved information as the appropriate return type, derived via the get_sycl_info function, defined in info.h.
◆ get_platform()
COMPUTECPP_TEST_VIRTUAL platform cl::sycl::context::get_platform | ( | ) | const |
Retrieves the platform associated with this context.
- Returns
- SYCL platform associated with this context
◆ is_host()
COMPUTECPP_TEST_VIRTUAL bool cl::sycl::context::is_host | ( | ) | const |
Specifies whether the context is in host mode.
- Returns
- A boolean specifying whether the context is in host mode.
◆ operator=() [1/2]
Completely assigns the contents of the context to that of another and retains the cl_context object if the context is not in host mode.
◆ operator=() [2/2]
Completely moves the contents of the context to that of another.
Friends And Related Function Documentation
◆ operator!=
◆ operator==
Member Data Documentation
◆ asyncHandler
info::gl_context_interop async_handler cl::sycl::context::asyncHandler = nullptr) |
◆ interopFlag
info::gl_context_interop cl::sycl::context::interopFlag |
◆ m_impl
|
protected |
The documentation for this class was generated from the following file: