1. A method for accessing a shared memory in a graphics processing unit (GPU), comprising: determining whether data to be read from a shared memory aligns to a boundary of the shared memory, wherein the data comprises a plurality of data blocks, and wherein the shared memory comprises a plurality of banks and a plurality of offsets; determining a swizzle pattern in which the data blocks are to be arranged for processing; based on whether the data aligns with a boundary of the shared memory and based on the determined swizzle pattern, determining an order for performing one or more wrapping functions; and accessing the shared memory by performing the one or more wrapping functions and reading the data blocks to construct the data according to the swizzle pattern.