AnsweredAssumed Answered

Fastest way to find similarity of two float arrays?

Question asked by bathyg on May 5, 2015
Latest reply on May 11, 2015 by realhet

Hi I am new here. I have a question regarding using GPU in computing.

 

I have two single precision float array A[1....2000] and B[1....300], A or B does not have any repeated elements within each array, each elements are from 1.0000 to 6000.0000

 

What is the fastest way to find how many elements in B are similar to elements in A? Similar here means abs(B[x]-A[y])<1E-4

 

Here is the method I used on CPU

 

Boolean array C[1......6E7], if a number, say 1234.5678 is in A, then C[12345678]=1


Then I just read a number from B, and do:  if A[B*1000]==1 then D++;

 

If I do this on GPU, will it be fast? Or array C is simply too big for the LDS?

 

Is that possible to treat these array as an image?

Outcomes