NVIDIA / NVIDIA/cccl

CUDA derangement implementation

Open
#781 1 comment 0 reactions 1 assignee Claimed by @griwes View on GitHub
thrust
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

Supposing that there is an array `a[n]` without any duplicate element (i.e. `a[i] != a[j]` for each `i != j`), I want to shuffle this array randomly and get an array `b[n]` that satisfies `b[k] != a[k]` for each `k`. This is known as [derangement](https://en.wikipedia.org/wiki/Derangement).

As far as I know, thrust and C++ STL library have no function to perform derangement. Is it possible that thrust can provide a GPU implementation of derangement? Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.