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.6-x86_64-linux lib/onnxruntime.rb
onnxruntime-0.7.6-x86_64-darwin lib/onnxruntime.rb
onnxruntime-0.7.6-x64-mingw lib/onnxruntime.rb
onnxruntime-0.7.6-arm64-darwin lib/onnxruntime.rb
onnxruntime-0.7.6-aarch64-linux lib/onnxruntime.rb
onnxruntime-0.7.6 lib/onnxruntime.rb
onnxruntime-0.7.5-x86_64-linux lib/onnxruntime.rb
onnxruntime-0.7.5-x86_64-darwin lib/onnxruntime.rb
onnxruntime-0.7.5-x64-mingw lib/onnxruntime.rb
onnxruntime-0.7.5-arm64-darwin lib/onnxruntime.rb
onnxruntime-0.7.5-aarch64-linux lib/onnxruntime.rb
onnxruntime-0.7.5 lib/onnxruntime.rb
onnxruntime-0.7.4-x86_64-linux lib/onnxruntime.rb
onnxruntime-0.7.4-x86_64-darwin lib/onnxruntime.rb
onnxruntime-0.7.4-x64-mingw lib/onnxruntime.rb
onnxruntime-0.7.4-arm64-darwin lib/onnxruntime.rb
onnxruntime-0.7.4-aarch64-linux lib/onnxruntime.rb
onnxruntime-0.7.4 lib/onnxruntime.rb
onnxruntime-0.7.3-x86_64-linux lib/onnxruntime.rb
onnxruntime-0.7.3-x86_64-darwin lib/onnxruntime.rb