Sha256: 1bd9bad67fc7857fc69eb69926908dbaefa397c0a20e00ed66365b7dd2fa4193

Contents?: true

Size: 969 Bytes

Versions: 42

Compression:

Stored size: 969 Bytes

Contents

# dependencies
require "ffi"

# modules
require "onnxruntime/datasets"
require "onnxruntime/inference_session"
require "onnxruntime/model"
require "onnxruntime/utils"
require "onnxruntime/version"

module OnnxRuntime
  class Error < StandardError; end

  class << self
    attr_accessor :ffi_lib
  end
  lib_name =
    if Gem.win_platform?
      "onnxruntime.dll"
    elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
      if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
        "libonnxruntime.arm64.dylib"
      else
        "libonnxruntime.dylib"
      end
    else
      if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
        "libonnxruntime.arm64.so"
      else
        "libonnxruntime.so"
      end
    end
  vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__)
  self.ffi_lib = [vendor_lib]

  def self.lib_version
    FFI.OrtGetApiBase[:GetVersionString].call.read_string
  end

  # friendlier error message
  autoload :FFI, "onnxruntime/ffi"
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
onnxruntime-0.7.3-x64-mingw lib/onnxruntime.rb
onnxruntime-0.7.3-arm64-darwin lib/onnxruntime.rb
onnxruntime-0.7.3-aarch64-linux lib/onnxruntime.rb
onnxruntime-0.7.3 lib/onnxruntime.rb
onnxruntime-0.7.2-x86_64-linux lib/onnxruntime.rb
onnxruntime-0.7.2-x86_64-darwin lib/onnxruntime.rb
onnxruntime-0.7.2-x64-mingw lib/onnxruntime.rb
onnxruntime-0.7.2-arm64-darwin lib/onnxruntime.rb
onnxruntime-0.7.2-aarch64-linux lib/onnxruntime.rb
onnxruntime-0.7.2 lib/onnxruntime.rb
onnxruntime-0.7.1-x86_64-linux lib/onnxruntime.rb
onnxruntime-0.7.1-x86_64-darwin lib/onnxruntime.rb
onnxruntime-0.7.1-x64-mingw lib/onnxruntime.rb
onnxruntime-0.7.1-arm64-darwin lib/onnxruntime.rb
onnxruntime-0.7.1-aarch64-linux lib/onnxruntime.rb
onnxruntime-0.7.1 lib/onnxruntime.rb
onnxruntime-0.7.0-x86_64-linux lib/onnxruntime.rb
onnxruntime-0.7.0-x86_64-darwin lib/onnxruntime.rb
onnxruntime-0.7.0-x64-mingw lib/onnxruntime.rb
onnxruntime-0.7.0-arm64-darwin lib/onnxruntime.rb