The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

xiaom000 (1) [Avatar] Offline
I am reading the book of <OpenCL in action>,one question I can't understand.

now I want to transfer data to device, the data is one array of structs,and struct has a pointer,it pointing to a block of memory,I want to transfer the array made of structs and also the ‍memory that the pointer pointing to,‍

cl_mem cl_rpModel = clCreateBuffer(context,CL_MEM_READ_WRITE|CL_MEM_COPY_HOST_PTR,COMPONENT * sizeof(RP_Model),rpModel,&status);‍

this way is wrong if the struct including a pointer,how should I do ?

can you tell me some advices?

thank you