Open torrance opened 1 year ago
Does this work on CUDA? If so, I can take a look at how they do it and try to mirror their implementation.
Does this work on CUDA? If so, I can take a look at how they do it and try to mirror their implementation.
@jpsamaroo In fact you're right, my benchmarking shows it also fails to work with CUDA.jl. The speed is is:
(inline @inbounds
) < (function @inbounds
) == (no @inbounds
) < (zip with @inbounds
)
Should this be an issue raised with GPUCompiler? Or...?
Should this be an issue raised with GPUCompiler? Or...?
Yeah, that seems like the play.
@inbounds
applied against the kernel function definition has no effect.Additionally,
@inbounds
does not propagate through function calls within a kernel, for example by callingzip()
.The following benchmarks from https://github.com/torrance/AMDGPU-MWE/blob/main/inbounds.jl demonstrate the performance penalty. Note that the 3rd benchmark is likely doubly penalised since the call to
zip()
isn't inlined.function @inbounds
=>@inbounds
annotated at function definitioninternal @inbounds
=>@inbounds
annotated at lines with indexing operationsusing zip()
=> using azip()
to iterate and index into arrays