51 std::string micro_architecture =
CFG_args->
getValue<std::string>(
"micro_architecture");
59 std::vector<DisCosTiC_Datatype> cores(cores_per_chip) ;
60 std::iota (std::begin(cores), std::end(cores), 1);
65 DisCosTiC_Datatype FLOPs_per_cycle_SP = FP_instructions_per_cycle * FP_ops_per_instruction_SP;
66 DisCosTiC_Datatype FLOPs_per_cycle_DP = FP_instructions_per_cycle * FP_ops_per_instruction_DP;
68 real_t max_perf_per_core_SP = clk_freq_in_GHz * FLOPs_per_cycle_SP;
69 real_t max_perf_per_core_DP = clk_freq_in_GHz * FLOPs_per_cycle_DP;
72 std::vector<real_t> chip_max_perf_SP(cores_per_chip);
73 std::transform( cores.begin(),
75 chip_max_perf_SP.begin(),
76 std::bind( std::multiplies<real_t>(),
77 std::placeholders::_1,
78 max_perf_per_core_SP ));
80 std::vector<real_t> chip_max_perf_DP(cores_per_chip);
81 std::transform(cores.begin(), cores.end(), chip_max_perf_DP.begin(),
82 std::bind(std::multiplies<real_t>(), std::placeholders::_1, max_perf_per_core_DP ));
84if (process_Rank == 0){
85 std::cout <<
"\n\n----------------------------------------------------------------"<< std::endl;
86 std::cout <<
"COMPUTATIONAL PERFORMANCE MODEL (Chip+Kernel):" << std::endl;
87 std::cout <<
"----------------------------------------------------------------"<< std::endl;
88 std::cout <<
"Core-bound workload on " << micro_architecture <<
": " << std::endl;
89 std::cout <<
"cores: " ;
91 std::cout <<
"single-precision maximum chip performance [GF/s]: ";
93 std::cout <<
"double-precision maximum chip performance [GF/s]: ";
112 if (streaming_stores){
113 R_streams = R_streams;
117 real_t Read_streams = R_streams;
118 R_streams = R_streams + W_streams;
119 WA_factor = (R_streams + W_streams)/(Read_streams + W_streams) ;
137 std::transform( MEM_bandwidth.begin(),
139 MEM_bandwidth.begin(),
140 std::bind( std::multiplies<real_t>(),
141 std::placeholders::_1,
144 real_t bytes_transfered = (R_streams + W_streams) *
sizeof(
real_t);
146 real_t arith_intens_in_FLOPperB = FLOPs_per_iteration/bytes_transfered;
148 std::vector<real_t> perf_in_FLOPpers(cores_per_chip);
149 std::transform( MEM_bandwidth.begin(),
151 perf_in_FLOPpers.begin(),
152 std::bind( std::multiplies<real_t>(),
153 std::placeholders::_1,
154 arith_intens_in_FLOPperB));
156 std::vector<real_t> time_in_s(cores_per_chip);
157 std::transform (MEM_bandwidth.begin(), MEM_bandwidth.end(), time_in_s.begin(),
158 [&datasize_in_GB](
double v) { return datasize_in_GB / v; });
165 for (
auto const& i : time_in_s)
168 throw std::runtime_error(
"negative operation time\n");
171 std::vector<DisCosTiC_Timetype> time_in_ns(cores_per_chip);
172 std::transform( time_in_s.begin(),
175 std::bind( std::multiplies<real_t>(),
176 std::placeholders::_1,
178if (process_Rank == 0){
180 std::cout <<
"\nCode running on " << micro_architecture <<
": " << std::endl;
181 std::cout <<
"bytes transfer [B]: " << bytes_transfered << std::endl;
182 std::cout <<
"arithmetic intensity [F/B]: " << arith_intens_in_FLOPperB << std::endl;
183 std::cout <<
"memory bandwidth [GB/s]: " << std::endl;
185 std::cout <<
"performnace [GF/s]: " << std::endl;
187 std::cout <<
"runtime [ns]: " << std::endl;