diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-10-25 20:21:50 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-10-25 20:21:50 +0200 |
commit | 140121ef91cc13892711f57da0d046f88cf55301 (patch) | |
tree | a926b58065ee80f08b93c0f68cbf7727f4786339 /scripts/generator | |
parent | 729862e87338dbd275f90d61d52803892fe3648e (diff) |
Removed the clblast namespace from the Netlib C API source file to ensure proper linking
Diffstat (limited to 'scripts/generator')
-rwxr-xr-x | scripts/generator/generator.py | 2 | ||||
-rw-r--r-- | scripts/generator/generator/cpp.py | 12 | ||||
-rw-r--r-- | scripts/generator/generator/routine.py | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py index a9169872..65d40877 100755 --- a/scripts/generator/generator.py +++ b/scripts/generator/generator.py @@ -42,7 +42,7 @@ FILES = [ "/src/clblast_blas.cpp", ] HEADER_LINES = [117, 73, 118, 22, 29, 41, 47, 32] -FOOTER_LINES = [17, 80, 19, 18, 6, 6, 9, 3] +FOOTER_LINES = [17, 80, 19, 18, 6, 6, 9, 2] # Different possibilities for requirements ald_m = "The value of `a_ld` must be at least `m`." diff --git a/scripts/generator/generator/cpp.py b/scripts/generator/generator/cpp.py index eafbea30..60e29a07 100644 --- a/scripts/generator/generator/cpp.py +++ b/scripts/generator/generator/cpp.py @@ -112,13 +112,13 @@ def clblast_blas_cc(routine): # There is a version available in CBLAS if flavour.precision_name in ["S", "D", "C", "Z"]: template = "<" + flavour.template + ">" if routine.no_scalars() else "" - indent = " " * (12 + routine.length() + len(template)) + indent = " " * (21 + routine.length() + len(template)) result += routine.routine_header_netlib(flavour, 13, "") + " {" + NL # Initialize OpenCL result += " auto device = get_device();" + NL - result += " auto context = Context(device);" + NL - result += " auto queue = Queue(context, device);" + NL + result += " auto context = clblast::Context(device);" + NL + result += " auto queue = clblast::Queue(context, device);" + NL # Set alpha and beta result += "".join(" " + s + NL for s in routine.scalar_create_cpp(flavour)) @@ -134,13 +134,13 @@ def clblast_blas_cc(routine): # The function call result += " auto queue_cl = queue();" + NL - result += " auto s = " + routine.name.capitalize() + template + "(" + result += " auto s = clblast::" + routine.name.capitalize() + template + "(" result += ("," + NL + indent).join([a for a in routine.arguments_netlib(flavour, indent)]) result += "," + NL + indent + "&queue_cl);" + NL # Error handling - result += " if (s != StatusCode::kSuccess) {" + NL - result += " throw std::runtime_error(\"CLBlast returned with error code \" + ToString(s));" + NL + result += " if (s != clblast::StatusCode::kSuccess) {" + NL + result += " throw std::runtime_error(\"CLBlast returned with error code \" + clblast::ToString(s));" + NL result += " }" + NL # Copy back and clean-up diff --git a/scripts/generator/generator/routine.py b/scripts/generator/generator/routine.py index 085845a8..097376ad 100644 --- a/scripts/generator/generator/routine.py +++ b/scripts/generator/generator/routine.py @@ -75,7 +75,7 @@ class Routine: @staticmethod def create_buffer(name, template): """Creates a new CLCudaAPI buffer""" - return "auto " + name + "_buffer = Buffer<" + template + ">(context, " + name + "_size);" + return "auto " + name + "_buffer = clblast::Buffer<" + template + ">(context, " + name + "_size);" @staticmethod def write_buffer(name, template): |