For indexing in gpuArray, how can I improve my code?
2 views (last 30 days)
function dists = compute_distances(obj,X)%X is a matrix with 10000 X 1024
gpu_xtrain=gpuArray(obj.x_train);%obj.x_train is a matrix with 1000 X 1024
for i = 1:num_test
for j =1:num_train
My CPU code executed in 5 mins.
The GPU code executed in 25mins.
I am trying to calculate the distance, but I noticed that I can use gpuArray to improve the speed.
I have no idea why it doesn't work.