RAII wrapper for xvecExecutionContextTag.
More...
#include <xvec_context.hpp>
RAII wrapper for xvecExecutionContextTag.
Manages the lifetime of an execution context. The context is created in the constructor and destroyed in the destructor. Supports move semantics but not copying.
Destroy all index and buffer wrappers using this context before destroying it. See Index resource lifetime for device-memory ownership.
Definition at line 67 of file xvec_context.hpp.
◆ Context() [1/3]
| xvec::Context::Context |
( |
uint32_t |
deviceId | ) |
|
|
explicit |
Create an execution context using the embedded production kernel.
- Parameters
-
| deviceId | Target device identifier. |
- Exceptions
-
◆ ~Context()
| virtual xvec::Context::~Context |
( |
| ) |
|
|
virtual |
◆ Context() [2/3]
| xvec::Context::Context |
( |
Context && |
other | ) |
|
|
noexcept |
◆ Context() [3/3]
| xvec::Context::Context |
( |
const Context & |
| ) |
|
|
delete |
◆ getNumDevices()
| static uint32_t xvec::Context::getNumDevices |
( |
| ) |
|
|
static |
Get the number of available devices.
- Returns
- Number of devices.
- Exceptions
-
◆ getProperty()
| std::string xvec::Context::getProperty |
( |
const std::string & |
key | ) |
const |
Get a context property.
- Parameters
-
- Returns
- Property value.
- Exceptions
-
| xvec::Error | if the property does not exist or on failure. |
◆ handle()
| xvecExecutionContextTag* xvec::Context::handle |
( |
| ) |
const |
|
noexcept |
Get the underlying C API handle.
Use this to pass the context to C API functions that are not yet wrapped.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ resetVpe()
| void xvec::Context::resetVpe |
( |
| ) |
|
Reset the VPE SRAM allocator state.
Clears SRAM buffer allocation state across all subsystems. Must be called before executing kernels that use VpeContext.
- Exceptions
-
- Warning
- Must NOT be called while device kernels are actively using VpeContext.
◆ setProperty()
| void xvec::Context::setProperty |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
Set a context property.
- Parameters
-
| key | Property name. |
| value | Property value as a string. |
- Exceptions
-
◆ tryGetProperty()
| std::optional<std::string> xvec::Context::tryGetProperty |
( |
const std::string & |
key | ) |
const |
Try to get a context property.
- Parameters
-
- Returns
- Property value if found, std::nullopt otherwise.
- Exceptions
-
The documentation for this class was generated from the following file: