Support any hash constructor in hash_test.cu::check_hash_result
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Apri hash_test.cu e individua check_hash_result e ogni punto in cui viene chiamato nel file. Esamina l’interfaccia proposta del costruttore variadico, sposta ogni argomento seed alla fine ed esegui i test di hash per confermare che i risultati esistenti continuino a passare e che la costruzione funzioni senza un seed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I see why you made this: Because we have hash functions that don't take a seed. However, we'll eventually have the `SigBitHash` that takes not a seed but rather a list or a range or whatever.
I think that it would be better to not write a million of these functions. The right way to do it is with a variadic template. Also, you could make that a different PR. The code would look like this:
template <typename Hash, typename... HashConstructorArgs>
static __host__ __device__ bool check_hash_result(typename Hash::argument_type const& key,
typename Hash::result_type expected,
HashConstructorArgs&&... hash_constructor_args) noexcept
{
Hash h(std::forward<HashConstructorArgs>(hash_constructor_args)...);
return (h(key) == expected);
}
The seed is now the last argument so you need to find all occurrences of check_hash_result in this file and make the seed the last argument.
After doing this change, the function will now be compatible with all hash construction.
If you want to read more about std::forward, these are good:
- https://stackoverflow.com/questions/16447951/how-to-forward-variable-number-of-arguments-to-another-function
- https://stackoverflow.com/questions/7257144/when-to-use-stdforward-to-forward-arguments
The short of it is that std::forward written this way with a "universal reference" makes it so that this code works well when:
- you pass in something that has a name, like
check_hash_result(my_key, my_expected, my_seed). (my_seedhas a "name", it's a left-value aka l-value aka something that can be on the left side of an assignment) - you pass in something nameless, like check_hash_result(my_key, my_expected,
12345). (12345has no "name", it's a right-value aka r-value aka something that can not be on the left side of an assignment statement)
When used like this, the compiler will correctly optimize if the value of the seed or whatever is passed in there needs to be copied or moved.
Originally posted by @esoha-nvidia in https://github.com/NVIDIA/cuCollections/pull/514#discussion_r1653534402
- Lingua principale
- Cuda
- Stelle
- 671
- Fork
- 122
- Merge medio
- 4g 19h
- PR unite (30g)
- 10
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/cuCollections
-
Add cuco::detail::stream_sync(cuda::stream_ref) to centralize CCCL version-specific API namingForse di nuovo libera @0z5a l’ha presa 23 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NVIDIA/cuCollections#840 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
nvidia-runners
Difficoltà 1/5 1-3 ore Idoneità per principianti 25/100
NVIDIA/cuCollections#853 ·
I maintainer di solito rispondono entro 2 giorni
-
topic: performance type: feature request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NVIDIA/cuCollections#817 · 7 commenti · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
good first issue P2: Nice to have type: improvement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
NVIDIA/cuCollections#805 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[FEA] Add MPSC/MPMC concurrent queueForse di nuovo libera @sleeepyjack l’ha presa 262 giorni fa e non c’è nessuna pull request aperta. Apertatype: feature request
NVIDIA/cuCollections#791 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di NVIDIA/cuCollections
Issue simili
-
friction
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
kentcdodds/kody#3439 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
epam/dmtools-dart#385 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 95/100
I maintainer di solito rispondono entro 1 giorno
-
Surveys: an optional rating question with response-based branching throws "The response type must be an integer" when skippedForse già presa @github-actions l’ha presa oggi. Apertabug feature/surveys team/client-libraries web
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PostHog/posthog-js#5278 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Yeachan-Heo/gajae-code#6611 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno