diff --git a/src/runtime_src/xocl/api/icd/ocl_icd_bindings.cpp b/src/runtime_src/xocl/api/icd/ocl_icd_bindings.cpp index 18298a766b8..9b5a29493b4 100644 --- a/src/runtime_src/xocl/api/icd/ocl_icd_bindings.cpp +++ b/src/runtime_src/xocl/api/icd/ocl_icd_bindings.cpp @@ -22,7 +22,7 @@ // populated, trailing 0s don't matter. //static_assert(sizeof(_cl_icd_dispatch)==178*sizeof(void*),"Fix dispatch table"); -const _cl_icd_dispatch cl_icd_dispatch = { +const cl_icd_dispatch cl_icd_dispatch_obj = { clGetPlatformIDs, clGetPlatformInfo, clGetDeviceIDs, @@ -170,6 +170,11 @@ const _cl_icd_dispatch cl_icd_dispatch = { 0, //clSetProgramReleaseCallback, 0, //clSetProgramSpecializationConstant, #ifndef _WIN32 +#if (defined (__aarch64__) || defined (__arm__)) && defined (OPENCL_ICD_LOADER) + 0, //clCreateBufferWithProperties + 0, //clCreateImageWithProperties + 0, //clSetContextDestructorCallback +#else 0, 0, 0, @@ -203,4 +208,5 @@ const _cl_icd_dispatch cl_icd_dispatch = { 0, 0 #endif +#endif }; diff --git a/src/runtime_src/xocl/api/icd/ocl_icd_bindings.h b/src/runtime_src/xocl/api/icd/ocl_icd_bindings.h index 99a5b25753b..9dd3240aa5e 100644 --- a/src/runtime_src/xocl/api/icd/ocl_icd_bindings.h +++ b/src/runtime_src/xocl/api/icd/ocl_icd_bindings.h @@ -23,10 +23,20 @@ #ifdef _WIN32 # define NOMINMAX # include "windows/icd_dispatch.h" -using _cl_icd_dispatch = KHRicdVendorDispatchRec; +using cl_icd_dispatch = KHRicdVendorDispatchRec; #else +#if (defined (__aarch64__) || defined (__arm__)) && defined (OPENCL_ICD_LOADER) +// In Yocto ocl icd dispatcher is deprecated and +// opencl icd dispatcher is the recommended one. +// Using opencl icd dispatcher for embedded flows. +# include +#else +// All x86 linux distros doesn't have opencl icd dispatcher +// support so using ocl icd dispatcher for x86 flows. # include +using cl_icd_dispatch = _cl_icd_dispatch; +#endif #endif -extern const _cl_icd_dispatch cl_icd_dispatch; +extern const cl_icd_dispatch cl_icd_dispatch_obj; #endif diff --git a/src/runtime_src/xocl/core/object.h b/src/runtime_src/xocl/core/object.h index be1ecb4d3bd..00df8fcc409 100644 --- a/src/runtime_src/xocl/core/object.h +++ b/src/runtime_src/xocl/core/object.h @@ -32,13 +32,14 @@ class stream_mem; template class object { - const _cl_icd_dispatch* m_dispatch; + const cl_icd_dispatch* m_dispatch; + public: typedef XOCLTYPE xocl_type; typedef CLTYPE cl_type; - object() : m_dispatch(&cl_icd_dispatch) {} + object() : m_dispatch(&cl_icd_dispatch_obj) {} }; namespace detail {