Index of minimum magnitude element (double-precision real).
Finds the smallest index of the minimum magnitude element of a double-precision real vector.
Note: for complex arguments x, the “magnitude” is defined as abs(x.real) + abs(x.imag), not as abs(x).
Parameters: | handle : int
n : int
x : ctypes.c_void_p
incx : int
|
---|---|
Returns: | idx : int
|
Notes
This function returns a 0-based index.
Examples
>>> import pycuda.autoinit
>>> import pycuda.gpuarray as gpuarray
>>> import numpy as np
>>> x = np.random.rand(5).astype(np.float64)
>>> x_gpu = gpuarray.to_gpu(x)
>>> h = cublasCreate()
>>> m = cublasIdamin(h, x_gpu.size, x_gpu.gpudata, 1)
>>> cublasDestroy(h)
>>> np.allclose(m, np.argmin(abs(x.real) + abs(x.imag)))
True