Application Acceleration With FPGAs
Programmable Acceleration Cards (PACs), DCP, FPGA AI Suite, Software Stack, and Reference Designs
477 Discussions

How to get the size of “_cl_devide_id” struct in openCL?

Aaditya_Chaudhary
760 Views

cl_device_id is defined as "typedef struct _cl_device_id *cl_device_id". In the openCL method clGetDeviceIDs, "devices" parameter is of the type "cl_device_id *" and returns a pointer to the list of devices available. I'm trying to pass the whole struct using memcpy to another variable. For which I need to know the size of the "_cl_device_id" struct.

0 Kudos
3 Replies
BoonBengT_Intel
Moderator
705 Views

Hi @Aaditya_Chaudhary,

Thank you for posting in Intel community forum, hope this message find you well and apologies for the delayed in response.
The mention '_cl_device_id' seems to be a abstract build in data types to the OpenCL platform.
As far as my understanding, you cant tell until the implementation are executed, only by then we can know the size.
Perhaps you can use something like malloc function during runtime to get the size and perform the needed, depending on what you are trying to do.
Hope this helps in clearing some doubts you have.

Warm regards.
BB

0 Kudos
BoonBengT_Intel
Moderator
686 Views

Hi @SSD001

Good day, just following up on the mention clarification. Please do let us know if that helps or any other clarification we can help with.

Warm regards

BB

0 Kudos
BoonBengT_Intel
Moderator
648 Views

Hi @Aaditya_Chaudhary,

Hope this message find you well and good day, unfortunately as we do not receive any response from you to the previous clarification that we have provided. Please post a response in the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you with your follow-up questions. 

 

Warm Regards

BB

0 Kudos
Reply