2009 · 21 citations · 13 references
ComputingComputer ScienceHigh-performance ComputingData StructuresParallel AlgorithmsParallel ComputingGraphics Processing Unit ArchitectureGraphics Processing Unit ComputingGraphics Processing UnitsMemory HierarchyMemory Hierarchy OptimizationParallel Data StructuresCuda ProgrammingGpu ArchitectureGpu Parallel AlgorithmsLoop UnrollingMemory Access PatternsMemory Hierarchy AnalysisMemory Layout OptimizationProgram Optimization
Modern GPUs open a completely new field to optimize embarrassingly parallel algorithms. Implementing an algorithm on a GPU confronts the programmer with a new set of challenges for program optimization. Some of the most notable ones are isolating the part of the algorithm that can be optimized to run on the GPU; tuning the program for the GPU memory hierarchy whose organization and performance implications are radically different from those of general purpose CPUs; and optimizing programs at the instruction-level for the GPU. This paper makes two contributions to the performance optimizations for GPUs. We analyze different approaches for optimizing the memory usage and access patterns for GPUs and propose a class of memory layout optimizations that can take full advantage of the unique memory hierarchy of NVIDIA CUDA. Furthermore, we analyze the performance increase by fully unrolling the innermost loop of the algorithm and propose guidelines on how to best unroll a program for the GPU. In particular, even that loop unrolling is a common optimization, the performance improvement on a GPU derives from a completely different aspect of this architecture. To demonstrate these optimizations, we picked an embarrassingly parallel algorithm used to calculate gravitational forces. This algorithm allows us to demonstrate and to explain the performance increase gained by the applied optimizations. Our results show that our approach is quite effective. After applying our technique to the algorithm used in the Gravit gravity simulator, we observed a 1.27x speedup compared to the baseline GPU implementation. This represents a 87x speedup to the original CPU implementation.
13
A hierarchical O(N log N) force-calculation algorithm
Josh Barnes, Piet Hut · Nature · 1986 · 3.7K citations
Cache-conscious structure layout
Trishul Chilimbi, James R. Larus · 1999 · 337 citations · Full text