JuliaGPU / JuliaGPU/KernelAbstractions.jl
KernelAbstractions <-> CPU <-> CUDA terminology/API table
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 523
- Forks
- 88
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 25
Description
It'd be nice to have KernelAbstractions/CPU/CUDA "rosetta stone" in the documentation so that you can start coding quickly KernelAbstractions if you know some CUDA API.
I guess it'd be something like
| KernelAbstractions | CPU | CUDA |
|---|---|---|
@index(Local, Linear) |
mod(i, g) |
threadIdx().x |
@index(Local, Cartesian)[2] |
threadIdx().y |
|
@index(Group, Linear) |
i ÷ g |
blockIdx().x |
@index(Group, Cartesian)[2] |
blockIdx().y |
|
groupsize()[3] |
blockDim().z |
|
prod(groupsize()) |
g |
.x * .y * .z |
| workgroup (group) | thread block (block) | |
@index(Global, Linear) |
i |
DIY |
@index(Global, Cartesian)[2] |
DIY | |
local memory (@localmem) |
@cuStaticSharedMem |
|
private memory (@private) |
private to loop body | DIY? MArray? "stack allocation"? |
@uniform |
loop header | no-op? |
@synchronize |
delimit the loop | sync_threads() |
? But making CPU part concise and clear is hard.
(Note for myself: @uniform is for denoting "loop header" code that is run once. It's used for simulating GPU semantics on CPU; ref: JuliaCon 2020 | How not to write CPU code -- KernelAbstractions.jl | Valentin Churavy (16:28))
By the way, after staring at this table for a while, I wonder if it would have been cleaner if @localmem was called @groupmem and @private was called @localmem so that you don't need to have to use "private" as a terminology for "more local than local".
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the existing KernelAbstractions documentation alongside the proposed CPU/CUDA terminology and API table. Check the referenced @index, @localmem, @private, @uniform, and @synchronize concepts and the linked JuliaCon explanation. Done means publishing an accurate, concise comparison and resolving whether the memory terminology should be changed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100