|
1 | 1 | /******************************************************************************* |
2 | | -// Copyright (c) 2021-2024 Ben Ashbaugh |
| 2 | +// Copyright (c) 2021-2025 Ben Ashbaugh |
3 | 3 | // |
4 | 4 | // SPDX-License-Identifier: MIT or Apache-2.0 |
5 | 5 | */ |
@@ -751,6 +751,17 @@ typedef cl_int (CL_API_CALL* clTerminateContextKHR_clextfn)( |
751 | 751 | #pragma message("Define for cl_khr_terminate_context was not found! Please update your headers.") |
752 | 752 | #endif // defined(cl_khr_terminate_context) |
753 | 753 |
|
| 754 | +#if defined(cl_ext_buffer_device_address) |
| 755 | + |
| 756 | +typedef cl_int (CL_API_CALL* clSetKernelArgDevicePointerEXT_clextfn)( |
| 757 | + cl_kernel kernel, |
| 758 | + cl_uint arg_index, |
| 759 | + cl_mem_device_address_ext arg_value); |
| 760 | + |
| 761 | +#else |
| 762 | +#pragma message("Define for cl_ext_buffer_device_address was not found! Please update your headers.") |
| 763 | +#endif // defined(cl_ext_buffer_device_address) |
| 764 | + |
754 | 765 | #if defined(cl_ext_device_fission) |
755 | 766 |
|
756 | 767 | typedef cl_int (CL_API_CALL* clReleaseDeviceEXT_clextfn)( |
@@ -1440,6 +1451,10 @@ struct openclext_dispatch_table { |
1440 | 1451 | clTerminateContextKHR_clextfn clTerminateContextKHR; |
1441 | 1452 | #endif // defined(cl_khr_terminate_context) |
1442 | 1453 |
|
| 1454 | +#if defined(cl_ext_buffer_device_address) |
| 1455 | + clSetKernelArgDevicePointerEXT_clextfn clSetKernelArgDevicePointerEXT; |
| 1456 | +#endif // defined(cl_ext_buffer_device_address) |
| 1457 | + |
1443 | 1458 | #if defined(cl_ext_device_fission) |
1444 | 1459 | clReleaseDeviceEXT_clextfn clReleaseDeviceEXT; |
1445 | 1460 | clRetainDeviceEXT_clextfn clRetainDeviceEXT; |
@@ -1716,6 +1731,10 @@ static void _init(cl_platform_id platform, openclext_dispatch_table* dispatch_pt |
1716 | 1731 | CLEXT_GET_EXTENSION(clTerminateContextKHR); |
1717 | 1732 | #endif // defined(cl_khr_terminate_context) |
1718 | 1733 |
|
| 1734 | +#if defined(cl_ext_buffer_device_address) |
| 1735 | + CLEXT_GET_EXTENSION(clSetKernelArgDevicePointerEXT); |
| 1736 | +#endif // defined(cl_ext_buffer_device_address) |
| 1737 | + |
1719 | 1738 | #if defined(cl_ext_device_fission) |
1720 | 1739 | CLEXT_GET_EXTENSION(clReleaseDeviceEXT); |
1721 | 1740 | CLEXT_GET_EXTENSION(clRetainDeviceEXT); |
@@ -3409,6 +3428,25 @@ cl_int CL_API_CALL clTerminateContextKHR( |
3409 | 3428 |
|
3410 | 3429 | #endif // defined(cl_khr_terminate_context) |
3411 | 3430 |
|
| 3431 | +#if defined(cl_ext_buffer_device_address) |
| 3432 | + |
| 3433 | +cl_int CL_API_CALL clSetKernelArgDevicePointerEXT( |
| 3434 | + cl_kernel kernel, |
| 3435 | + cl_uint arg_index, |
| 3436 | + cl_mem_device_address_ext arg_value) |
| 3437 | +{ |
| 3438 | + struct openclext_dispatch_table* dispatch_ptr = _get_dispatch(kernel); |
| 3439 | + if (dispatch_ptr == nullptr || dispatch_ptr->clSetKernelArgDevicePointerEXT == nullptr) { |
| 3440 | + return CL_INVALID_OPERATION; |
| 3441 | + } |
| 3442 | + return dispatch_ptr->clSetKernelArgDevicePointerEXT( |
| 3443 | + kernel, |
| 3444 | + arg_index, |
| 3445 | + arg_value); |
| 3446 | +} |
| 3447 | + |
| 3448 | +#endif // defined(cl_ext_buffer_device_address) |
| 3449 | + |
3412 | 3450 | #if defined(cl_ext_device_fission) |
3413 | 3451 |
|
3414 | 3452 | cl_int CL_API_CALL clReleaseDeviceEXT( |
|
0 commit comments