datalen = 4096;dim=32;
A = ones(1,datalen);%[1:datalen];%rand(1,datalen);
B = repmat([1:datalen]',1,dim*dim);%rand(datalen,32*32);

disp('matlab:')
tic;
    res_double = A * B;
toc;

f_A = single(A)'; f_B = single(B)';

res_float =  f_B * f_A;
disp('cuda:')

tic;

    [res_cuda] = cuda_test3(f_B, f_A);
toc;

f_A2 = single(A); f_B2 = single(B);

disp('scprod:')
tic;
    [res_cuda2] = cuda_test4(f_A2, f_B2)';
toc;

%res1 = cuda_test(r);

dif1 = sum(abs(res_cuda - res_float));
dif2 = sum(abs(res_cuda2 - res_float));
