I am new to Jacket. I am exploring using Jacket to optimize the following function. This function is very close to multiplying a matrix with its transpose, but the min of two elements is used instead of the product. Because this function is very close to matrix multiplication, it stands to reason that it should perform well on a GPU. Unfortunately, I do not know how to convert this function to a format that is well suited for Jacket.

Any help would be appreciated.

- Code: Select all
`function y = jackettest( x )`

m = size(x,2);

y = nan( size(x), class(x) );

for j = 1 : m

for k = 1 : m

y(k,j) = sum( min( x(:,k), x(:,j) ) );

end

end

------------------------------------------------------------------------

Windows Vista on i7 CPU with 8 GB RAM

CUDA driver 270.81, CUDA toolkit 4.0

GPU0 Quadro 2000 D, 994 MB, Compute 2.1 (single,double)