Sha256: e70f598352b4718d29e86bcdf77e573aacbe92cd79386563da4fe72654929aed

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

# frozen-string-literal: true

require 'numo/narray'
require 'numo/linalg/linalg'
require 'numo/openblas/version'

module Numo
  module Linalg
    module Loader
      module_function

      def load_openblas
        dlext = case RbConfig::CONFIG['host_os']
                when /mswin|msys|mingw|cygwin/
                  'dll'
                when /darwin|mac os/
                  'dylib'
                else
                  'so'
                end
        openblas_path = File.expand_path(__dir__ + "/../../vendor/lib/libopenblas.#{dlext}")
        Numo::Linalg::Blas.dlopen(openblas_path)
        Numo::Linalg::Lapack.dlopen(openblas_path)
        @@libs = [openblas_path]
      end
    end
  end
end

Numo::Linalg::Loader.load_openblas

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
numo-openblas-0.1.1 lib/numo/openblas.rb