Method: Sycl::Array.from_array

Defined in:
lib/sycl.rb

.from_array(array) ⇒ Object

Create a Sycl::Array from a normal Array, or, really, any object that supports Enumerable#each(). Every child Array or Hash gets promoted to a Sycl::Array or Sycl::Hash.



153
154
155
156
157
# File 'lib/sycl.rb', line 153

def self.from_array(array)  # :nodoc:
  retval = Sycl::Array.new
  array.each { |e| retval << Sycl::from_object(e) }
  retval
end