diff options
author | cnugteren <web@cedricnugteren.nl> | 2016-04-20 22:14:55 -0600 |
---|---|---|
committer | cnugteren <web@cedricnugteren.nl> | 2016-04-20 22:14:55 -0600 |
commit | c8e28a33c0b786aa3772b6f6d822245b5f2ad9ea (patch) | |
tree | bd7df539c92b92cb8841ff27fd83c4e14e5958bc /scripts/generator/generator.py | |
parent | a61724ece50ab895a67bc15ae3a132d0ecbe61bc (diff) | |
parent | 16a048f1ac8102ad4bcce9cf9fc320f791323e45 (diff) |
Merge branch 'level1_routines' into development
Diffstat (limited to 'scripts/generator/generator.py')
-rw-r--r-- | scripts/generator/generator.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py index 8cd35f95..d8bd4e2c 100644 --- a/scripts/generator/generator.py +++ b/scripts/generator/generator.py @@ -40,6 +40,10 @@ Z = DataType("Z", "Z", DBL2, [DBL2, DBL2, D2CL, D2CL], DBL2) # double-complex (6 # Special cases Sc = DataType("C", "Sc", FLT2, [FLT2, FLT2, FLT2, FLT2], FLT2) # As C, but with real output Dz = DataType("Z", "Dz", DBL2, [DBL2, DBL2, DBL2, DBL2], DBL2) # As Z, but with real output +iS = DataType("S", "iS", FLT, [FLT, FLT, FLT, FLT], FLT ) # As S, but with integer output +iD = DataType("D", "iD", DBL, [DBL, DBL, DBL, DBL], DBL ) # As D, but with integer output +iC = DataType("C", "iC", FLT2, [FLT2, FLT2, F2CL, F2CL], FLT2) # As C, but with integer output +iZ = DataType("Z", "iZ", DBL2, [DBL2, DBL2, D2CL, D2CL], DBL2) # As Z, but with integer output Css = DataType("C", "C", FLT, [FLT, FLT, FLT, FLT], FLT2) # As C, but with constants from S Zdd = DataType("Z", "Z", DBL, [DBL, DBL, DBL, DBL], DBL2) # As Z, but with constants from D Ccs = DataType("C", "C", FLT2+","+FLT, [FLT2, FLT, F2CL, FLT], FLT2) # As C, but with one constant from S @@ -67,6 +71,8 @@ routines = [ Routine(True, "1", "dotu", T, [C,Z], ["n"], [], ["x","y"], ["dot"], [], "n", "Dot product of two complex vectors"), Routine(True, "1", "dotc", T, [C,Z], ["n"], [], ["x","y"], ["dot"], [], "n", "Dot product of two complex vectors, one conjugated"), Routine(True, "1", "nrm2", T, [S,D,Sc,Dz],["n"], [], ["x"], ["nrm2"], [], "2*n", "Euclidian norm of a vector"), + Routine(True, "1", "asum", T, [S,D,Sc,Dz],["n"], [], ["x"], ["asum"], [], "n", "Absolute sum of values in a vector"), + Routine(True, "1", "amax", T, [iS,iD,iC,iZ],["n"], [], ["x"], ["imax"], [], "2*n", "Index of absolute maxium value in a vector"), ], [ # Level 2: matrix-vector Routine(True, "2a", "gemv", T, [S,D,C,Z], ["m","n"], ["layout","a_transpose"], ["a","x"], ["y"], ["alpha","beta"], "", "General matrix-vector multiplication"), @@ -288,7 +294,7 @@ files = [ path_clblast+"/test/wrapper_clblas.h", path_clblast+"/test/wrapper_cblas.h", ] -header_lines = [84, 65, 93, 22, 22, 38] +header_lines = [84, 67, 93, 22, 22, 38] footer_lines = [6, 3, 9, 2, 6, 6] # Checks whether the command-line arguments are valid; exists otherwise @@ -368,7 +374,7 @@ for level in [1,2,3]: body += "using double2 = clblast::double2;\n\n" body += "// Main function (not within the clblast namespace)\n" body += "int main(int argc, char *argv[]) {\n" - default = PrecisionToFullName(routine.flavours[0].name) + default = PrecisionToFullName(routine.flavours[0].precision_name) body += " switch(clblast::GetPrecision(argc, argv, clblast::Precision::k"+default+")) {\n" for precision in ["H","S","D","C","Z"]: body += " case clblast::Precision::k"+PrecisionToFullName(precision)+":" |