Implemented a static resampling kernel that handles allocation