Dnia 2011-08-23, wto o godzinie 22:41 +0800, Francis pisze:
> Hi guys,
> 
> 
> I've tried searching the web for this as well as scratching my head on
> this. :) I wonder if you have any ideas on how to 'nicely' do the
> following in parallel using the GPU:
> 
> 
> I have a list of lists e.g. [ [ a, b, c], [ a, d, f, p], [ c, d] ... ]
> 
> 
> and I want to get the sub-list with the largest length. Essentially I
> would want to have the index of that sub-list so perhaps there's a way
> to make each thread do len( ). Then I could just use a host version of
> max( ) to get the largest value. Thanks in advance guys and gals.

If I understand problem correctly, you can try to use one thread
to compute length of each list. Then you can use atomic functions
to find the longest list. This way everything will be done on the GPU,
and CPU will receive the final result.

Atomic functions (e.g. atomicInc) are available in devices
with computing capability 1.1 and higher. In practice only
GeForce 8x00 do not have them, and all other (better) cards
support those functions.

Hope that helps.

-- 
Tomasz Rybak <[email protected]> GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A  488E C654 FB33 2AD5 9860
http://member.acm.org/~tomaszrybak

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to