HEBench
hebench::DataLoader::ExternalDatasetLoader< T, typename > Class Template Reference

#include <hebench_dataset_loader.h>

Static Public Member Functions

static ExternalDataset< T > loadFromCSV (const std::string &filename, std::uint64_t max_loaded_size=0)
 Loads a dataset from an external csv file that follows the defined structure. More...
 

Detailed Description

template<typename T, typename = std::enable_if_t<std::is_same_v<T, std::int32_t> || std::is_same_v<T, std::int64_t> || std::is_same_v<T, float> || std::is_same_v<T, double>>>
class hebench::DataLoader::ExternalDatasetLoader< T, typename >

Definition at line 40 of file hebench_dataset_loader.h.

Member Function Documentation

◆ loadFromCSV()

template<typename T , typename E >
ExternalDataset< T > hebench::DataLoader::ExternalDatasetLoader< T, E >::loadFromCSV ( const std::string &  filename,
std::uint64_t  max_loaded_size = 0 
)
static

Loads a dataset from an external csv file that follows the defined structure.

Parameters
[in]filenameName of the file to load.
[in]max_loaded_sizeMaximum size, in bytes, allowed for the data to occupy after loading. If 0, there is no limit to how much memory the data can occupy.
Exceptions
StandardC++ exception derived from std::exception on error describing the failure.
Returns
An ExternalDataset structure containing the data loaded where the loaded scalars are of type T.

Contents of the file loaded will be casted to the type indicated for the template parameter specification during the method call. Samples containing strings will be converted into equivalent ASCII characters and cast into template type T.

If max_loaded_size is not zero, then, the total number of bytes required to hold all the values loaded in the returned ExternalDataset must be less than or equal to value of max_loaded_size . Otherwise, an exception is thrown because the size of the dataset in the file specified after loading and converting to ExternalDataset is larger than non-zero max_loaded_size .

Definition at line 623 of file hebench_dataset_loader.cpp.


The documentation for this class was generated from the following files: