|
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 | */
|
@@ -787,6 +787,17 @@ typedef cl_int (CL_API_CALL* clGetSVMSuggestedTypeIndexKHR_clextfn)(
|
787 | 787 | #pragma message("Define for cl_khr_unified_svm was not found! Please update your headers.")
|
788 | 788 | #endif // defined(cl_khr_unified_svm)
|
789 | 789 |
|
| 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 | + |
790 | 801 | #if defined(cl_ext_device_fission)
|
791 | 802 |
|
792 | 803 | typedef cl_int (CL_API_CALL* clReleaseDeviceEXT_clextfn)(
|
@@ -1483,6 +1494,10 @@ struct openclext_dispatch_table {
|
1483 | 1494 | clGetSVMSuggestedTypeIndexKHR_clextfn clGetSVMSuggestedTypeIndexKHR;
|
1484 | 1495 | #endif // defined(cl_khr_unified_svm)
|
1485 | 1496 |
|
| 1497 | +#if defined(cl_ext_buffer_device_address) |
| 1498 | + clSetKernelArgDevicePointerEXT_clextfn clSetKernelArgDevicePointerEXT; |
| 1499 | +#endif // defined(cl_ext_buffer_device_address) |
| 1500 | + |
1486 | 1501 | #if defined(cl_ext_device_fission)
|
1487 | 1502 | clReleaseDeviceEXT_clextfn clReleaseDeviceEXT;
|
1488 | 1503 | clRetainDeviceEXT_clextfn clRetainDeviceEXT;
|
@@ -1766,6 +1781,10 @@ static void _init(cl_platform_id platform, openclext_dispatch_table* dispatch_pt
|
1766 | 1781 | CLEXT_GET_EXTENSION(clGetSVMSuggestedTypeIndexKHR);
|
1767 | 1782 | #endif // defined(cl_khr_unified_svm)
|
1768 | 1783 |
|
| 1784 | +#if defined(cl_ext_buffer_device_address) |
| 1785 | + CLEXT_GET_EXTENSION(clSetKernelArgDevicePointerEXT); |
| 1786 | +#endif // defined(cl_ext_buffer_device_address) |
| 1787 | + |
1769 | 1788 | #if defined(cl_ext_device_fission)
|
1770 | 1789 | CLEXT_GET_EXTENSION(clReleaseDeviceEXT);
|
1771 | 1790 | CLEXT_GET_EXTENSION(clRetainDeviceEXT);
|
@@ -3544,6 +3563,25 @@ cl_int CL_API_CALL clGetSVMSuggestedTypeIndexKHR(
|
3544 | 3563 |
|
3545 | 3564 | #endif // defined(cl_khr_unified_svm)
|
3546 | 3565 |
|
| 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 | + |
3547 | 3585 | #if defined(cl_ext_device_fission)
|
3548 | 3586 |
|
3549 | 3587 | cl_int CL_API_CALL clReleaseDeviceEXT(
|
|
0 commit comments