summaryrefslogtreecommitdiff
path: root/scripts/generator
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-05-25 14:37:26 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-05-25 14:37:26 +0200
commit4612ff3552d94ab8827888c3de2fcac76190a686 (patch)
tree2ef7452fa0d6b57966d852f43f9fbb48309b82c2 /scripts/generator
parent9f8745507020961b1c287febc3a5634b46ccb0e9 (diff)
Added possibility to run the performance client with half-precision
Diffstat (limited to 'scripts/generator')
-rw-r--r--scripts/generator/generator.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py
index 7a8ff9f8..d78c3201 100644
--- a/scripts/generator/generator.py
+++ b/scripts/generator/generator.py
@@ -235,9 +235,9 @@ def wrapper_clblas(routines):
if routine.NoScalars():
result += routine.RoutineHeaderWrapperCL(routine.template, True, 21)+";\n"
for flavour in routine.flavours:
+ indent = " "*(17 + routine.Length())
+ result += routine.RoutineHeaderWrapperCL(flavour, False, 21)+" {\n"
if flavour.precision_name in ["S","D","C","Z"]:
- indent = " "*(17 + routine.Length())
- result += routine.RoutineHeaderWrapperCL(flavour, False, 21)+" {\n"
arguments = routine.ArgumentsWrapperCL(flavour)
if routine.scratch:
result += " auto queue = Queue(queues[0]);\n"
@@ -247,7 +247,9 @@ def wrapper_clblas(routines):
result += " return clblas"+flavour.name+routine.name+"("
result += (",\n"+indent).join([a for a in arguments])
result += ",\n"+indent+"num_queues, queues, num_wait_events, wait_events, events);"
- result += "\n}\n"
+ else:
+ result += " return clblasNotImplemented;"
+ result += "\n}\n"
return result
# The wrapper to the reference CBLAS routines (for performance/correctness testing)
@@ -257,9 +259,9 @@ def wrapper_cblas(routines):
if routine.has_tests:
result += "\n// Forwards the Netlib BLAS calls for %s\n" % (routine.ShortNamesTested())
for flavour in routine.flavours:
+ indent = " "*(10 + routine.Length())
+ result += routine.RoutineHeaderWrapperC(flavour, False, 12)+" {\n"
if flavour.precision_name in ["S","D","C","Z"]:
- indent = " "*(10 + routine.Length())
- result += routine.RoutineHeaderWrapperC(flavour, False, 12)+" {\n"
arguments = routine.ArgumentsWrapperC(flavour)
# Double-precision scalars
@@ -293,7 +295,9 @@ def wrapper_cblas(routines):
result += " "+assignment+"cblas_"+flavour.name.lower()+routine.name+postfix+"("
result += (",\n"+indent).join([a for a in arguments])
result += extra_argument+endofline+");"
- result += "\n}\n"
+ else:
+ result += " return;"
+ result += "\n}\n"
return result
# ==================================================================================================
@@ -402,7 +406,7 @@ for level in [1,2,3]:
body += " case clblast::Precision::k"+PrecisionToFullName(precision)+":"
found = False
for flavour in routine.flavours:
- if flavour.precision_name == precision and flavour.precision_name in ["S","D","C","Z"]:
+ if flavour.precision_name == precision:
body += "\n clblast::RunClient<clblast::TestX"+routine.name+flavour.TestTemplate()
body += ">(argc, argv); break;\n"
found = True