summaryrefslogtreecommitdiff
path: root/scripts/generator
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-04-03 21:44:35 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-04-03 21:44:35 +0200
commiteb1fda2729c4022493aa874e3fe81d2a270085a1 (patch)
tree98ffef845d862754a17f088f86e5f2c5b1c3ecdc /scripts/generator
parentb24d36474334a74c286ffddc6af8fb74a3bae445 (diff)
In-lined the float2 and double2 types to avoid collision with CUDA's definitions
Diffstat (limited to 'scripts/generator')
-rw-r--r--scripts/generator/generator/cpp.py6
-rw-r--r--scripts/generator/generator/datatype.py6
2 files changed, 4 insertions, 8 deletions
diff --git a/scripts/generator/generator/cpp.py b/scripts/generator/generator/cpp.py
index 91fdf458..03da7985 100644
--- a/scripts/generator/generator/cpp.py
+++ b/scripts/generator/generator/cpp.py
@@ -295,9 +295,6 @@ def performance_test(routine, level_string):
result = ""
result += "#include \"test/performance/client.hpp\"" + NL
result += "#include \"test/routines/level" + level_string + "/x" + routine.lowercase_name() + ".hpp\"" + NL + NL
- result += "// Shortcuts to the clblast namespace" + NL
- result += "using float2 = clblast::float2;" + NL
- result += "using double2 = clblast::double2;" + NL + NL
result += "// Main function (not within the clblast namespace)" + NL
result += "int main(int argc, char *argv[]) {" + NL
result += " const auto command_line_args = clblast::RetrieveCommandLineArguments(argc, argv);" + NL
@@ -324,9 +321,6 @@ def correctness_test(routine, level_string):
result = ""
result += "#include \"test/correctness/testblas.hpp\"" + NL
result += "#include \"test/routines/level" + level_string + "/x" + routine.lowercase_name() + ".hpp\"" + NL + NL
- result += "// Shortcuts to the clblast namespace" + NL
- result += "using float2 = clblast::float2;" + NL
- result += "using double2 = clblast::double2;" + NL + NL
result += "// Main function (not within the clblast namespace)" + NL
result += "int main(int argc, char *argv[]) {" + NL
result += " auto errors = size_t{0};" + NL
diff --git a/scripts/generator/generator/datatype.py b/scripts/generator/generator/datatype.py
index cfdbf748..cab2411a 100644
--- a/scripts/generator/generator/datatype.py
+++ b/scripts/generator/generator/datatype.py
@@ -72,9 +72,11 @@ class DataType:
def test_template(self):
"""Returns the template as used in the correctness/performance tests"""
+ buffer_type = "clblast::" + self.buffer_type if self.buffer_type in [D_FLOAT2, D_DOUBLE2] else self.buffer_type
+ beta_cpp = "clblast::" + self.beta_cpp if self.beta_cpp in [D_FLOAT2, D_DOUBLE2] else self.beta_cpp
if self.buffer_type != self.beta_cpp:
- return "<" + self.buffer_type + "," + self.beta_cpp + ">, " + self.buffer_type + ", " + self.beta_cpp
- return "<" + self.buffer_type + ">, " + self.buffer_type + ", " + self.beta_cpp
+ return "<" + buffer_type + "," + self.beta_cpp + ">, " + buffer_type + ", " + beta_cpp
+ return "<" + buffer_type + ">, " + buffer_type + ", " + beta_cpp
def is_complex(self, scalar):
"""Current scalar is complex"""