Accessing cuCollections from CUDA.jl --- static_map in particular #2968
Unanswered
mytraya-gattu
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Do you want to use this from the host or also pass it to kernels? The former is doable by instantiating the necessary templates and wrapping the functions you need (passing an opaque pointer to a C++-allocated static_map) using a C API you can ccall from Julia. The latter is not really possible right now, or at least really hard (you'd need to similarly expose a C API but compile to PTX sources you'd link together with the kernel compilation in CUDA.jl, which isn't exposed). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a very particular problem, whose variations others might find useful as well.
I need to look up the indices of unsigned integers from a large constant array (typical sizes between 1e7-4e9) on the GPU from GPU threads: The elements of the array are known to be unique (and can be sorted beforehand). I think a static map from https://github.com/NVIDIA/cuCollections would be ideal for my use case. I want to be able to call from an arbitrary thread on the GPU the following function: Given x (which is guaranteed to be a key), what value does it correspond to?
Describe the solution you'd like
Ideally, I would like to call a function in CUDA.jl that can build a hash table for me based on arrays of keys and values, and then access the hash table from within a kernel.
Describe alternatives you've considered
I have tried to use ChatGPT / examples from cuCollections to piece together some C++ code that I can build into a library and access from julia using ccall; but I keep running into issues: In particular, I do not understand how to pass the pointer of the static_map to julia --- In julia, I would have just returned a function like lookup(x) which would give out my value.
Beta Was this translation helpful? Give feedback.
All reactions