Skip to content
Merged
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
9 changes: 7 additions & 2 deletions ocl_icd_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,13 @@ static inline void _find_and_check_platforms(cl_uint num_icds) {

if (KHR_ICD2_HAS_TAG(p->pid))
{
_populate_dispatch_table(p->pid, pltfn_fn_ptr, &p->disp_data.dispatch);
spltdd_fn_ptr(p->pid, &p->disp_data);
p->disp_data = (struct _cl_disp_data *)calloc(1, sizeof(struct _cl_disp_data));
if (!p->disp_data) {
debug(D_WARN, "Not enough memory to allocate dispatch data, skipping ICD");
continue;
}
_populate_dispatch_table(p->pid, pltfn_fn_ptr, &p->disp_data->dispatch);
spltdd_fn_ptr(p->pid, p->disp_data);
debug(D_LOG, "Found icd 2 platform, using loader managed dispatch");
}

Expand Down
16 changes: 8 additions & 8 deletions ocl_icd_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ struct _cl_disp_data
(object)->dispatch)

struct platform_icd {
char *extension_suffix;
char *version;
struct vendor_icd *vicd;
cl_platform_id pid;
cl_uint ngpus; /* number of GPU devices */
cl_uint ncpus; /* number of CPU devices */
cl_uint ndevs; /* total number of devices, of all types */
struct _cl_disp_data disp_data;
char *extension_suffix;
char *version;
struct vendor_icd *vicd;
cl_platform_id pid;
cl_uint ngpus; /* number of GPU devices */
cl_uint ncpus; /* number of CPU devices */
cl_uint ndevs; /* total number of devices, of all types */
struct _cl_disp_data *disp_data;
};

__attribute__((visibility("hidden")))
Expand Down
Loading