Exception: Cumo::CUDA::CompileError
- Inherits:
-
StandardError
- Object
- StandardError
- Cumo::CUDA::CompileError
- Defined in:
- lib/cumo/cuda/compile_error.rb
Instance Method Summary collapse
- #dump(io) ⇒ Object
-
#initialize(msg, source, name, options) ⇒ CompileError
constructor
A new instance of CompileError.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(msg, source, name, options) ⇒ CompileError
Returns a new instance of CompileError.
5 6 7 8 9 10 |
# File 'lib/cumo/cuda/compile_error.rb', line 5 def initialize(msg, source, name, ) @msg = msg @source = source @name = name @options = end |
Instance Method Details
#dump(io) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/cumo/cuda/compile_error.rb', line 20 def dump(io) lines = @source.split("\n") digits = Math.log10(lines.size).floor + 1 linum_fmt = "%0#{digits}d " io.puts("NVRTC compilation error: #{@msg}") io.puts("-----") io.puts("Name: #{@name}") io.puts("Options: #{@options.join(' ')}") io.puts("CUDA source:") lines.each.with_index do |line, i| io.puts(linum_fmt.sprintf(i + 1) << line.rstrip) end io.puts("-----") io.flush end |
#message ⇒ Object
12 13 14 |
# File 'lib/cumo/cuda/compile_error.rb', line 12 def @msg end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/cumo/cuda/compile_error.rb', line 16 def to_s @msg end |