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
|
found = False
|
||||||
for flavour in routine.flavours:
|
for flavour in routine.flavours:
|
||||||
if flavour.precision_name == precision:
|
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
|
result += ">(argc, argv); break;" + NL
|
||||||
found = True
|
found = True
|
||||||
if not found:
|
if not found:
|
||||||
|
@ -384,10 +386,13 @@ def correctness_test(routine, level_string):
|
||||||
result += "int main(int argc, char *argv[]) {" + NL
|
result += "int main(int argc, char *argv[]) {" + NL
|
||||||
result += " auto errors = size_t{0};" + NL
|
result += " auto errors = size_t{0};" + NL
|
||||||
not_first = "false"
|
not_first = "false"
|
||||||
for flavour in routine.flavours:
|
extra_template_arguments = ["1, ", "2, "] if routine.name == "gemm" and not routine.batched else [""]
|
||||||
result += " errors += clblast::RunTests<clblast::TestX" + routine.plain_name() + flavour.test_template()
|
for extra_template_argument in extra_template_arguments:
|
||||||
result += ">(argc, argv, " + not_first + ", \"" + flavour.name + routine.upper_name() + "\");" + NL
|
for flavour in routine.flavours:
|
||||||
not_first = "true"
|
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 += " if (errors > 0) { return 1; } else { return 0; }" + NL
|
||||||
result += "}" + NL
|
result += "}" + NL
|
||||||
return result
|
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 self.beta_cpp + "{reinterpret_cast<const double*>(beta)[0], reinterpret_cast<const double*>(beta)[1]}"
|
||||||
return "beta"
|
return "beta"
|
||||||
|
|
||||||
def test_template(self):
|
def test_template(self, extra_template_argument):
|
||||||
"""Returns the template as used in the correctness/performance tests"""
|
"""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
|
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
|
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:
|
if self.buffer_type != self.beta_cpp:
|
||||||
return "<" + buffer_type + "," + self.beta_cpp + ">, " + buffer_type + ", " + beta_cpp
|
return "<" + extra_template_argument + buffer_type + "," + self.beta_cpp + ">, " + buffer_type + ", " + beta_cpp
|
||||||
return "<" + buffer_type + ">, " + buffer_type + ", " + beta_cpp
|
return "<" + extra_template_argument + buffer_type + ">, " + buffer_type + ", " + beta_cpp
|
||||||
|
|
||||||
def is_complex(self, scalar):
|
def is_complex(self, scalar):
|
||||||
"""Current scalar is complex"""
|
"""Current scalar is complex"""
|
||||||
|
|
|
@ -15,21 +15,16 @@
|
||||||
// Main function (not within the clblast namespace)
|
// Main function (not within the clblast namespace)
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
auto errors = size_t{0};
|
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, 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, 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::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::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");
|
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, 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, 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::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::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");
|
errors += clblast::RunTests<clblast::TestXgemm<2, clblast::half>, clblast::half, clblast::half>(argc, argv, true, "HGEMM");
|
||||||
|
|
||||||
if (errors > 0) { return 1; } else { return 0; }
|
if (errors > 0) { return 1; } else { return 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue