Intel® FPGA SDK for OpenCL™ Pro Edition: Programming Guide
A newer version of this document is available. Customers should click here to go to the newest version.
Visible to Intel only — GUID: yng1552497976376
Ixiasoft
Visible to Intel only — GUID: yng1552497976376
Ixiasoft
6.6.3. Using OpenCL ICD Extension APIs
Consider the following example code snippet:
extern CL_API_ENTRY cl_int CL_API_CALL clGetProfileDataDeviceIntelFPGA( cl_device_id /*device_id*/, cl_program /*program*/, cl_bool /*read_enqueue_kernels*/, cl_bool /*read_auto_enqueued*/, cl_bool /*clear_counters_after_readback*/, size_t /*param_value_size*/, void * /*param_value*/, size_t * /*param_value_size_ret*/, cl_int * /*errcode_ret*/ );
Replace the following function call:
cl_int status = clGetProfileDataDeviceIntelFPGA (device, program, false, true, false, 0, NULL, NULL, NULL);
with code using the following syntax to define and load the function pointer:
typedef cl_int (*clGetProfileDataDevice_fn) (cl_device_id, cl_program, cl_bool, cl_bool, cl_bool, size_t, void *, size_t *, cl_int *); clGetProfileDataDevice_fn get_profile_data_ptr = (clGetProfileDataDevice_fn) clGetExtensionFunctionAddressForPlatform (platform, "clGetProfileDataDeviceIntelFPGA");
and use the function pointer as the function call:
cl_int status = (get_profile_data_ptr) (device, program, false, true, false, 0, NULL, NULL, NULL);