54 std::ifstream
file(
"/proc/sys/kernel/hostname");
76 return std::to_string(
hours) +
"h " + std::to_string(
minutes % 60) +
"m " + std::to_string(
seconds % 60) +
"s " + std::to_string(
milliseconds % 1000) +
"ms";
T * alloc_to_device(size_t size)
Allocates memory on the CUDA device.
void save_search_data(const std::string &method, size_t n, size_t m, size_t l, size_t num_nanoseconds, size_t num_repetitions, size_t min_par_compare, bool is_genetic)
Saves search performance data to a CSV file.
void save_construction_data(const std::string &method, size_t n, size_t m, size_t l, size_t num_nanoseconds, size_t num_repetitions, size_t min_par_compare, bool is_genetic)
Saves construction performance data to a CSV file.
std::string get_hostname()
Retrieves the hostname of the machine executing the code.
void save_removal_data(const std::string &method, size_t n, size_t m, size_t l, size_t num_nanoseconds, size_t num_repetitions, size_t min_par_compare, bool is_genetic)
Saves removal performance data to a CSV file.
std::string pretty_print(size_t nanoseconds)
Converts a duration in nanoseconds to a human-readable string format.
Defines utilities for managing performance data logging and timing.
static const std::string REMOVAL_DATA_FILENAME
Base filename prefix for removal performance data files.
static const std::string CSV_EXTENSION
Standard file extension for Comma Separated Value files.
static const std::string SEARCH_DATA_FILENAME
Base filename prefix for search performance data files.
static const std::string CONSTRUCTION_DATA_FILENAME
Base filename prefix for construction performance data files.
static const std::string HOSTNAME
Constant string storing the hostname, retrieved once at program startup.
const std::string & get_data_directory(bool is_genetic=false)
Gets the appropriate data directory path based on the data type.