Fixed the Python generator script w.r.t. the recent change of testing direct/in-direct GEMM kernels separately
parent
44246053a5
commit
9224da19ef
|
@ -364,7 +364,9 @@ def performance_test(routine, level_string):
|
|||
found = False
|
||||
for flavour in routine.flavours:
|
||||
if flavour.precision_name == precision:
|
||||
result += NL + " clblast::RunClient<clblast::TestX" + routine.plain_name() + flavour.test_template()
|
||||
extra_template_argument = "0, " if routine.name == "gemm" and not routine.batched else ""
|
||||
result += NL + " clblast::RunClient<clblast::TestX" + routine.plain_name()
|
||||
result += flavour.test_template(extra_template_argument)
|
||||
result += ">(argc, argv); break;" + NL
|
||||
found = True
|
||||
if not found:
|
||||
|
@ -384,10 +386,13 @@ def correctness_test(routine, level_string):
|
|||
result += "int main(int argc, char *argv[]) {" + NL
|
||||
result += " auto errors = size_t{0};" + NL
|
||||
not_first = "false"
|
||||
for flavour in routine.flavours:
|
||||
result += " errors += clblast::RunTests<clblast::TestX" + routine.plain_name() + flavour.test_template()
|
||||
result += ">(argc, argv, " + not_first + ", \"" + flavour.name + routine.upper_name() + "\");" + NL
|
||||
not_first = "true"
|
||||
extra_template_arguments = ["1, ", "2, "] if routine.name == "gemm" and not routine.batched else [""]
|
||||
for extra_template_argument in extra_template_arguments:
|
||||
for flavour in routine.flavours:
|
||||
result += " errors += clblast::RunTests<clblast::TestX" + routine.plain_name()
|
||||
result += flavour.test_template(extra_template_argument)
|
||||
result += ">(argc, argv, " + not_first + ", \"" + flavour.name + routine.upper_name() + "\");" + NL
|
||||
not_first = "true"
|
||||
result += " if (errors > 0) { return 1; } else { return 0; }" + NL
|
||||
result += "}" + NL
|
||||
return result
|
||||
|
|
|
@ -70,13 +70,13 @@ class DataType:
|
|||
return self.beta_cpp + "{reinterpret_cast<const double*>(beta)[0], reinterpret_cast<const double*>(beta)[1]}"
|
||||
return "beta"
|
||||
|
||||
def test_template(self):
|
||||
def test_template(self, extra_template_argument):
|
||||
"""Returns the template as used in the correctness/performance tests"""
|
||||
buffer_type = "clblast::" + self.buffer_type if self.is_non_standard() else self.buffer_type
|
||||
beta_cpp = "clblast::" + self.beta_cpp if self.beta_cpp in [D_HALF, D_FLOAT2, D_DOUBLE2] else self.beta_cpp
|
||||
if self.buffer_type != self.beta_cpp:
|
||||
return "<" + buffer_type + "," + self.beta_cpp + ">, " + buffer_type + ", " + beta_cpp
|
||||
return "<" + buffer_type + ">, " + buffer_type + ", " + beta_cpp
|
||||
return "<" + extra_template_argument + buffer_type + "," + self.beta_cpp + ">, " + buffer_type + ", " + beta_cpp
|
||||
return "<" + extra_template_argument + buffer_type + ">, " + buffer_type + ", " + beta_cpp
|
||||
|
||||
def is_complex(self, scalar):
|
||||
"""Current scalar is complex"""
|
||||
|
|
|
@ -15,21 +15,16 @@
|
|||
// Main function (not within the clblast namespace)
|
||||
int main(int argc, char *argv[]) {
|
||||
auto errors = size_t{0};
|
||||
|
||||
// Tests GEMM based on the 'in-direct' kernel
|
||||
errors += clblast::RunTests<clblast::TestXgemm<1, float>, float, float>(argc, argv, false, "SGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<1, double>, double, double>(argc, argv, true, "DGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<1, clblast::float2>, clblast::float2, clblast::float2>(argc, argv, true, "CGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<1, clblast::double2>, clblast::double2, clblast::double2>(argc, argv, true, "ZGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<1, clblast::half>, clblast::half, clblast::half>(argc, argv, true, "HGEMM");
|
||||
|
||||
// Tests GEMM based on the 'direct' kernel
|
||||
errors += clblast::RunTests<clblast::TestXgemm<2, float>, float, float>(argc, argv, true, "SGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<2, double>, double, double>(argc, argv, true, "DGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<2, clblast::float2>, clblast::float2, clblast::float2>(argc, argv, true, "CGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<2, clblast::double2>, clblast::double2, clblast::double2>(argc, argv, true, "ZGEMM");
|
||||
errors += clblast::RunTests<clblast::TestXgemm<2, clblast::half>, clblast::half, clblast::half>(argc, argv, true, "HGEMM");
|
||||
|
||||
if (errors > 0) { return 1; } else { return 0; }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue