Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion loader/icd.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void khrIcdVendorAdd(const char *libraryName)
KHR_ICD_TRACE("found icd 2 object, but platform is missing clIcdSetPlatformDispatchDataKHR\n");
continue;
}
if (KHR_ICD2_HAS_TAG(platforms[i]) && !((intptr_t)((platforms[i])->dispatch->clUnloadCompiler) == CL_ICD2_TAG_KHR))
if (KHR_ICD2_HAS_TAG(platforms[i]) && !KHR_ICD2_HAS_TAG2(platforms[i]))
{
KHR_ICD_TRACE("found icd 2 object, but platform is missing tag in clUnloadCompiler\n");
continue;
Expand Down
9 changes: 9 additions & 0 deletions loader/icd_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,17 @@ struct KHRDisp
struct _cl_icd_dispatch dispatch;
};

#if __CL_HAS_ANON_UNION__
#define KHR_ICD2_HAS_TAG(object) \
((object)->dispatch->clGetPlatformIDs_icd2_tag == CL_ICD2_TAG_KHR)
#define KHR_ICD2_HAS_TAG2(object) \
((object)->dispatch->clUnloadCompiler_icd2_tag == CL_ICD2_TAG_KHR)
#else
#define KHR_ICD2_HAS_TAG(object) \
(((intptr_t)((object)->dispatch->clGetPlatformIDs)) == CL_ICD2_TAG_KHR)
#define KHR_ICD2_HAS_TAG2(object) \
(((intptr_t)((object)->dispatch->clUnloadCompiler)) == CL_ICD2_TAG_KHR)
#endif

#define KHR_ICD2_DISPATCH(object) \
(KHR_ICD2_HAS_TAG(object) ? \
Expand Down