Hacker News new | past | comments | ask | show | jobs | submit login

Good point. Something like

    Arrays.sort(arr, Concurrency.LEVEL)
might have been more flexible. Do I want to use the GPU if available? With which priority should it run, max. performance or more as a background task?



GPU won't handle the comparable interface at all. And the memory transfer CPU<=>GPU would be a true killer. It may work on Direct ByteBuffers only but that's entirely a different subject.


Is that still true with the new unified memory architecture (hUMA) that AMD introduced? I agree GPUs probably can't handle more complicated comparators well, but Arrays.sort() could optimize at least for the primitive types.


hUMA is brand new and no actual support but in order to work properly the CPU has to stall waiting for the GPU.

GPU should be interruptible the same way the CPU is, so if the GC decides to move the memory it can actually do so. The memory can be pinned instead, though. The latter poses some side effects with the GC. If the GPU is not on the same die it will have to virtually copy the array as the L1/L2 caches won't be accessible.

Arrays.sort(somePrimitive[]) would be too much of an edge case to optimize for. Overall hard nut to crack. Java8 streams and direct buffers, however, could be a good starting point to perform various operations via the GPU.

Disclaimer: I am really not well versed in the GPU tech.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: