Ejemplo n.º 1
0
    def join(self, id):
        (th, code) = id
        cal_exec.join_stream(th)

        for arr in code._remote_bindings_data.values():
            arr.set_memory(arr.gpu_mem_handle[0], arr.data_len * arr.itemsize)
        return
Ejemplo n.º 2
0
  def join(self, id):
    (th, code) = id
    cal_exec.join_stream(th)

    for arr in code._remote_bindings_data.values():
      arr.set_memory(arr.gpu_mem_handle[0], arr.data_len * arr.itemsize)
    return
Ejemplo n.º 3
0
  def join(self, hdl):
    # TODO - do something better to differentiate
    if len(hdl) == 2:
      # Join a kernel execution
      (th, prgm) = hdl
      cal_exec.join_stream(th)

      for arr in prgm._remote_bindings_data.values():
        binding = prgm._bindings[key]
        if isinstance(arr, extarray.extarray):
          arr.set_memory(bindings[1], arr.data_len * arr.itemsize)
        elif isinstance(arr, numpy.ndarray) and HAS_NUMPY:
          cal_exec.set_ndarray_ptr(arr, bindings[1])
    elif len(hdl) == 3:
      cal_exec.join_copy(self.ctx, hdl)
    return