Skip to content

Commit

Permalink
Moved string helpers procedures due to request from test_commonfns PR K…
Browse files Browse the repository at this point in the history
  • Loading branch information
shajder committed Jun 12, 2023
1 parent 5dae748 commit 5b3d1a5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

#include <memory>
#include <string>
#include <CL/cl_half.h>

extern cl_half_rounding_mode halfRoundingMode;

inline std::string concat_kernel(const char *sstr[], int num)
{
Expand All @@ -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
7 changes: 3 additions & 4 deletions test_conformance/basic/test_astype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <limits.h>
#include <stdio.h>
Expand All @@ -22,11 +25,7 @@
#include <sys/stat.h>
#include <vector>

#include "harness/conversions.h"
#include "harness/typeWrappers.h"

#include "procs.h"
#include "utils.h"

// clang-format off

Expand Down
11 changes: 9 additions & 2 deletions test_conformance/basic/test_fpmath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
// limitations under the License.
//
#include "harness/compat.h"
#include "harness/rounding_mode.h"
#include "harness/stringHelpers.h"

#include <CL/cl_half.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "harness/rounding_mode.h"

#include <algorithm>
#include <functional>
Expand All @@ -29,7 +32,6 @@
#include <vector>

#include "procs.h"
#include "utils.h"

static const char *fp_kernel_code = R"(
%s
Expand All @@ -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 <typename T> double toDouble(T val)
{
if (std::is_same<cl_half, T>::value)
Expand Down

0 comments on commit 5b3d1a5

Please sign in to comment.