Added the top level kernel generation (force + pruning) and fixed compilation issues