Sha256: 12ded421ab74a63d3fe20d2df91bc4dc0f349b4cf224ea5b2d8353c2e017d9ae

Contents?: true

Size: 772 Bytes

Versions: 20

Compression:

Stored size: 772 Bytes

Contents

require_relative '../cuda'

module Cumo::CUDA
  class CompileError < StandardError
    def initialize(msg, source, name, options)
      @msg = msg
      @source = source
      @name = name
      @options = options
    end

    def message
      @msg
    end

    def to_s
      @msg
    end

    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
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cumo-0.4.3 lib/cumo/cuda/compile_error.rb
cumo-0.4.2 lib/cumo/cuda/compile_error.rb
cumo-0.4.1 lib/cumo/cuda/compile_error.rb
cumo-0.4.0 lib/cumo/cuda/compile_error.rb
cumo-0.3.5 lib/cumo/cuda/compile_error.rb
cumo-0.3.4 lib/cumo/cuda/compile_error.rb
cumo-0.3.3 lib/cumo/cuda/compile_error.rb
cumo-0.3.2 lib/cumo/cuda/compile_error.rb
cumo-0.3.1 lib/cumo/cuda/compile_error.rb
cumo-0.3.0 lib/cumo/cuda/compile_error.rb
cumo-0.3.0.pre1 lib/cumo/cuda/compile_error.rb
cumo-0.2.5 lib/cumo/cuda/compile_error.rb
cumo-0.2.4 lib/cumo/cuda/compile_error.rb
cumo-0.2.3 lib/cumo/cuda/compile_error.rb
cumo-0.2.2 lib/cumo/cuda/compile_error.rb
cumo-0.2.1 lib/cumo/cuda/compile_error.rb
cumo-0.2.0 lib/cumo/cuda/compile_error.rb
cumo-0.1.2 lib/cumo/cuda/compile_error.rb
cumo-0.1.1 lib/cumo/cuda/compile_error.rb
cumo-0.1.0 lib/cumo/cuda/compile_error.rb