From 1cd9d084d5f426fd4746b73f23c95a8f8ea79c15 Mon Sep 17 00:00:00 2001 From: James Price Date: Mon, 4 Jan 2021 11:12:44 -0500 Subject: [PATCH] Fix implicit int->float warning inside kernel (#1093) * Fix implicit int->float warning inside kernel This kernel is used to test various compiler options including -Werror. Some compilers produce a warning about the implicit conversion which results in this test failing when -Werror is used. * Fix formatting --- test_conformance/compiler/test_build_options.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test_conformance/compiler/test_build_options.cpp b/test_conformance/compiler/test_build_options.cpp index 7ab4454f..5bd94115 100644 --- a/test_conformance/compiler/test_build_options.cpp +++ b/test_conformance/compiler/test_build_options.cpp @@ -43,11 +43,12 @@ const char *include_test_kernel[] = { "}\n" }; const char *options_test_kernel[] = { -"__kernel void sample_test(__global float *src, __global int *dst)\n" -"{\n" -" size_t tid = get_global_id(0);\n" -" dst[tid] = src[tid];\n" -"}\n" }; + "__kernel void sample_test(__global float *src, __global int *dst)\n" + "{\n" + " size_t tid = get_global_id(0);\n" + " dst[tid] = (int)src[tid];\n" + "}\n" +}; const char *optimization_options[] = { "-cl-single-precision-constant",