Tests/support/support.cpp
/**
 * @param skip_nops  If true, don't compare nops in received output.
 *                   This indicates instructions which can't be generated to bytecode (yet)
 */
@param skip_nops  If true, don't compare nops in received output.
This indicates instructions which can't be generated to bytecode (yet)
@param skip_nops If true don ' t compare nops in received output . This indicates instructions which can ' t be generated to bytecode ( yet )
void match_kernel_outputs(
  std::vector<uint64_t> const &expected,
  std::vector<uint64_t> const &received,
  bool skip_nops) {
    using namespace V3DLib::v3d::instr;
    auto _nop = nop();
    auto len = expected.size();
    if (len > received.size()) {
      len = received.size();
    }
    for (uint32_t n = 0; n < len; ++n) {
      if (skip_nops && (_nop == received[n])) {
        continue;
      }
      INFO("Comparing assembly index: " << n << ", code length: " << received.size() <<
        "\nExpected: 0x" << std::hex << expected[n] << std::dec 
                         << Instr(expected[n]).dump() <<
        "Received: 0x"   << std::hex << received[n] << std::dec
                         << Instr(received[n]).dump()
      );
      REQUIRE(Instr::compare_codes(expected[n], received[n]));
    }
}
void match_kernel_outputs ( std :: vector < uint64_t > const & expected , std :: vector < uint64_t > const & received , bool skip_nops ) { using namespace V3DLib :: v3d :: instr ; auto _nop = nop ( ) ; auto len = expected . size ( ) ; if ( len > received . size ( ) ) { len = received . size ( ) ; } for ( uint32_t n = 0 ; n < len ; ++ n ) { if ( skip_nops && ( _nop == received [ n ] ) ) { continue ; } INFO ( " " << n << " " << received . size ( ) << " \n " << std :: hex << expected [ n ] << std :: dec << Instr ( expected [ n ] ) . dump ( ) << " " << std :: hex << received [ n ] << std :: dec << Instr ( received [ n ] ) . dump ( ) ) ; REQUIRE ( Instr :: compare_codes ( expected [ n ] , received [ n ] ) ) ; } }
@param skip_nops  If true, don't compare nops in received output.
@param skip_nops If true don ' t compare nops in received output .
// Arrays should eventually match exactly, including length // For now, just check progress // Outputs should match exactly //printf("nop at index %d\n", n);