lib/opencl_ruby_ffi/Program.rb
def binaries
      sizes = self.binary_sizes
      bin_array = MemoryPointer::new( :pointer, sizes.length )
      total_size = 0
      pointers = []
      sizes.each_with_index { |s, i|
        total_size += s
        pointers[i] = MemoryPointer::new(s)
        bin_array[i].write_pointer(pointers[i])
      }
      error = OpenCL.clGetProgramInfo(self, BINARIES, total_size, bin_array, nil)
      error_check(error)
      bins = []
      devs = self.devices
      sizes.each_with_index { |s, i|
        bins.push [devs[i], pointers[i].read_bytes(s)]
      }
      return bins
    end
# Returns the binaries associated to the Program for each Device. Returns an Array of tuple [ Device, String ]
Returns the binaries associated to the Program for each Device. Returns an Array of tuple [ Device, String ]
Returns the binaries associated to the Program for each Device . Returns an Array of tuple [ Device String ]
def binaries
      sizes = self.binary_sizes
      bin_array = MemoryPointer::new( :pointer, sizes.length )
      total_size = 0
      pointers = []
      sizes.each_with_index { |s, i|
        total_size += s
        pointers[i] = MemoryPointer::new(s)
        bin_array[i].write_pointer(pointers[i])
      }
      error = OpenCL.clGetProgramInfo(self, BINARIES, total_size, bin_array, nil)
      error_check(error)
      bins = []
      devs = self.devices
      sizes.each_with_index { |s, i|
        bins.push [devs[i], pointers[i].read_bytes(s)]
      }
      return bins
    end
def binaries sizes = self . binary_sizes bin_array = MemoryPointer :: new ( :pointer , sizes . length ) total_size = 0 pointers = [ ] sizes . each_with_index { | s , i | total_size += s pointers [ i ] = MemoryPointer :: new ( s ) bin_array [ i ] . write_pointer ( pointers [ i ] ) } error = OpenCL . clGetProgramInfo ( self , BINARIES , total_size , bin_array , nil ) error_check ( error ) bins = [ ] devs = self . devices sizes . each_with_index { | s , i | bins . push [ devs [ i ] , pointers [ i ] . read_bytes ( s ) ] } return bins end
Returns the binaries associated to the Program for each Device.
Returns the binaries associated to the Program for each Device .