From 16719f1b44f74fab8bd5c6328ee60ee995c7f3b4 Mon Sep 17 00:00:00 2001 From: Marcin Hajder Date: Mon, 12 Jun 2023 09:55:59 +0200 Subject: [PATCH] Moved string helper procedures due to request for test_commonfns PR #1695 --- .../basic/utils.h => test_common/harness/stringHelpers.h | 6 ------ test_conformance/basic/test_astype.cpp | 7 +++---- test_conformance/basic/test_int2fp.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 11 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 d7b30a09bb..3f6bf64db4 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 08a4cb85aa..45669a7cbd 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_int2fp.cpp b/test_conformance/basic/test_int2fp.cpp index 365efcbfc7..8b1203a71b 100644 --- a/test_conformance/basic/test_int2fp.cpp +++ b/test_conformance/basic/test_int2fp.cpp @@ -16,6 +16,7 @@ #include "CL/cl_half.h" #include "harness/compat.h" #include "harness/errorHelpers.h" +#include "harness/stringHelpers.h" #include #include @@ -28,7 +29,11 @@ #include #include "procs.h" -#include "utils.h" + +extern cl_half_rounding_mode halfRoundingMode; + +#define HFF(num) cl_half_from_float(num, halfRoundingMode) +#define HTF(num) cl_half_to_float(num) namespace { const char *int2float_kernel_code = R"(