Skip to content

Commit f573575

Browse files
bashbaugKerilk
andauthored
clean up usage of CL_API_ENTRY (#189)
* alternate method of exporting from a dll * add back the def file * a few more CL_API_ENTRY fixes * a tiny bit of generated file cleanup * Remove `CL_API_ENTRY` from layer wrappers. * fix a few more extra CL_API_ENTRYs in tests Co-authored-by: Brice Videau <bvideau@anl.gov>
1 parent e009e32 commit f573575

7 files changed

Lines changed: 359 additions & 350 deletions

File tree

loader/icd.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
3434
#endif
3535

36+
#ifndef CL_USE_DEPRECATED_OPENCL_2_0_APIS
37+
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
38+
#endif
39+
40+
#ifndef CL_USE_DEPRECATED_OPENCL_2_1_APIS
41+
#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
42+
#endif
43+
44+
#ifndef CL_USE_DEPRECATED_OPENCL_2_2_APIS
45+
#define CL_USE_DEPRECATED_OPENCL_2_2_APIS
46+
#endif
47+
3648
#include <CL/cl.h>
3749
#include <CL/cl_ext.h>
3850
#include <CL/cl_icd.h>
@@ -42,19 +54,19 @@
4254
* type definitions
4355
*/
4456

45-
typedef CL_API_ENTRY cl_int (CL_API_CALL *pfn_clIcdGetPlatformIDs)(
57+
typedef cl_int (CL_API_CALL *pfn_clIcdGetPlatformIDs)(
4658
cl_uint num_entries,
4759
cl_platform_id *platforms,
4860
cl_uint *num_platforms) CL_API_SUFFIX__VERSION_1_0;
4961

50-
typedef CL_API_ENTRY cl_int (CL_API_CALL *pfn_clGetPlatformInfo)(
62+
typedef cl_int (CL_API_CALL *pfn_clGetPlatformInfo)(
5163
cl_platform_id platform,
5264
cl_platform_info param_name,
5365
size_t param_value_size,
5466
void * param_value,
5567
size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
5668

57-
typedef CL_API_ENTRY void *(CL_API_CALL *pfn_clGetExtensionFunctionAddress)(
69+
typedef void *(CL_API_CALL *pfn_clGetExtensionFunctionAddress)(
5870
const char *function_name) CL_API_SUFFIX__VERSION_1_0;
5971

6072
typedef struct KHRicdVendorRec KHRicdVendor;

loader/icd_dispatch.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
* OpenCL is a trademark of Apple Inc. used under license by Khronos.
1717
*/
1818

19-
#include "icd_dispatch.h"
2019
#include "icd.h"
20+
#include "icd_dispatch.h"
21+
2122
#include <stdlib.h>
2223
#include <string.h>
2324

@@ -147,7 +148,7 @@ static inline cl_int clGetPlatformIDs_body(
147148
return CL_SUCCESS;
148149
}
149150

150-
CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs_disp(
151+
cl_int CL_API_CALL clGetPlatformIDs_disp(
151152
cl_uint num_entries,
152153
cl_platform_id* platforms,
153154
cl_uint* num_platforms)
@@ -215,7 +216,7 @@ static inline void* clGetExtensionFunctionAddress_body(
215216
return NULL;
216217
}
217218

218-
CL_API_ENTRY void* CL_API_CALL clGetExtensionFunctionAddress_disp(
219+
void* CL_API_CALL clGetExtensionFunctionAddress_disp(
219220
const char* function_name)
220221
{
221222
return clGetExtensionFunctionAddress_body(
@@ -261,7 +262,7 @@ static inline void* clGetExtensionFunctionAddressForPlatform_body(
261262
function_name);
262263
}
263264

264-
CL_API_ENTRY void* CL_API_CALL clGetExtensionFunctionAddressForPlatform_disp(
265+
void* CL_API_CALL clGetExtensionFunctionAddressForPlatform_disp(
265266
cl_platform_id platform,
266267
const char* function_name)
267268
{

0 commit comments

Comments
 (0)