Selecting n elements from array in sublinear time using indices?

Are GPUs or CPUs capable of selecting n elements from an array in sublinear time using indices? If so, what would be some good alternatives to achieve this?

Lets say I have an array A = {1, 5, 6, 3, 6, 2} and indices I = {2, 5, 2, 4, 1, 0}. The resulting array should be: B = {6, 2, 6, 6, 5, 1}. The time complexity for this should be sublinear with respect to the length of I.