Exception: Ignis::CuSolverError

Inherits:
CudaError show all
Defined in:
lib/nvruby/errors.rb

Overview

Raised when cuSOLVER operation fails

Constant Summary collapse

STATUSES =
{
  0  => :success,
  1  => :not_initialized,
  2  => :alloc_failed,
  3  => :invalid_value,
  4  => :arch_mismatch,
  5  => :mapping_error,
  6  => :execution_failed,
  7  => :internal_error,
  8  => :matrix_type_not_supported,
  9  => :not_supported,
  10 => :zero_pivot,
  11 => :invalid_license,
  12 => :irs_params_not_initialized,
  13 => :irs_params_invalid,
  14 => :irs_params_invalid_prec,
  15 => :irs_params_invalid_refine,
  16 => :irs_params_invalid_maxiter,
  20 => :irs_internal_error,
  21 => :irs_not_supported,
  22 => :irs_out_of_range,
  23 => :irs_nrhs_not_supported_for_refine_gmres,
  25 => :irs_infos_not_initialized
}.freeze

Instance Attribute Summary collapse

Attributes inherited from CudaError

#cuda_code

Instance Method Summary collapse

Constructor Details

#initialize(message, cusolver_code: nil, context: nil) ⇒ CuSolverError

Returns a new instance of CuSolverError.

Parameters:

  • message (String)

    Error message

  • cusolver_code (Integer, nil) (defaults to: nil)

    cuSOLVER status code

  • context (String, nil) (defaults to: nil)

    Context for error



156
157
158
159
160
161
162
163
164
165
# File 'lib/nvruby/errors.rb', line 156

def initialize(message, cusolver_code: nil, context: nil)
  @context = context
  status_name = cusolver_code ? (STATUSES[cusolver_code] || :unknown) : nil

  full_message = message
  full_message = "#{context}: #{full_message}" if context
  full_message = "#{full_message} (#{status_name})" if status_name

  super(full_message, cuda_code: cusolver_code)
end

Instance Attribute Details

#contextString? (readonly)

Returns Context where error occurred.

Returns:

  • (String, nil)

    Context where error occurred



151
152
153
# File 'lib/nvruby/errors.rb', line 151

def context
  @context
end