From 5b3d1a525dc237d133f6c18fa69be5436889ce3a Mon Sep 17 00:00:00 2001 From: Marcin Hajder Date: Mon, 12 Jun 2023 09:27:19 +0200 Subject: [PATCH] Moved string helpers procedures due to request from test_commonfns PR #1695 --- .../utils.h => test_common/harness/stringHelpers.h | 6 ------ test_conformance/basic/test_astype.cpp | 7 +++---- test_conformance/basic/test_fpmath.cpp | 11 +++++++++-- 3 files changed, 12 insertions(+), 12 deletions(-) rename test_conformance/basic/utils.h => test_common/harness/stringHelpers.h (88%) diff --git a/test_conformance/basic/utils.h b/test_common/harness/stringHelpers.h similarity index 88% rename from test_conformance/basic/utils.h rename to test_common/harness/stringHelpers.h index d7b30a09b..3f6bf64db 100644 --- a/test_conformance/basic/utils.h +++ b/test_common/harness/stringHelpers.h @@ -19,9 +19,6 @@ #include #include -#include - -extern cl_half_rounding_mode halfRoundingMode; inline std::string concat_kernel(const char *sstr[], int num) { @@ -41,7 +38,4 @@ inline std::string str_sprintf(const std::string &str, Args... args) return std::string(buffer.get(), buffer.get() + s - 1); } -#define HFF(num) cl_half_from_float(num, halfRoundingMode) -#define HTF(num) cl_half_to_float(num) - #endif // BASIC_UTIL_H diff --git a/test_conformance/basic/test_astype.cpp b/test_conformance/basic/test_astype.cpp index 08a4cb85a..45669a7cb 100644 --- a/test_conformance/basic/test_astype.cpp +++ b/test_conformance/basic/test_astype.cpp @@ -14,6 +14,9 @@ // limitations under the License. // #include "harness/compat.h" +#include "harness/conversions.h" +#include "harness/stringHelpers.h" +#include "harness/typeWrappers.h" #include #include @@ -22,11 +25,7 @@ #include #include -#include "harness/conversions.h" -#include "harness/typeWrappers.h" - #include "procs.h" -#include "utils.h" // clang-format off diff --git a/test_conformance/basic/test_fpmath.cpp b/test_conformance/basic/test_fpmath.cpp index 9ea6000f5..6719e7281 100644 --- a/test_conformance/basic/test_fpmath.cpp +++ b/test_conformance/basic/test_fpmath.cpp @@ -14,13 +14,16 @@ // limitations under the License. // #include "harness/compat.h" +#include "harness/rounding_mode.h" +#include "harness/stringHelpers.h" + +#include #include #include #include #include #include -#include "harness/rounding_mode.h" #include #include @@ -29,7 +32,6 @@ #include #include "procs.h" -#include "utils.h" static const char *fp_kernel_code = R"( %s @@ -40,6 +42,11 @@ __kernel void test_fp(__global TYPE *srcA, __global TYPE *srcB, __global TYPE *d dst[tid] = srcA[tid] OP srcB[tid]; })"; +extern cl_half_rounding_mode halfRoundingMode; + +#define HFF(num) cl_half_from_float(num, halfRoundingMode) +#define HTF(num) cl_half_to_float(num) + template double toDouble(T val) { if (std::is_same::value)