pub enum GpuError {
Show 22 variants
NoAdapter {
backends: String,
},
DeviceRequest {
reason: String,
},
DeviceLost {
reason: String,
},
OutOfMemory {
requested: u64,
available: u64,
},
InvalidBuffer {
reason: String,
},
ShaderCompilation {
message: String,
},
ShaderValidation {
message: String,
},
PipelineCreation {
reason: String,
},
BindGroupCreation {
reason: String,
},
BufferMapping {
reason: String,
},
ExecutionTimeout {
seconds: u64,
},
ExecutionFailed {
reason: String,
},
InvalidWorkgroupSize {
actual: u32,
max: u32,
},
IncompatibleTypes {
expected: String,
actual: String,
},
InvalidKernelParams {
reason: String,
},
DimensionMismatch {
expected_width: u32,
expected_height: u32,
actual_width: u32,
actual_height: u32,
},
UnsupportedOperation {
operation: String,
},
BackendNotAvailable {
backend: String,
},
Core(OxiGdalError),
Io(Error),
TaskJoin(String),
Internal(String),
}Expand description
Errors that can occur during GPU operations.
Variants§
NoAdapter
No suitable GPU adapter found.
DeviceRequest
Failed to request GPU device.
DeviceLost
GPU device lost or disconnected.
OutOfMemory
Out of GPU memory.
InvalidBuffer
Invalid buffer size or alignment.
ShaderCompilation
Shader compilation error.
ShaderValidation
Shader validation error.
PipelineCreation
Compute pipeline creation error.
BindGroupCreation
Bind group creation error.
BufferMapping
Buffer mapping error.
ExecutionTimeout
Compute execution timeout.
ExecutionFailed
Compute execution error.
InvalidWorkgroupSize
Invalid workgroup size.
IncompatibleTypes
Incompatible data types.
InvalidKernelParams
Invalid kernel parameters.
DimensionMismatch
Raster dimension mismatch.
UnsupportedOperation
Unsupported operation on current GPU.
BackendNotAvailable
Backend not available.
Core(OxiGdalError)
Core library error.
Io(Error)
IO error during GPU operations.
TaskJoin(String)
Async task join error.
Internal(String)
Internal error (should not happen).
Implementations§
Source§impl GpuError
impl GpuError
Sourcepub fn no_adapter(backends: impl Into<String>) -> Self
pub fn no_adapter(backends: impl Into<String>) -> Self
Create a new adapter not found error.
Sourcepub fn device_request(reason: impl Into<String>) -> Self
pub fn device_request(reason: impl Into<String>) -> Self
Create a new device request error.
Sourcepub fn device_lost(reason: impl Into<String>) -> Self
pub fn device_lost(reason: impl Into<String>) -> Self
Create a new device lost error.
Sourcepub fn out_of_memory(requested: u64, available: u64) -> Self
pub fn out_of_memory(requested: u64, available: u64) -> Self
Create a new out of memory error.
Sourcepub fn invalid_buffer(reason: impl Into<String>) -> Self
pub fn invalid_buffer(reason: impl Into<String>) -> Self
Create a new invalid buffer error.
Sourcepub fn shader_compilation(message: impl Into<String>) -> Self
pub fn shader_compilation(message: impl Into<String>) -> Self
Create a new shader compilation error.
Sourcepub fn shader_validation(message: impl Into<String>) -> Self
pub fn shader_validation(message: impl Into<String>) -> Self
Create a new shader validation error.
Sourcepub fn pipeline_creation(reason: impl Into<String>) -> Self
pub fn pipeline_creation(reason: impl Into<String>) -> Self
Create a new pipeline creation error.
Sourcepub fn bind_group_creation(reason: impl Into<String>) -> Self
pub fn bind_group_creation(reason: impl Into<String>) -> Self
Create a new bind group creation error.
Sourcepub fn buffer_mapping(reason: impl Into<String>) -> Self
pub fn buffer_mapping(reason: impl Into<String>) -> Self
Create a new buffer mapping error.
Sourcepub fn execution_timeout(seconds: u64) -> Self
pub fn execution_timeout(seconds: u64) -> Self
Create a new execution timeout error.
Sourcepub fn execution_failed(reason: impl Into<String>) -> Self
pub fn execution_failed(reason: impl Into<String>) -> Self
Create a new execution failed error.
Sourcepub fn invalid_workgroup_size(actual: u32, max: u32) -> Self
pub fn invalid_workgroup_size(actual: u32, max: u32) -> Self
Create a new invalid workgroup size error.
Sourcepub fn incompatible_types(
expected: impl Into<String>,
actual: impl Into<String>,
) -> Self
pub fn incompatible_types( expected: impl Into<String>, actual: impl Into<String>, ) -> Self
Create a new incompatible types error.
Sourcepub fn invalid_kernel_params(reason: impl Into<String>) -> Self
pub fn invalid_kernel_params(reason: impl Into<String>) -> Self
Create a new invalid kernel parameters error.
Sourcepub fn dimension_mismatch(
expected_width: u32,
expected_height: u32,
actual_width: u32,
actual_height: u32,
) -> Self
pub fn dimension_mismatch( expected_width: u32, expected_height: u32, actual_width: u32, actual_height: u32, ) -> Self
Create a new dimension mismatch error.
Sourcepub fn unsupported_operation(operation: impl Into<String>) -> Self
pub fn unsupported_operation(operation: impl Into<String>) -> Self
Create a new unsupported operation error.
Sourcepub fn backend_not_available(backend: impl Into<String>) -> Self
pub fn backend_not_available(backend: impl Into<String>) -> Self
Create a new backend not available error.
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable.
Sourcepub fn should_fallback_to_cpu(&self) -> bool
pub fn should_fallback_to_cpu(&self) -> bool
Check if this error suggests falling back to CPU.