diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2018-02-18 17:34:10 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2018-02-18 17:34:10 +0100 |
commit | a66e24a009fe6f23c6231ec3b7c1a4698f831435 (patch) | |
tree | 7fe97075705f69cf72b9e33309bc4a8349294e9a /scripts | |
parent | e1bfb4082716ef9619a13e9985aca9ef28cf4cbf (diff) |
Added all other level 1/2/3 routines to pyclblast
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/generator/generator/pyclblast.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/generator/generator/pyclblast.py b/scripts/generator/generator/pyclblast.py index ffeaab8d..85bcc93f 100644 --- a/scripts/generator/generator/pyclblast.py +++ b/scripts/generator/generator/pyclblast.py @@ -22,20 +22,21 @@ def to_np_dtype(flavour): def scalar_cython_conversion(scalar, flavour): - if flavour.precision_name == "S": + scalar_type = flavour.alpha_cl if scalar == "alpha" else flavour.beta_cl + if scalar_type == "float": return "<cl_float>" + scalar - if flavour.precision_name == "D": + if scalar_type == "double": return "<cl_double>" + scalar - if flavour.precision_name == "C": + if scalar_type in ["cl_float2", "float2"]: return "<cl_float2>cl_float2(x=" + scalar + ".real,y=" + scalar + ".imag)" - if flavour.precision_name == "Z": + if scalar_type in ["cl_double2", "double2"]: return "<cl_double2>cl_double2(x=" + scalar + ".real,y=" + scalar + ".imag)" - raise RuntimeError("Could not convert flavour '%s'" % flavour.precision_name) + raise RuntimeError("Could not convert flavour '%s:%s'" % (flavour.precision_name, scalar_type)) def generate_pyx(routine): result = "" - if routine.implemented and routine.plain_name() in ["swap", "gemm"]: # TODO: Generalize + if routine.implemented and routine.plain_name() and routine.level in ["1", "2a", "2b", "3"]: result += SEPARATOR + NL result += "# " + routine.description + ": " + routine.short_names() + NL |