cyborg::Client class manages storage configurations and acts as a factory for creating or loading encrypted indexes.
Constructor
Client.
Parameters
| Parameter | Type | Description |
|---|---|---|
api_key | std::string | API key for your CyborgDB account. |
index_location | DBConfig | Configuration for index storage location. |
config_location | DBConfig | Configuration for index metadata storage. |
items_location | DBConfig | Configuration intended to be used in a future release. Pass in a DBConfig with a Location of ‘None’. |
cpu_threads | int | Number of CPU threads to use (e.g., 0 to use all available cores). |
gpu_config | GPUConfig | GPU operations configuration (requires CUDA). Use bitflags: kNone (no GPU), kUpsert (GPU for upsert), kTrain (GPU for training), kQuery (GPU for query), or kAll (GPU for all operations). Combine with | operator. |
Exceptions
std::invalid_argument
std::invalid_argument
- Throws if the
cpu_threadsparameter is less than0. - Throws if any
DBConfigis invalid. - Throws if the GPU is not available when
gpu_accelerateistrue.
std::runtime_error
std::runtime_error
- Throws if the backing store is not available.
- Throws if the Client could not be initialized.
Example Usage
Methods
cpu_threads()
int - The number of CPU threads.
Example:
gpu_accelerate()
bool - true if GPU is enabled for any operation, false otherwise.
Example:
gpu_config()
GPUConfig - The GPU operations configuration.
Example: