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


    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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: OpenMined/PySyft
Commit Name: 713eda271c55358f577e6f682036049448340975
Time: 2021-03-13
Author: dashnabanita@gmail.com
File Name: tests/syft/lib/python/slice/slice_id_test.py
Class Name:
Method Name:


Project Name: arviz-devs/arviz
Commit Name: 86776e7837cd4c3d7a09416ca1c16dd7681043bc
Time: 2018-05-24
Author: colcarroll@gmail.com
File Name: doc/sphinxext/gallery_generator.py
Class Name:
Method Name: create_thumbnail