mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-21 23:09:01 +00:00
subgroups: Fix Wformat warnings (#1549)
The main source of warnings was the use of `%d` for printing a templated type `T`, where `T` could be any cl_ scalar or vector type. Introduce `print_expected_obtained`. It takes const references to handle alignment of the cl_ types. Define `operator<<` for all types used by the subgroup tests. Ideally those would be template functions enabled by TypeManager data, but that requires some more work on the TypeManager (which we'd ideally do after more warnings have been enabled). So for now, define the `operator<<` instances using preprocessor defines. Also fix a few instances where the wrong format specifier was used for `size_t` types. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
2110e45cce
commit
fc4260bdae
@@ -51,7 +51,7 @@ template <typename Ty, ArithmeticOp operation> struct RED_CLU
|
||||
static void log_test(const WorkGroupParams &test_params,
|
||||
const char *extra_text)
|
||||
{
|
||||
log_info(" sub_group_clustered_reduce_%s(%s, %d bytes) ...%s\n",
|
||||
log_info(" sub_group_clustered_reduce_%s(%s, %zu bytes) ...%s\n",
|
||||
operation_names(operation), TypeManager<Ty>::name(),
|
||||
sizeof(Ty), extra_text);
|
||||
}
|
||||
@@ -90,7 +90,7 @@ template <typename Ty, ArithmeticOp operation> struct RED_CLU
|
||||
if (dts != sizeof(Ty))
|
||||
{
|
||||
log_error("ERROR: sub_group_clustered_reduce_%s(%s) "
|
||||
"wrong data type size detected, expected: %d, "
|
||||
"wrong data type size detected, expected: %zu, "
|
||||
"used by device %d, in group %d\n",
|
||||
operation_names(operation),
|
||||
TypeManager<Ty>::name(), sizeof(Ty), dts, k);
|
||||
|
||||
Reference in New Issue
Block a user