Vectorization of field access
- Dominant language
- Julia
- Stars
- 1.4k
- Forks
- 281
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 30
Description
The code
```julia
using CUDAdrv, CUDAnative
k(a,b) = (@inbounds a[1] = b[1]; nothing)
t = CuArray([(0x0,0x0)])
@device_code_sass @cuda k(t, t)
```
, as well as
```julia
struct AAA; x::UInt8; y::UInt8; end
s = CuArray([AAA(0x0,0x0)])
@device_code_sass @cuda k(s,s)
```
, generate two load and two store instructions (independently of the data type used (int, float, etc.)):
```
...
/*0028*/ LDG.E.U8 R7, [R2+0x1]; /* 0xeed0200000170207 */
/*0030*/ LDG.E.U8 R6, [R2]; /* 0xeed0200000070206 */
...
/*0058*/ STG.E.U8 [R4], R7; /* 0xeed8200000070407 */
/* 0x001ffc00ffe081f1 */
/*0068*/ STG.E.U8 [R4+-0x1], R6; /* 0xeed82ffffff70406 */
...
```
It would be amazing if the compiler could optimize that to use vectorized memory access in both cases (https://devblogs.nvidia.com/cuda-pro-tip-increase-performance-with-vectorized-memory-access/ **update:** this link is not totally about what I'm referring to, see comments below).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.