Hi Youngjin,
I understand that you want to use GPU computation in MATLAB. To use GPU computation you can convert your normal arrays into "gpuArray".
% converting normal arrays into gpuArray
[pY, pX] = gpuArray(meshgrid(linspace(-0.5,0.5,pnx),linspace(-0.5,0.5,pny)));
cnt_t=2601;
cnt_r=2601;
tr_x=gpuArray(linspace(-1,1,cnt_t));
tr_y=gpuArray(linspace(-1,1,cnt_t));
re_x=gpuArray(linspace(-2,2,cnt_r));
re_y=gpuArray(linspace(-2,2,cnt_r));
pza=gpuArray(linspace(0,5,101));
To further accelerate your computations you can also use "parfor" instead of normal "for" loop.
For more information on you can refer below documentation:
Hope it help!