Skip to content

Commit f7072c2

Browse files
committed
Merge branch 'main' into cl_khr_unified_svm
2 parents 7c5d2a1 + 4fc214a commit f7072c2

11 files changed

+55
-11
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021-2024 Ben Ashbaugh
1+
# Copyright (c) 2021-2025 Ben Ashbaugh
22
#
33
# SPDX-License-Identifier: MIT or Apache-2.0
44

@@ -78,6 +78,7 @@ set_target_properties(OpenCLExt PROPERTIES FOLDER "OpenCLExtensionLoader")
7878
set_target_properties(OpenCLExt PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
7979
target_include_directories(OpenCLExt PRIVATE ${OPENCL_EXTENSION_LOADER_INCLUDE_DIRS})
8080
target_compile_definitions(OpenCLExt PRIVATE CL_TARGET_OPENCL_VERSION=300)
81+
target_compile_definitions(OpenCLExt PRIVATE CL_ENABLE_BETA_EXTENSIONS)
8182
if (OPENCL_EXTENSION_LOADER_SINGLE_PLATFORM_ONLY)
8283
target_compile_definitions(OpenCLExt PRIVATE CLEXT_SINGLE_PLATFORM_ONLY)
8384
endif()

LICENSE-MIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2024 Ben Ashbaugh
3+
Copyright (c) 2021-2025 Ben Ashbaugh
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

scripts/call_all.c.mako

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ defaultValueForType = {
5959
'cl_kernel_exec_info_arm' : 'CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM',
6060
'cl_kernel_sub_group_info' : 'CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR',
6161
'cl_mem_advice_intel' : '0',
62+
'cl_mem_device_address_ext' : '0',
6263
'cl_mutable_command_info_khr' : 'CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR',
6364
'cl_map_flags' : 'CL_MAP_READ',
6465
'cl_mem_flags' : 'CL_MEM_READ_WRITE',
@@ -122,7 +123,7 @@ def getCallArgs(params):
122123
return callstr
123124
124125
%>/*******************************************************************************
125-
// Copyright (c) 2021-2024 Ben Ashbaugh
126+
// Copyright (c) 2021-2025 Ben Ashbaugh
126127
//
127128
// SPDX-License-Identifier: MIT or Apache-2.0
128129
*/

scripts/gen_openclext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3
22

3-
# Copyright (c) 2021-2024 Ben Ashbaugh
3+
# Copyright (c) 2021-2025 Ben Ashbaugh
44
#
55
# SPDX-License-Identifier: MIT or Apache-2.0
66

scripts/openclext.cpp.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def getCParameterStrings(params):
116116
return strings
117117
118118
%>/*******************************************************************************
119-
// Copyright (c) 2021-2024 Ben Ashbaugh
119+
// Copyright (c) 2021-2025 Ben Ashbaugh
120120
//
121121
// SPDX-License-Identifier: MIT or Apache-2.0
122122
*/

src/openclext.cpp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
// Copyright (c) 2021-2024 Ben Ashbaugh
2+
// Copyright (c) 2021-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT or Apache-2.0
55
*/
@@ -787,6 +787,17 @@ typedef cl_int (CL_API_CALL* clGetSVMSuggestedTypeIndexKHR_clextfn)(
787787
#pragma message("Define for cl_khr_unified_svm was not found! Please update your headers.")
788788
#endif // defined(cl_khr_unified_svm)
789789

790+
#if defined(cl_ext_buffer_device_address)
791+
792+
typedef cl_int (CL_API_CALL* clSetKernelArgDevicePointerEXT_clextfn)(
793+
cl_kernel kernel,
794+
cl_uint arg_index,
795+
cl_mem_device_address_ext arg_value);
796+
797+
#else
798+
#pragma message("Define for cl_ext_buffer_device_address was not found! Please update your headers.")
799+
#endif // defined(cl_ext_buffer_device_address)
800+
790801
#if defined(cl_ext_device_fission)
791802

792803
typedef cl_int (CL_API_CALL* clReleaseDeviceEXT_clextfn)(
@@ -1483,6 +1494,10 @@ struct openclext_dispatch_table {
14831494
clGetSVMSuggestedTypeIndexKHR_clextfn clGetSVMSuggestedTypeIndexKHR;
14841495
#endif // defined(cl_khr_unified_svm)
14851496

1497+
#if defined(cl_ext_buffer_device_address)
1498+
clSetKernelArgDevicePointerEXT_clextfn clSetKernelArgDevicePointerEXT;
1499+
#endif // defined(cl_ext_buffer_device_address)
1500+
14861501
#if defined(cl_ext_device_fission)
14871502
clReleaseDeviceEXT_clextfn clReleaseDeviceEXT;
14881503
clRetainDeviceEXT_clextfn clRetainDeviceEXT;
@@ -1766,6 +1781,10 @@ static void _init(cl_platform_id platform, openclext_dispatch_table* dispatch_pt
17661781
CLEXT_GET_EXTENSION(clGetSVMSuggestedTypeIndexKHR);
17671782
#endif // defined(cl_khr_unified_svm)
17681783

1784+
#if defined(cl_ext_buffer_device_address)
1785+
CLEXT_GET_EXTENSION(clSetKernelArgDevicePointerEXT);
1786+
#endif // defined(cl_ext_buffer_device_address)
1787+
17691788
#if defined(cl_ext_device_fission)
17701789
CLEXT_GET_EXTENSION(clReleaseDeviceEXT);
17711790
CLEXT_GET_EXTENSION(clRetainDeviceEXT);
@@ -3544,6 +3563,25 @@ cl_int CL_API_CALL clGetSVMSuggestedTypeIndexKHR(
35443563

35453564
#endif // defined(cl_khr_unified_svm)
35463565

3566+
#if defined(cl_ext_buffer_device_address)
3567+
3568+
cl_int CL_API_CALL clSetKernelArgDevicePointerEXT(
3569+
cl_kernel kernel,
3570+
cl_uint arg_index,
3571+
cl_mem_device_address_ext arg_value)
3572+
{
3573+
struct openclext_dispatch_table* dispatch_ptr = _get_dispatch(kernel);
3574+
if (dispatch_ptr == nullptr || dispatch_ptr->clSetKernelArgDevicePointerEXT == nullptr) {
3575+
return CL_INVALID_OPERATION;
3576+
}
3577+
return dispatch_ptr->clSetKernelArgDevicePointerEXT(
3578+
kernel,
3579+
arg_index,
3580+
arg_value);
3581+
}
3582+
3583+
#endif // defined(cl_ext_buffer_device_address)
3584+
35473585
#if defined(cl_ext_device_fission)
35483586

35493587
cl_int CL_API_CALL clReleaseDeviceEXT(

tests/call_all.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
// Copyright (c) 2021-2024 Ben Ashbaugh
2+
// Copyright (c) 2021-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT or Apache-2.0
55
*/
@@ -168,6 +168,10 @@ void call_all(void)
168168
clGetSVMSuggestedTypeIndexKHR(NULL, CL_SVM_TYPE_MACRO_COARSE_GRAIN_BUFFER_KHR, CL_SVM_TYPE_MACRO_COARSE_GRAIN_BUFFER_KHR, NULL, 0, NULL);
169169
#endif // cl_khr_unified_svm
170170

171+
#ifdef cl_ext_buffer_device_address
172+
clSetKernelArgDevicePointerEXT(NULL, 0, 0);
173+
#endif // cl_ext_buffer_device_address
174+
171175
#ifdef cl_ext_device_fission
172176
clReleaseDeviceEXT(NULL);
173177
clRetainDeviceEXT(NULL);

tests/dx_sharing_prototypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
// Copyright (c) 2021-2024 Ben Ashbaugh
2+
// Copyright (c) 2021-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT or Apache-2.0
55
*/

tests/loader_info_prototypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
// Copyright (c) 2023-2024 Ben Ashbaugh
2+
// Copyright (c) 2023-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT or Apache-2.0
55
*/

tests/test_extension_loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
// Copyright (c) 2021-2024 Ben Ashbaugh
2+
// Copyright (c) 2021-2025 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT or Apache-2.0
55
*/

0 commit comments

Comments
 (0)