16 std::mt19937 RandomGenerator::m_rand;
20 std::stringstream ss_retval;
21 std::string s_tmp = s;
24 std::transform(s_tmp.begin(), s_tmp.end(), s_tmp.begin(),
25 [to_lowercase](
unsigned char c) { return (std::isalnum(c) || c ==
'.' ?
26 (to_lowercase ? std::tolower(c) : c) :
29 s_tmp.erase(0, s_tmp.find_first_not_of(
'_'));
30 s_tmp.erase(s_tmp.find_last_not_of(
'_') + 1);
34 while (pos < s_tmp.size())
36 std::size_t i = s_tmp.find_first_of(
'_', pos);
37 if (i == std::string::npos)
38 ss_retval << s_tmp.substr(pos);
43 ss_retval << s_tmp.substr(pos, i - pos);
44 i = s_tmp.find_first_not_of(
'_', i);
49 return ss_retval.str();
55 bool output_row_index,
61 printArraysAsColumns<std::int32_t>(os, p_buffers, count, output_row_index,
separator);
65 printArraysAsColumns<std::int64_t>(os, p_buffers, count, output_row_index,
separator);
69 printArraysAsColumns<float>(os, p_buffers, count, output_row_index,
separator);
73 printArraysAsColumns<double>(os, p_buffers, count, output_row_index,
separator);
77 printArraysAsColumns<char>(os, p_buffers, count, output_row_index,
separator);
93 setRandomSeed(std::chrono::system_clock::now().time_since_epoch().count());
static void setRandomSeed()
@ Float64
64 bits IEEE 754 standard floating point real numbers.
@ Int64
64 bits signed integers.
DataType
Defines data types for a workload.
@ Float32
32 bits IEEE 754 standard floating point real numbers.
@ Int32
32 bits signed integers.
Structure to contain flexible data.
std::string convertToDirectoryName(const std::string &s, bool to_lowercase=true)
Converts a string to directory name friendly.
void printArraysAsColumns(std::ostream &os, const hebench::APIBridge::NativeDataBuffer **p_buffers, std::size_t count, hebench::APIBridge::DataType data_type, bool output_row_index=false, const char *separator=" ")
Writes the collection of NativeDataBuffer as columns to the specified output stream.