Fix various Wformat warnings (#2135)

test_copy_1D.cpp: num_mip_levels is a cl_uint, so don't cast and just
print using `%u`.

test_pipe_info.cpp: arg_type_qualifier is a 64-bit wide bitfield, so
print in hexadecimal format using the correct length modifier.

test_device_partition.cpp: it is not clear what the bit width of
`cl_device_partition_property` should be, so cast the operands to align
with the format specifiers.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2024-11-26 18:25:38 +01:00
committed by GitHub
parent d3b9520adc
commit e360d2de5b
16 changed files with 58 additions and 32 deletions

View File

@@ -441,9 +441,12 @@ int test_partition_of_device(cl_device_id deviceID, cl_context context, cl_comma
properties_returned[1] == CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE ||
properties_returned[1] == CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE ||
properties_returned[1] == CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE))) {
log_error("properties_returned[%d] 0x%x != 0x%x partition_type[%d].", i, properties_returned[i], partition_type[i], i);
return -1;
}
log_error(
"properties_returned[%d] 0x%x != 0x%x partition_type[%d].", i,
static_cast<unsigned int>(properties_returned[i]),
static_cast<unsigned int>(partition_type[i]), i);
return -1;
}
}
} // for
}
@@ -493,8 +496,10 @@ int test_partition_of_device(cl_device_id deviceID, cl_context context, cl_comma
}
else
{
log_info("Testing on device %p partition type \"%s\" (%d,%d)\n", deviceID, printPartition(partitionProp[i][0]),
partitionProp[i][1], partitionProp[i][2]);
log_info("Testing on device %p partition type \"%s\" (%d,%d)\n",
deviceID, printPartition(partitionProp[i][0]),
static_cast<unsigned int>(partitionProp[i][1]),
static_cast<unsigned int>(partitionProp[i][2]));
}
cl_uint deviceCount;