module CooCoo::CUDA

Constants

TYPE_CONVERTOR
TYPE_GETTER
TYPE_WRITER

Public Class Methods

available?() click to toggle source
# File lib/coo-coo/cuda.rb, line 7
def self.available?
  ENV["COOCOO_USE_CUDA"] != "0"# && Runtime.device_count > 0
end
collect_garbage(size = nil) click to toggle source
# File lib/coo-coo/cuda.rb, line 15
def self.collect_garbage(size = nil)
  free, total = memory_info
  if size == nil || (3 * size + free) >= total
    GC.start
    new_free, total = memory_info
    diff = free - new_free
    if size && (size + new_free) >= total
      raise NoMemoryError.new(size)
    end
  end
end
memory_info() click to toggle source
# File lib/coo-coo/cuda.rb, line 11
def self.memory_info
  Runtime.memory_info
end