MCPcopy Create free account
hub / github.com/Xilinx/Vitis_Libraries / check_data

Function check_data

utils/L1/examples/multi_pu_kernel/tb.cpp:44–54  ·  view source on GitHub ↗

* @brief check the result * @param data_buf original data * @param res_buf updated data * @param num the number of checking data * @return 0-pass, 1-fail */

Source from the content-addressed store, hash-verified

42 * @return 0-pass, 1-fail
43 */
44int check_data(t_data* data_buf, t_data* res_buf, const int num) {
45 // check the result by their sums because distribution on load balance is NOT order-preserving.
46 int sum_gld = 0;
47 int sum_res = 0;
48 for (int i = 0; i < num; ++i) {
49 t_data new_data = update_data(data_buf[i]);
50 sum_gld += calculate(new_data);
51 sum_res += calculate(res_buf[i]);
52 }
53 return (sum_gld != sum_res);
54}
55
56int main() {
57 t_data* data_ddr = (t_data*)malloc(DATA_LEN * sizeof(t_data));

Callers 1

mainFunction · 0.85

Calls 2

update_dataFunction · 0.70
calculateFunction · 0.70

Tested by

no test coverage detected