Skip to content

Commit

Permalink
Replace cl prefix with clIcd prefix for new entry points.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk committed Nov 28, 2023
1 parent 7b8d68c commit 6d64fa3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion icd_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def self.generate_ocl_icd_loader_gen_source
void _populate_dispatch_table(
cl_platform_id pid,
clGetFunctionAddressForPlatformKHR_fn pltfn_fn_ptr,
clIcdGetFunctionAddressForPlatformKHR_fn pltfn_fn_ptr,
struct _cl_icd_dispatch *dispatch) {
EOF
($api_entries.length+$buff).times { |i|
Expand Down
12 changes: 6 additions & 6 deletions ocl_icd_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,10 @@ static inline void _find_and_check_platforms(cl_uint num_icds) {
debug(D_WARN, "Not enough platform allocated. Skipping ICD");
continue;
}
clGetFunctionAddressForPlatformKHR_fn pltfn_fn_ptr =
_get_function_addr(dlh, picd->ext_fn_ptr, "clGetFunctionAddressForPlatformKHR");
clSetPlatformDispatchDataKHR_fn spltdd_fn_ptr =
_get_function_addr(dlh, picd->ext_fn_ptr, "clSetPlatformDispatchDataKHR");
clIcdGetFunctionAddressForPlatformKHR_fn pltfn_fn_ptr =
_get_function_addr(dlh, picd->ext_fn_ptr, "clIcdGetFunctionAddressForPlatformKHR");
clIcdSetPlatformDispatchDataKHR_fn spltdd_fn_ptr =
_get_function_addr(dlh, picd->ext_fn_ptr, "clIcdSetPlatformDispatchDataKHR");

for(j=0; j<num_platforms; j++) {
debug(D_LOG, "Checking platform %i", j);
Expand All @@ -510,12 +510,12 @@ static inline void _find_and_check_platforms(cl_uint num_icds) {
p->pid=platforms[j];

if (KHR_ICD2_HAS_TAG(p->pid) && !pltfn_fn_ptr) {
debug(D_WARN, "Found icd 2 platform, but it is missing clGetFunctionAddressForPlatformKHR, skipping it");
debug(D_WARN, "Found icd 2 platform, but it is missing clIcdGetFunctionAddressForPlatformKHR, skipping it");
continue;
}

if (KHR_ICD2_HAS_TAG(p->pid) && !spltdd_fn_ptr) {
debug(D_WARN, "Found icd 2 platform, but it is missing clSetPlatformDispatchDataKHR, skipping it");
debug(D_WARN, "Found icd 2 platform, but it is missing clIcdSetPlatformDispatchDataKHR, skipping it");
continue;
}

Expand Down
14 changes: 7 additions & 7 deletions ocl_icd_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,25 @@ struct layer_icd {
#define CL_ICD2_TAG_KHR ((size_t)0x4F50454E434C3331ULL)

typedef void * CL_API_CALL
clGetFunctionAddressForPlatformKHR_t(
clIcdGetFunctionAddressForPlatformKHR_t(
cl_platform_id platform,
const char* function_name);

typedef clGetFunctionAddressForPlatformKHR_t *
clGetFunctionAddressForPlatformKHR_fn;
typedef clIcdGetFunctionAddressForPlatformKHR_t *
clIcdGetFunctionAddressForPlatformKHR_fn;

typedef cl_int CL_API_CALL
clSetPlatformDispatchDataKHR_t(
clIcdSetPlatformDispatchDataKHR_t(
cl_platform_id platform,
void *disp_data);

typedef clSetPlatformDispatchDataKHR_t *
clSetPlatformDispatchDataKHR_fn;
typedef clIcdSetPlatformDispatchDataKHR_t *
clIcdSetPlatformDispatchDataKHR_fn;

__attribute__((visibility("hidden")))
extern void _populate_dispatch_table(
cl_platform_id platform,
clGetFunctionAddressForPlatformKHR_fn pltfn_fn_ptr,
clIcdGetFunctionAddressForPlatformKHR_fn pltfn_fn_ptr,
struct _cl_icd_dispatch* dispatch);
#endif

Expand Down

0 comments on commit 6d64fa3

Please sign in to comment.