Skip to content

Commit

Permalink
Based layer definition on Khronos version of the header.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk committed Feb 12, 2021
1 parent 812dc54 commit 9293f88
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 36 deletions.
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ libdummycl_noext_la_CPPFLAGS = $(AM_CPPFLAGS) -DICD_WITHOUT_EXTENSION
libdummycl2_la_SOURCES = $(libdummycl_la_SOURCES)
nodist_libdummycl2_la_SOURCES = $(nodist_libdummycl_la_SOURCES)
libdummycl2_la_CPPFLAGS = $(AM_CPPFLAGS) -DICD_SUFFIX=\"2\"
libdummylayer_la_SOURCES = ocl_icd_layer.h
nodist_libdummylayer_la_SOURCES = dummy_icd_layer_gen.c

noinst_PROGRAMS=run_dummy_icd_through_our_ICDL
Expand Down
13 changes: 10 additions & 3 deletions icd_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,14 @@ def self.generate_icd_layer_source
icd_layer_source = "/**\n#{$license}\n*/\n"
icd_layer_source += <<EOF
#include <stdio.h>
#include "ocl_icd_layer.h"
#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
#define CL_USE_DEPRECATED_OPENCL_2_2_APIS
#define CL_TARGET_OPENCL_VERSION 300
#include <CL/cl_layer.h>
static struct _cl_icd_dispatch dispatch = {NULL};
static const struct _cl_icd_dispatch *tdispatch;
Expand Down Expand Up @@ -382,14 +389,14 @@ def self.generate_icd_layer_source
const struct _cl_icd_dispatch *target_dispatch,
cl_uint *num_entries_out,
const struct _cl_icd_dispatch **layer_dispatch) {
if (!target_dispatch || !layer_dispatch ||!num_entries_out || num_entries < OCL_ICD_LAST_FUNCTION+1)
if (!target_dispatch || !layer_dispatch ||!num_entries_out || num_entries < sizeof(dispatch)/sizeof(dispatch.clGetPlatformIDs))
return -1;
_init_dispatch();
tdispatch = target_dispatch;
*layer_dispatch = &dispatch;
*num_entries_out = OCL_ICD_LAST_FUNCTION+1;
*num_entries_out = sizeof(dispatch)/sizeof(dispatch.clGetPlatformIDs);
return CL_SUCCESS;
}
Expand Down
32 changes: 0 additions & 32 deletions ocl_icd_layer.h

This file was deleted.

0 comments on commit 9293f88

Please sign in to comment.