CHECKED IF REF ARRAY EXT IS HAPPENING PROPERLY FOR MODES > 1 and MODES < 18 and it works fine .. moved iIdx and iFact from shared mem to register ... but still computation doesnt match with serial code