Skip to content

Commit

Permalink
Moved string helper 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 4450871 commit 310d2ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,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)
{
std::string res;
Expand All @@ -42,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: 8 additions & 3 deletions test_conformance/basic/test_vloadstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,29 @@
#include <sys/stat.h>
#include <vector>

#include <CL/cl_half.h>

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

#include "utils.h"
#include "harness/stringHelpers.h"
#include "harness/typeWrappers.h"

// Outputs debug information for stores
#define DEBUG 0
// Forces stores/loads to be done with offsets = tid
#define LINEAR_OFFSETS 0
#define NUM_LOADS 512
#define HFF(num) cl_half_from_float(num, halfRoundingMode)
#define HTF(num) cl_half_to_float(num)

char pragma_str[128] = { 0 };
char mem_type[64] = { 0 };
char store_str[128] = { 0 };
char load_str[128] = { 0 };

extern cl_half_rounding_mode halfRoundingMode;

// clang-format off
static const char *store_pattern= "results[ tid ] = tmp;\n";
static const char *store_patternV3 = "results[3*tid] = tmp.s0; results[3*tid+1] = tmp.s1; results[3*tid+2] = tmp.s2;\n";
Expand Down

0 comments on commit 310d2ed

Please sign in to comment.