MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / GetTestParamHashHelper

Function GetTestParamHashHelper

tests/common/ValueTests.hpp:111–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110template<class P>
111std::string GetTestParamHashHelper(const P &info)
112{
113 // Let's use a hash of the parameter set as index.
114 test::HashMD5 hash;
115 Update(hash, info);
116
117 // We don't need 64 bit worth of variation, 32-bit is enough and leads
118 // to shorter suffixes.
119
120 union Cast
121 {
122 uint8_t array[16];
123 uint64_t value[2];
124 };
125
126 static_assert(sizeof(hash.getHashAndReset()) == sizeof(Cast::array));
127
128 Cast caster;
129 memcpy(caster.array, &hash.getHashAndReset()[0], sizeof(caster.array));
130
131 uint64_t code64 = caster.value[0] ^ caster.value[1];
132 uint32_t code32 = (code64 & UINT32_MAX) ^ (code64 >> 32);
133
134 std::ostringstream out;
135 out << std::hex << std::setw(sizeof(code32) * 2) << std::setfill('0') << code32;
136 return out.str();
137}
138
139} // namespace detail
140

Callers 2

GetTestParamHashFunction · 0.85
operator()Method · 0.85

Calls 2

getHashAndResetMethod · 0.80
UpdateFunction · 0.70

Tested by

no test coverage detected