Typedef nv::merlin::EraseIfPredict
Defined in File merlin_hashtable.cuh
Typedef Documentation
-
template<class
K, classS>
usingnv::merlin::EraseIfPredict= bool (*)(const K &key, S &score, const K &pattern, const S &threshold) A customizable template function indicates which keys should be erased from the hash table by returning
true.Example for erase_if:
template <class K, class S> struct EraseIfPredFunctor { __forceinline__ __device__ bool operator()(const K& key, S& score, const K& pattern, const S& threshold) { return ((key & 0xFFFF000000000000 == pattern) && (score < threshold)); } };
Example for export_batch_if:
template <class K, class S> struct ExportIfPredFunctor { __forceinline__ __device__ bool operator()(const K& key, S& score, const K& pattern, const S& threshold) { return score >= threshold; } };
Note
The
erase_iforexport_batch_ifAPI traverses all of the items by this function and the items that returntrueare removed or exported.