Sha256: 6a528bab790db1e87f38846cf679633073f020e41b320ee2f2a1a3c8f10f2f9b

Contents?: true

Size: 778 Bytes

Versions: 3

Compression:

Stored size: 778 Bytes

Contents

# frozen-string-literal: true

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

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

3 entries across 3 versions & 1 rubygems

Version Path
numo-openblas-0.2.2 lib/numo/openblas.rb
numo-openblas-0.2.1 lib/numo/openblas.rb
numo-openblas-0.2.0 lib/numo/openblas.rb