24efdf4f57841d5d73fda3745b96a1b102ca484f,skcuda/linalg.py,,diag,#Any#,1118
Before Change
elif len(v_gpu.shape) >= 3:
raise ValueError("input array cannot have greater than 2-dimensions")
use_double = int(v_gpu.dtype in [np.float64, np.complex128])
use_complex = int(v_gpu.dtype in [np.complex64, np.complex128])
// Initialize output matrix:
d_gpu = misc.zeros((v_gpu.size, v_gpu.size), v_gpu.dtype, allocator=alloc)
// Get block/grid sizes:
dev = misc.get_current_device()
block_dim, grid_dim = misc.select_block_grid_sizes(dev, d_gpu.shape)
diag = _get_diag_kernel(use_double, use_complex)
diag(v_gpu, d_gpu, np.uint32(v_gpu.size) ,
block=block_dim,
grid=grid_dim)
After Change
N = len(v_gpu)
if N <= 0:
raise ValueError("N must be greater than 0")
d_gpu = misc.zeros((N, N), v_gpu.dtype , allocator=alloc)
func = _get_diag_kernel(v_gpu.dtype)
func(d_gpu, v_gpu, N, slice=slice(0, N))
return d_gpu
@context_dependent_memoize
def _get_eye_kernel(dtype):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances Project Name: lebedov/scikit-cuda
Commit Name: 24efdf4f57841d5d73fda3745b96a1b102ca484f
Time: 2015-11-25
Author: lev@columbia.edu
File Name: skcuda/linalg.py
Class Name:
Method Name: diag
Project Name: lebedov/scikit-cuda
Commit Name: 6b05ce9b975fdcdb982e4f3b14099df0f9e341af
Time: 2013-07-28
Author: lev@columbia.edu
File Name: scikits/cuda/misc.py
Class Name:
Method Name: maxabs
Project Name: lebedov/scikit-cuda
Commit Name: 24efdf4f57841d5d73fda3745b96a1b102ca484f
Time: 2015-11-25
Author: lev@columbia.edu
File Name: skcuda/linalg.py
Class Name:
Method Name: diag
Project Name: lebedov/scikit-cuda
Commit Name: 4b0915db2571d721e4c9118ff4a324bd2e0867f2
Time: 2013-07-28
Author: lev@columbia.edu
File Name: scikits/cuda/misc.py
Class Name:
Method Name: cumsum