Adding ref array debug kernel