// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. #include #include #include #include #include #include #include #include #include #include #include #include "partition.h" #include "utils.h" #include #include #include #include template int aux_main(char **argv) { std::string base_file(argv[2]); std::string output_prefix(argv[3]); float sampling_rate = (float)(std::atof(argv[4])); gen_random_slice(base_file, output_prefix, sampling_rate); return 0; } int main(int argc, char **argv) { if (argc != 5) { std::cout << argv[0] << " data_type [float/int8/uint8] base_bin_file " "sample_output_prefix sampling_probability" << std::endl; exit(-1); } if (std::string(argv[1]) == std::string("float")) { aux_main(argv); } else if (std::string(argv[1]) == std::string("int8")) { aux_main(argv); } else if (std::string(argv[1]) == std::string("uint8")) { aux_main(argv); } else std::cout << "Unsupported type. Use float/int8/uint8." << std::endl; return 0; }