views:

53

answers:

3

is it possible to create a linked list on a gpu using cuda?
I am trying to do this and i am finding some dificulties.
If i can't allocate dynamic memory in a cuda kernel, then how can i create a new nod and add it to the linked list?

+2  A: 

You really don't want to do this if you can help it - the best thing you can do if you can't get away from linked lists is to emulate them via arrays and use array indices rather than pointers for your links.

Paul R
A: 

I agree with Paul, linked lists are a very 'serial' way of thinking. Forget what you've learned about serial operations and just do everything at once : )

Marm0t
A: 

take a look at Thrust for the way of doing common operations

fabrizioM