mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 08:19:02 +00:00
spirv_new: fix -Wformat warnings (#1933)
`log_error` was invoked from a template function, but the format specifiers weren't adjusted for the template parameter types. Use a stringstream for printing instead. Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
27e47e9e87
commit
5fe1cc01c0
@@ -439,9 +439,12 @@ int test_fp_rounding(cl_device_id deviceID,
|
|||||||
{
|
{
|
||||||
if (h_res[i] != h_out[i])
|
if (h_res[i] != h_out[i])
|
||||||
{
|
{
|
||||||
log_error("Values do not match at location %d. Original :%lf, "
|
std::stringstream sstr;
|
||||||
"Expected: %ld, Found %ld\n",
|
sstr << "Values do not match at location " << i << ". "
|
||||||
i, h_in[i], h_out[i], h_res[i]);
|
<< "Original: " << h_in[i] << ", "
|
||||||
|
<< "Expected: " << h_out[i] << ", "
|
||||||
|
<< "Found: " << h_res[i];
|
||||||
|
log_error("%s\n", sstr.str().c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include "testBase.h"
|
#include "testBase.h"
|
||||||
#include "types.hpp"
|
#include "types.hpp"
|
||||||
|
|
||||||
@@ -63,8 +65,10 @@ int run_case(cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
|||||||
use_spec_constant ? reference = final_value : reference = init_buffer;
|
use_spec_constant ? reference = final_value : reference = init_buffer;
|
||||||
if (device_results != reference)
|
if (device_results != reference)
|
||||||
{
|
{
|
||||||
log_error("Values do not match. Expected %d obtained %d\n", reference,
|
std::stringstream sstr;
|
||||||
device_results);
|
sstr << "Values do not match. Expected " << reference << " obtained "
|
||||||
|
<< device_results;
|
||||||
|
log_error("%s\n", sstr.str().c_str());
|
||||||
err = -1;
|
err = -1;
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
Reference in New Issue
Block a user