How to pass complex structures to kernel?

Hi,

  1. I have a small problem while copying the data to my kernel
    I need to pass the structures NODE_ab which is the node of a tree.
    I am confused on how to pass the tree to my kernel

typedef struct _list
 {
	int data;
	struct _list *next;
 }_list;
 typedef struct _list * LIST;

typedef struct NODE_ab
{
 int count;
 LIST marks;
 char data;
 struct NODE_ab* right;
 struct NODE_ab* left;
} NODE_ab;
  1. Is it possible to do a clCreateBuffer with in the kernel?
    because the data is dynamic in nature and i don’t want to create a large buffer
    and also my structures are complex as defined above.

:roll:

Regards

Instead of pointers, use offsets from the start of the buffer.

For more details, please see these previous replies:

viewtopic.php?f=37&t=2900

viewtopic.php?f=37&t=3777

  1. Is it possible to do a clCreateBuffer with in the kernel?
    because the data is dynamic in nature and i don’t want to create a large buffer
    and also my structures are complex as defined above.

No, it’s not possible to allocate memory dynamically inside a kernel. People will usually allocate one large buffer and divide it into smaller pieces inside the kernel.