Routine(True,True,"1","swap",T,[S,D,C,Z],["n"],[],[],["x","y"],[],"","Swap two vectors","Interchanges the contents of vectors x and y.",[]),
Routine(True,True,"1","scal",T,[S,D,C,Z],["n"],[],[],["x"],["alpha"],"","Vector scaling","Multiplies all elements of vector x by a scalar constant alpha.",[]),
Routine(True,True,"1","copy",T,[S,D,C,Z],["n"],[],["x"],["y"],[],"","Vector copy","Copies the contents of vector x into vector y.",[]),
Routine(True,True,"1","axpy",T,[S,D,C,Z,H],["n"],[],["x"],["y"],["alpha"],"","Vector-times-constant plus vector","Performs the operation y = alpha * x + y, in which x and y are vectors and alpha is a scalar constant.",[]),
Routine(True,True,"1","dot",T,[S,D],["n"],[],["x","y"],["dot"],[],"n","Dot product of two vectors","Multiplies the vectors x and y element-wise and accumulates the results. The sum is stored in the dot buffer.",[]),
Routine(True,True,"1","dotu",T,[C,Z],["n"],[],["x","y"],["dot"],[],"n","Dot product of two complex vectors","See the regular xDOT routine.",[]),
Routine(True,True,"1","dotc",T,[C,Z],["n"],[],["x","y"],["dot"],[],"n","Dot product of two complex vectors, one conjugated","See the regular xDOT routine.",[]),
Routine(True,True,"1","nrm2",T,[S,D,Sc,Dz],["n"],[],["x"],["nrm2"],[],"2*n","Euclidian norm of a vector","Accumulates the square of each element in the x vector and takes the square root. The resulting L2 norm is stored in the nrm2 buffer.",[]),
Routine(True,True,"1","asum",T,[S,D,Sc,Dz],["n"],[],["x"],["asum"],[],"n","Absolute sum of values in a vector","Accumulates the absolute value of each element in the x vector. The results are stored in the asum buffer.",[]),
Routine(True,False,"1","sum",T,[S,D,Sc,Dz],["n"],[],["x"],["sum"],[],"n","Sum of values in a vector (non-BLAS function)","Accumulates the values of each element in the x vector. The results are stored in the sum buffer. This routine is the non-absolute version of the xASUM BLAS routine.",[]),
Routine(True,True,"1","amax",T,[iS,iD,iC,iZ],["n"],[],["x"],["imax"],[],"2*n","Index of absolute maximum value in a vector","Finds the index of the maximum of the absolute values in the x vector. The resulting integer index is stored in the imax buffer.",[]),
Routine(True,False,"1","max",T,[iS,iD,iC,iZ],["n"],[],["x"],["imax"],[],"2*n","Index of maximum value in a vector (non-BLAS function)","Finds the index of the maximum of the values in the x vector. The resulting integer index is stored in the imax buffer. This routine is the non-absolute version of the IxAMAX BLAS routine.",[]),
Routine(True,False,"1","min",T,[iS,iD,iC,iZ],["n"],[],["x"],["imin"],[],"2*n","Index of minimum value in a vector (non-BLAS function)","Finds the index of the minimum of the values in the x vector. The resulting integer index is stored in the imin buffer. This routine is the non-absolute minimum version of the IxAMAX BLAS routine.",[]),
Routine(True,True,"2a","gemv",T,[S,D,C,Z],["m","n"],["layout","a_transpose"],["a","x"],["y"],["alpha","beta"],"","General matrix-vector multiplication","Performs the operation y = alpha * A * x + beta * y, in which x is an input vector, y is an input and output vector, A is an input matrix, and alpha and beta are scalars. The matrix A can optionally be transposed before performing the operation.",[]),
Routine(True,True,"2a","gbmv",T,[S,D,C,Z],["m","n","kl","ku"],["layout","a_transpose"],["a","x"],["y"],["alpha","beta"],"","General banded matrix-vector multiplication","Same operation as xGEMV, but matrix A is banded instead.",[]),
Routine(True,True,"2a","hemv",T,[C,Z],["n"],["layout","triangle"],["a","x"],["y"],["alpha","beta"],"","Hermitian matrix-vector multiplication","Same operation as xGEMV, but matrix A is an Hermitian matrix instead.",[]),
Routine(True,True,"2a","hbmv",T,[C,Z],["n","k"],["layout","triangle"],["a","x"],["y"],["alpha","beta"],"","Hermitian banded matrix-vector multiplication","Same operation as xGEMV, but matrix A is an Hermitian banded matrix instead.",[]),
Routine(True,True,"2a","hpmv",T,[C,Z],["n"],["layout","triangle"],["ap","x"],["y"],["alpha","beta"],"","Hermitian packed matrix-vector multiplication","Same operation as xGEMV, but matrix A is an Hermitian packed matrix instead and represented as AP.",[]),
Routine(True,True,"2a","symv",T,[S,D],["n"],["layout","triangle"],["a","x"],["y"],["alpha","beta"],"","Symmetric matrix-vector multiplication","Same operation as xGEMV, but matrix A is symmetric instead.",[]),
Routine(True,True,"2a","sbmv",T,[S,D],["n","k"],["layout","triangle"],["a","x"],["y"],["alpha","beta"],"","Symmetric banded matrix-vector multiplication","Same operation as xGEMV, but matrix A is symmetric and banded instead.",[]),
Routine(True,True,"2a","spmv",T,[S,D],["n"],["layout","triangle"],["ap","x"],["y"],["alpha","beta"],"","Symmetric packed matrix-vector multiplication","Same operation as xGEMV, but matrix A is a symmetric packed matrix instead and represented as AP.",[]),
Routine(True,True,"2a","trmv",T,[S,D,C,Z],["n"],["layout","triangle","a_transpose","diagonal"],["a"],["x"],[],"n","Triangular matrix-vector multiplication","Same operation as xGEMV, but matrix A is triangular instead.",[]),
Routine(True,True,"2a","tbmv",T,[S,D,C,Z],["n","k"],["layout","triangle","a_transpose","diagonal"],["a"],["x"],[],"n","Triangular banded matrix-vector multiplication","Same operation as xGEMV, but matrix A is triangular and banded instead.",[]),
Routine(True,True,"2a","tpmv",T,[S,D,C,Z],["n"],["layout","triangle","a_transpose","diagonal"],["ap"],["x"],[],"n","Triangular packed matrix-vector multiplication","Same operation as xGEMV, but matrix A is a triangular packed matrix instead and repreented as AP.",[]),
Routine(False,True,"2a","trsv",T,[S,D,C,Z],["n"],["layout","triangle","a_transpose","diagonal"],["a"],["x"],[],"","Solves a triangular system of equations","",[]),
Routine(False,True,"2a","tbsv",T,[S,D,C,Z],["n","k"],["layout","triangle","a_transpose","diagonal"],["a"],["x"],[],"","Solves a banded triangular system of equations","",[]),
Routine(False,True,"2a","tpsv",T,[S,D,C,Z],["n"],["layout","triangle","a_transpose","diagonal"],["ap"],["x"],[],"","Solves a packed triangular system of equations","",[]),
Routine(True,True,"3","syrk",T,[S,D,C,Z],["n","k"],["layout","triangle","a_transpose"],["a"],["c"],["alpha","beta"],"","Rank-K update of a symmetric matrix","",[]),
Routine(True,True,"3","herk",Tc,[Css,Zdd],["n","k"],["layout","triangle","a_transpose"],["a"],["c"],["alpha","beta"],"","Rank-K update of a hermitian matrix","",[]),
Routine(True,True,"3","syr2k",T,[S,D,C,Z],["n","k"],["layout","triangle","ab_transpose"],["a","b"],["c"],["alpha","beta"],"","Rank-2K update of a symmetric matrix","",[]),
Routine(True,True,"3","her2k",TU,[Ccs,Zzd],["n","k"],["layout","triangle","ab_transpose"],["a","b"],["c"],["alpha","beta"],"","Rank-2K update of a hermitian matrix","",[]),
Routine(False,True,"3","trsm",T,[S,D,C,Z],["m","n"],["layout","side","triangle","a_transpose","diagonal"],["a"],["b"],["alpha"],"","Solves a triangular system of equations","",[]),
f.write("Arguments to "+routine.name.upper()+":\n")
f.write("\n")
forargumentinroutine.ArgumentsDoc():
f.write("* "+argument+"\n")
f.write("* `cl_command_queue* queue`: Pointer to an OpenCL command queue associated with a context and device to execute the routine on.\n")
f.write("* `cl_event* event`: Pointer to an OpenCL event to be able to wait for completion of the routine's OpenCL kernel(s). This is an optional argument.\n")
f.write("\n")
# Routine requirements
iflen(routine.RequirementsDoc())>0:
f.write("Requirements for "+routine.name.upper()+":\n")