unit_tests/test_pe_cluster.cpp
// generate payloads with a certain dependence distance.
// distance < 0 means no dependency.
generate payloads with a certain dependence distance.
distance < 0 means no dependency.
generate payloads with a certain dependence distance . distance < 0 means no dependency .
void testcase_gen(
    int distance,
    std::vector<test_pld_t> &test_input,
    std::vector<graphlily::idx_t> &length_table
) {
    unsigned offset = 0;
    length_table.resize(num_PE);
    for (size_t PEid = 0; PEid < num_PE; PEid++) {
        graphlily::idx_t bank_address[test_len];
        graphlily::val_t mat_vals[test_len];
        graphlily::val_t vec_vals[test_len];
        for (size_t j = 0; j < test_len; j++) {
            if (distance < 0) {
                bank_address[j] = j % bank_size;
            } else {
                bank_address[j] = j % distance;
            }
            mat_vals[j] = 1;
            vec_vals[j] = 1;
        }
        test_input.resize(offset + test_len);
        for (size_t j = 0; j < test_len; j++) {
            test_input[j + offset].mat_val = mat_vals[j];
            test_input[j + offset].vec_val = vec_vals[j];
            test_input[j + offset].row_idx = bank_address[j];
        }
        length_table[PEid] = test_len;
        offset += test_len;
    }
}
void testcase_gen ( int distance , std :: vector < test_pld_t > & test_input , std :: vector < graphlily :: idx_t > & length_table ) { unsigned offset = 0 ; length_table . resize ( num_PE ) ; for ( size_t PEid = 0 ; PEid < num_PE ; PEid ++ ) { graphlily :: idx_t bank_address [ test_len ] ; graphlily :: val_t mat_vals [ test_len ] ; graphlily :: val_t vec_vals [ test_len ] ; for ( size_t j = 0 ; j < test_len ; j ++ ) { if ( distance < 0 ) { bank_address [ j ] = j % bank_size ; } else { bank_address [ j ] = j % distance ; } mat_vals [ j ] = 1 ; vec_vals [ j ] = 1 ; } test_input . resize ( offset + test_len ) ; for ( size_t j = 0 ; j < test_len ; j ++ ) { test_input [ j + offset ] . mat_val = mat_vals [ j ] ; test_input [ j + offset ] . vec_val = vec_vals [ j ] ; test_input [ j + offset ] . row_idx = bank_address [ j ] ; } length_table [ PEid ] = test_len ; offset += test_len ; } }
generate payloads with a certain dependence distance.
generate payloads with a certain dependence distance .