xpu
xpu::settings Struct Reference

Settings used to initialize xpu. More...

Public Attributes

std::string device = "cpu"
 Select the default device to use. Values must have the form "`<driver><devicenr>`". If devicenr is missing, defaults to device 0 of selected driver. Possible values are for example: cpu, cuda0, cuda1, hip0, sycl1. Value may be overwritten by setting environment variable XPU_DEVICE. More...
 
bool verbose = false
 Enable internal logging. Display information about device operations like memory allocation, kernel launches, memory transfers. This is useful for debugging. Value may be overwritten by setting environment variable XPU_VERBOSE. See also 'logging_sink' field for customizing the output. More...
 
std::function< void(std::string_view)> logging_sink
 Set a custom logging sink. By default messages are written to stderr. Has no effect if 'verbose' is false. More...
 
bool profile = false
 Enable profiling of kernels. Value may be overwritten by setting environment variable XPU_PROFILE. More...
 
std::vector< driver_texcluded_backends = {}
 Backends that should be excluded. More...
 

Detailed Description

Settings used to initialize xpu.

Member Data Documentation

◆ device

std::string xpu::settings::device = "cpu"

Select the default device to use. Values must have the form "`<driver><devicenr>`". If devicenr is missing, defaults to device 0 of selected driver. Possible values are for example: cpu, cuda0, cuda1, hip0, sycl1. Value may be overwritten by setting environment variable XPU_DEVICE.

◆ excluded_backends

std::vector<driver_t> xpu::settings::excluded_backends = {}

Backends that should be excluded.

Note
CPU backend is always enabled and can't be disabled.

◆ logging_sink

std::function<void(std::string_view)> xpu::settings::logging_sink
Initial value:
= [](std::string_view msg) {
std::fwrite(msg.data(), 1, msg.size(), stderr);
std::fputc('\n', stderr);
}

Set a custom logging sink. By default messages are written to stderr. Has no effect if 'verbose' is false.

◆ profile

bool xpu::settings::profile = false

Enable profiling of kernels. Value may be overwritten by setting environment variable XPU_PROFILE.

See also
xpu::timings

◆ verbose

bool xpu::settings::verbose = false

Enable internal logging. Display information about device operations like memory allocation, kernel launches, memory transfers. This is useful for debugging. Value may be overwritten by setting environment variable XPU_VERBOSE. See also 'logging_sink' field for customizing the output.


The documentation for this struct was generated from the following file: