diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-10-22 16:14:56 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-10-22 16:14:56 +0200 |
commit | a670c4c4bfa9557d2ae059c31aa773cf0f02ec12 (patch) | |
tree | d1f3e45501afa1818d824aa24b87148448575108 /scripts/generator/generator/cpp.py | |
parent | 4a5516aa784d2f0352daf8579c377130a914b067 (diff) |
All enums in the C API are now prefixed with CLBlast to avoid potential name clashes with other projects
Diffstat (limited to 'scripts/generator/generator/cpp.py')
-rw-r--r-- | scripts/generator/generator/cpp.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/generator/generator/cpp.py b/scripts/generator/generator/cpp.py index a0d43667..9f3089f5 100644 --- a/scripts/generator/generator/cpp.py +++ b/scripts/generator/generator/cpp.py @@ -73,7 +73,7 @@ def clblast_c_h(routine): """The C API header (.h)""" result = NL + "// " + routine.description + ": " + routine.short_names() + NL for flavour in routine.flavours: - result += routine.routine_header_c(flavour, 31, " PUBLIC_API") + ";" + NL + result += routine.routine_header_c(flavour, 38, " PUBLIC_API") + ";" + NL return result @@ -82,13 +82,15 @@ def clblast_c_cc(routine): result = NL + "// " + routine.name.upper() + NL for flavour in routine.flavours: template = "<" + flavour.template + ">" if routine.no_scalars() else "" - indent = " " * (45 + routine.length() + len(template)) - result += routine.routine_header_c(flavour, 20, "") + " {" + NL + indent = " " * (16 + routine.length() + len(template)) + result += routine.routine_header_c(flavour, 27, "") + " {" + NL result += " try {" + NL - result += " return static_cast<StatusCode>(clblast::" + routine.name.capitalize() + template + "(" + result += " return static_cast<CLBlastStatusCode>(" + NL + result += " clblast::" + routine.name.capitalize() + template + "(" result += ("," + NL + indent).join([a for a in routine.arguments_cast(flavour, indent)]) - result += "," + NL + indent + "queue, event));" + NL - result += " } catch (...) { return static_cast<StatusCode>(clblast::DispatchExceptionForC()); }" + NL + result += "," + NL + indent + "queue, event)" + NL + result += " );" + NL + result += " } catch (...) { return static_cast<CLBlastStatusCode>(clblast::DispatchExceptionForC()); }" + NL result += "}" + NL return result |