Skip to content

Commit

Permalink
Slight tweak to set_by_inds_from_inds() docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
lebedov committed Mar 20, 2016
1 parent f2cb710 commit c78ae5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neurokernel/tools/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def set_by_inds_from_inds(dest_gpu, ind_dest, src_gpu, ind_src):
src_gpu : pycuda.gpuarray.GPUArray
GPUArray instance from which to set values.
ind_src : pycuda.gpuarray.GPUArray or numpy.ndarray
1D array of element indices in `src_gpu` to copy. Must have an integer dtype.
1D array of element indices in `src_gpu` to copy. Must have an integer
dtype and be the same length as `ind_dest`.
Examples
--------
Expand Down Expand Up @@ -260,7 +261,7 @@ def set_by_inds_from_inds(dest_gpu, ind_dest, src_gpu, ind_src):
data_ctype = dtype_to_ctype(dest_gpu.dtype)
ind_ctype = dtype_to_ctype(ind_dest.dtype)
v = "{data_ctype} *dest, {ind_ctype} *ind_dest,"\
"{data_ctype} *src, {ind_ctype} *ind_src".format(data_ctype=data_ctype, ind_ctype=ind_ctype)
"{data_ctype} *src, {ind_ctype} *ind_src".format(data_ctype=data_ctype, ind_ctype=ind_ctype)
func = elementwise.ElementwiseKernel(v,
"dest[ind_dest[i]] = src[ind_src[i]]")
set_by_inds_from_inds.cache[(dest_gpu.dtype, ind_dest.dtype)] = func
Expand Down

0 comments on commit c78ae5b

Please sign in to comment.