Builder class for constructing std::shared_ptr<ucxx::Worker> objects.
More...
#include <worker_builder.h>
Public Member Functions | |
| WorkerBuilder (std::shared_ptr< Context > context) | |
Constructor for WorkerBuilder with required context. More... | |
| ~WorkerBuilder () | |
WorkerBuilder destructor. | |
| WorkerBuilder (const WorkerBuilder &other) | |
| Copy constructor (deep-copies internal state). | |
| WorkerBuilder & | operator= (const WorkerBuilder &other) |
| Copy assignment operator (deep-copies internal state). | |
| WorkerBuilder (WorkerBuilder &&) noexcept | |
| Move constructor. | |
| WorkerBuilder & | operator= (WorkerBuilder &&) noexcept |
| Move assignment operator. | |
| operator std::shared_ptr< Worker > () const | |
Implicit conversion operator to shared_ptr<Worker>. More... | |
| WorkerBuilder & | delayedSubmission (bool enable=true) |
| Configure delayed submission to the progress thread. More... | |
| WorkerBuilder & | pythonFuture (bool enable=true) |
| Configure Python future support. More... | |
| WorkerBuilder & | requestAttributes (bool enable=true) |
| Configure request attributes querying. More... | |
| WorkerBuilder & | cudaBufferType (BufferType bufferType) |
| Configure the preferred buffer type for CUDA allocations. More... | |
| std::shared_ptr< Worker > | build () const |
Build and return the Worker. More... | |
Builder class for constructing std::shared_ptr<ucxx::Worker> objects.
This class implements the builder pattern for std::shared_ptr<ucxx::Worker>, allowing optional parameters to be specified via method chaining. Construction happens when the builder expression completes (via implicit conversion) or when build() is called.
The context is required and must be provided to createWorker(). The enableDelayedSubmission() and enableFuture() methods are optional.
|
explicit |
Constructor for WorkerBuilder with required context.
| [in] | context | context from which the worker will be created (required). |
| std::shared_ptr<Worker> ucxx::experimental::WorkerBuilder::build | ( | ) | const |
Build and return the Worker.
This method constructs the Worker with the specified parameters and returns it. Each call to build() creates a new Worker instance with the current parameters.
shared_ptr<ucxx::Worker> object. | WorkerBuilder& ucxx::experimental::WorkerBuilder::cudaBufferType | ( | BufferType | bufferType | ) |
Configure the preferred buffer type for CUDA allocations.
| [in] | bufferType | the preferred buffer type for CUDA allocations. |
| WorkerBuilder& ucxx::experimental::WorkerBuilder::delayedSubmission | ( | bool | enable = true | ) |
Configure delayed submission to the progress thread.
| [in] | enable | whether delayed submission is enabled (default: true). |
| ucxx::experimental::WorkerBuilder::operator std::shared_ptr< Worker > | ( | ) | const |
Implicit conversion operator to shared_ptr<Worker>.
Enables automatic construction of the Worker when the builder is used in a context requiring a shared_ptr<Worker>, delegating to build().
shared_ptr<ucxx::Worker> object. | WorkerBuilder& ucxx::experimental::WorkerBuilder::pythonFuture | ( | bool | enable = true | ) |
Configure Python future support.
| [in] | enable | whether Python futures are enabled (default: true). |
| WorkerBuilder& ucxx::experimental::WorkerBuilder::requestAttributes | ( | bool | enable = true | ) |
Configure request attributes querying.
When enabled, each ucxx::Request created from the worker will have its UCP attributes (such as the debug string) queried immediately after submission, making them available via ucxx::Request::getRequestAttributes(). This may have non-negligible runtime cost and is therefore disabled by default.
| [in] | enable | whether request attributes querying is enabled (default: true). |