News for hackers. Stuff that matters.
Re:Bend: a high-level language that runs on GPUs (via HVM2) by molenzwiebel on Friday May 17, 2024 @02:03PM (#40392577)
If compiled with -O3 on clang, the loop is entirely optimized out: https://godbolt.org/z/M1rMY6qM9. Probably not the fairest comparison.
Re:Bend: a high-level language that runs on GPUs (via HVM2) by LightMachine on Friday May 17, 2024 @02:20PM (#40392775)
Exactly, this kind of thing always happens with these loops, which is why I think programs that allocate are fairer. But then people point out that the C allocator is terrible, so we can't make that point :')
Re:Bend: a high-level language that runs on GPUs (via HVM2) by mst on Sunday May 19, 2024 @07:59AM (#40406336)
Might be worth seeing if e.g. jemalloc is enough less terrible for the sort of examples you're looking at to help with that.

(though note that I mention jemalloc because I've had "huh, this C code now magically runs faster" experiences with it, make no claim it's the right one to look at, and am very sure that I don't know what I'm talking about sufficiently wrt allocators to be able to recognise the right one if it bit me on the leg)

Re:Bend: a high-level language that runs on GPUs (via HVM2) by ziedaniel1 on Friday May 17, 2024 @03:03PM (#40393218)
I used GCC and checked that it wasn't optimized out (which actually surprised me!)