This document presents a master's thesis on a GPU-based fluid simulation and rendering framework that utilizes a data structure called histogram pyramid (histopyramid) to efficiently reorganize data for algorithms that involve stream compaction and expansion. It explores the implementation of the marching cubes algorithm to extract triangle meshes from implicit functions, comparing histopyramid-based and geometry shader implementations, and includes a fluid solver optimized for GPU performance. Advanced OpenGL techniques, such as compute shaders, are employed to enhance the performance of the fluid simulation and rendering algorithms.