summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-03-30 15:31:45 +0200
committercnugteren <web@cedricnugteren.nl>2016-03-30 16:13:26 -0700
commit6e5f558746eec09eda6132754649419430a86f41 (patch)
treedbc842cfa0b805e690d5f77822740c7b6b70caa9 /scripts
parent6f561abada9abb54987ecea0cf10f547e2e88422 (diff)
Made event an optional argument in the CLBlast C++ API
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generator/generator.py10
-rw-r--r--scripts/generator/routine.py4
2 files changed, 7 insertions, 7 deletions
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py
index 8ff5e130..5163b1ca 100644
--- a/scripts/generator/generator.py
+++ b/scripts/generator/generator.py
@@ -151,7 +151,7 @@ def clblast_h(routines):
result = ""
for routine in routines:
result += "\n// "+routine.description+": "+routine.ShortNames()+"\n"
- result += routine.RoutineHeaderCPP(12)+";\n"
+ result += routine.RoutineHeaderCPP(12, " = nullptr")+";\n"
return result
# The C++ API implementation (.cc)
@@ -161,9 +161,9 @@ def clblast_cc(routines):
indent1 = " "*(20 + routine.Length())
result += "\n// "+routine.description+": "+routine.ShortNames()+"\n"
if routine.implemented:
- result += routine.RoutineHeaderCPP(12)+" {\n"
+ result += routine.RoutineHeaderCPP(12, "")+" {\n"
result += " auto queue_cpp = Queue(*queue);\n"
- result += " auto event_cpp = Event(*event);\n"
+ result += " auto event_cpp = Event(event);\n"
result += " auto routine = X"+routine.name+"<"+routine.template.template+">(queue_cpp, event_cpp);\n"
result += " auto status = routine.SetUp();\n"
result += " if (status != StatusCode::kSuccess) { return status; }\n"
@@ -247,8 +247,8 @@ files = [
path_clblast+"/src/clblast_c.cc",
path_clblast+"/test/wrapper_clblas.h",
]
-header_lines = [84, 64, 88, 24, 22]
-footer_lines = [6, 3, 5, 2, 6]
+header_lines = [84, 64, 93, 22, 22]
+footer_lines = [6, 3, 9, 2, 6]
# Checks whether the command-line arguments are valid; exists otherwise
for f in files:
diff --git a/scripts/generator/routine.py b/scripts/generator/routine.py
index 60b9fcc5..1086cecc 100644
--- a/scripts/generator/routine.py
+++ b/scripts/generator/routine.py
@@ -308,12 +308,12 @@ class Routine():
# ==============================================================================================
# Retrieves the C++ templated definition for a routine
- def RoutineHeaderCPP(self, spaces):
+ def RoutineHeaderCPP(self, spaces, default_event):
indent = " "*(spaces + self.Length())
result = "template <"+self.template.name+">\n"
result += "StatusCode "+self.name.capitalize()+"("
result += (",\n"+indent).join([a for a in self.ArgumentsDef(self.template)])
- result += ",\n"+indent+"cl_command_queue* queue, cl_event* event)"
+ result += ",\n"+indent+"cl_command_queue* queue, cl_event* event"+default_event+")"
return result
# As above, but now without variable names