diff --git a/Cargo.toml b/Cargo.toml index 0b264ae..2017cb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,8 +76,8 @@ opencl-sys = { git = "https://github.com/kenba/opencl-sys-rs", branch = "develop thiserror = "2.0" [dev-dependencies] -cl3 = { path = ".", features = ["static", "CL_VERSION_1_1", "CL_VERSION_1_2", "CL_VERSION_2_0"] } -# cl3 = { path = ".", features = ["dynamic"] } +# cl3 = { path = ".", features = ["static", "CL_VERSION_1_1", "CL_VERSION_1_2", "CL_VERSION_2_0"] } +cl3 = { path = ".", features = ["dynamic"] } [[example]] name = "clinfo" diff --git a/src/d3d10.rs b/src/d3d10.rs index 8701077..3c129b5 100644 --- a/src/d3d10.rs +++ b/src/d3d10.rs @@ -29,7 +29,7 @@ use libc::c_void; #[allow(unused_imports)] use std::ptr; -#[cfg(feature = "cl_khr_d3d10_sharing")] +#[cfg(any(feature = "cl_khr_d3d10_sharing", feature = "dynamic"))] pub unsafe fn get_supported_d3d10_texture_formats_intel( context: cl_context, flags: cl_mem_flags, diff --git a/src/d3d11.rs b/src/d3d11.rs index 6ec271f..ba8b4b1 100644 --- a/src/d3d11.rs +++ b/src/d3d11.rs @@ -29,7 +29,7 @@ use libc::c_void; #[allow(unused_imports)] use std::ptr; -#[cfg(feature = "cl_khr_d3d11_sharing")] +#[cfg(any(feature = "cl_khr_d3d11_sharing", feature = "dynamic"))] pub unsafe fn get_supported_d3d11_texture_formats_intel( context: cl_context, flags: cl_mem_flags, diff --git a/src/dx9_media_sharing.rs b/src/dx9_media_sharing.rs index fb23612..46d9cc5 100644 --- a/src/dx9_media_sharing.rs +++ b/src/dx9_media_sharing.rs @@ -30,7 +30,7 @@ use libc::c_void; #[allow(unused_imports)] use std::ptr; -#[cfg(feature = "cl_intel_dx9_media_sharing")] +#[cfg(any(feature = "cl_intel_dx9_media_sharing", feature = "dynamic"))] pub unsafe fn get_device_ids_from_dx9_intel( platform: cl_platform_id, dx9_device_source: cl_dx9_device_source_intel, @@ -72,7 +72,7 @@ pub unsafe fn get_device_ids_from_dx9_intel( } } -#[cfg(feature = "cl_intel_dx9_media_sharing")] +#[cfg(any(feature = "cl_intel_dx9_media_sharing", feature = "dynamic"))] pub unsafe fn create_from_dx9_media_surface_intel( context: cl_context, flags: cl_mem_flags, @@ -96,7 +96,7 @@ pub unsafe fn create_from_dx9_media_surface_intel( } } -#[cfg(feature = "cl_intel_dx9_media_sharing")] +#[cfg(any(feature = "cl_intel_dx9_media_sharing", feature = "dynamic"))] pub unsafe fn enqueue_acquire_dx9_objects_intel( command_queue: cl_command_queue, num_objects: cl_uint, @@ -120,7 +120,7 @@ pub unsafe fn enqueue_acquire_dx9_objects_intel( } } -#[cfg(feature = "cl_intel_dx9_media_sharing")] +#[cfg(any(feature = "cl_intel_dx9_media_sharing", feature = "dynamic"))] pub unsafe fn enqueue_release_dx9_objects_intel( command_queue: cl_command_queue, num_objects: cl_uint, @@ -146,7 +146,8 @@ pub unsafe fn enqueue_release_dx9_objects_intel( #[cfg(any( feature = "cl_khr_dx9_media_sharing", - feature = "cl_intel_dx9_media_sharing" + feature = "cl_intel_dx9_media_sharing", + feature = "dynamic" ))] pub unsafe fn get_supported_dx9_media_surface_formats_intel( context: cl_context, diff --git a/src/egl.rs b/src/egl.rs index 6ea0aab..0c0a2a7 100644 --- a/src/egl.rs +++ b/src/egl.rs @@ -41,7 +41,7 @@ use std::ptr; /// # Safety /// /// This is unsafe because `cl_context` is a raw pointer. -#[cfg(feature = "cl_khr_egl_image")] +#[cfg(any(feature = "cl_khr_egl_image", feature = "dynamic"))] #[inline] pub unsafe fn create_from_egl_image( context: cl_context, @@ -82,7 +82,7 @@ pub unsafe fn create_from_egl_image( /// # Safety /// /// This is unsafe because `command_queue` is a raw pointer. -#[cfg(feature = "cl_khr_egl_image")] +#[cfg(any(feature = "cl_khr_egl_image", feature = "dynamic"))] #[inline] pub unsafe fn enqueue_acquire_egl_objects( command_queue: cl_command_queue, @@ -123,7 +123,7 @@ pub unsafe fn enqueue_acquire_egl_objects( /// # Safety /// /// This is unsafe because `command_queue` is a raw pointer. -#[cfg(feature = "cl_khr_egl_image")] +#[cfg(any(feature = "cl_khr_egl_image", feature = "dynamic"))] #[inline] pub unsafe fn enqueue_release_egl_objects( command_queue: cl_command_queue, @@ -162,7 +162,7 @@ pub unsafe fn enqueue_release_egl_objects( /// # Safety /// /// This is unsafe because context is a raw pointer. -#[cfg(feature = "cl_khr_egl_event")] +#[cfg(any(feature = "cl_khr_egl_event", feature = "dynamic"))] #[inline] pub unsafe fn create_event_from_egl_sync_khr( context: cl_context, diff --git a/src/ext.rs b/src/ext.rs index 89ba1de..7059f63 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -37,7 +37,7 @@ use std::mem; #[allow(unused_imports)] use std::ptr; -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub fn create_command_buffer_khr( queues: &[cl_command_queue], @@ -59,7 +59,7 @@ pub fn create_command_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] pub fn finalize_command_buffer_khr(command_buffer: cl_command_buffer_khr) -> Result<(), cl_int> { let status: cl_int = unsafe { cl_call!(clFinalizeCommandBufferKHR(command_buffer)) }; if CL_SUCCESS == status { @@ -69,7 +69,7 @@ pub fn finalize_command_buffer_khr(command_buffer: cl_command_buffer_khr) -> Res } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] pub unsafe fn retain_command_buffer_khr( command_buffer: cl_command_buffer_khr, ) -> Result<(), cl_int> { @@ -81,7 +81,7 @@ pub unsafe fn retain_command_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] pub unsafe fn release_command_buffer_khr( command_buffer: cl_command_buffer_khr, ) -> Result<(), cl_int> { @@ -93,7 +93,7 @@ pub unsafe fn release_command_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] pub unsafe fn enqueue_command_buffer_khr( num_queues: cl_uint, queues: *mut cl_command_queue, @@ -117,7 +117,7 @@ pub unsafe fn enqueue_command_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_barrier_with_wait_list_khr( command_buffer: cl_command_buffer_khr, @@ -141,7 +141,7 @@ pub unsafe fn command_barrier_with_wait_list_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_copy_buffer_khr( command_buffer: cl_command_buffer_khr, @@ -175,7 +175,7 @@ pub unsafe fn command_copy_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_copy_buffer_rect_khr( command_buffer: cl_command_buffer_khr, @@ -217,7 +217,7 @@ pub unsafe fn command_copy_buffer_rect_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_copy_buffer_to_image_khr( command_buffer: cl_command_buffer_khr, @@ -251,7 +251,7 @@ pub unsafe fn command_copy_buffer_to_image_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_copy_image_khr( command_buffer: cl_command_buffer_khr, @@ -285,7 +285,7 @@ pub unsafe fn command_copy_image_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_copy_image_to_buffer_khr( command_buffer: cl_command_buffer_khr, @@ -319,7 +319,7 @@ pub unsafe fn command_copy_image_to_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_fill_buffer_khr( command_buffer: cl_command_buffer_khr, @@ -353,7 +353,7 @@ pub unsafe fn command_fill_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_fill_image_khr( command_buffer: cl_command_buffer_khr, @@ -385,7 +385,7 @@ pub unsafe fn command_fill_image_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_nd_range_kernel_khr( command_buffer: cl_command_buffer_khr, @@ -421,7 +421,7 @@ pub unsafe fn command_nd_range_kernel_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_svm_memcpy_khr( command_buffer: cl_command_buffer_khr, @@ -451,7 +451,7 @@ pub unsafe fn command_svm_memcpy_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub unsafe fn command_svm_mem_fill_khr( command_buffer: cl_command_buffer_khr, @@ -483,7 +483,7 @@ pub unsafe fn command_svm_mem_fill_khr( } } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] pub fn get_command_buffer_data_khr( command_buffer: cl_command_buffer_khr, param_name: cl_command_buffer_info_khr, @@ -494,7 +494,7 @@ pub fn get_command_buffer_data_khr( get_vector(command_buffer, param_name, size) } -#[cfg(feature = "cl_khr_command_buffer")] +#[cfg(any(feature = "cl_khr_command_buffer", feature = "dynamic"))] pub fn get_command_buffer_info_khr( command_queue: cl_command_buffer_khr, param_name: cl_command_buffer_info_khr, @@ -540,7 +540,7 @@ pub fn get_command_buffer_info_khr( } } -#[cfg(feature = "cl_khr_command_buffer_multi_device")] +#[cfg(any(feature = "cl_khr_command_buffer_multi_device", feature = "dynamic"))] pub unsafe fn remap_command_buffer_khr( command_buffer: cl_command_buffer_khr, automatic: cl_bool, @@ -568,7 +568,7 @@ pub unsafe fn remap_command_buffer_khr( } } -#[cfg(feature = "cl_khr_command_buffer_mutable_dispatch")] +#[cfg(any(feature = "cl_khr_command_buffer_mutable_dispatch", feature = "dynamic"))] pub unsafe fn update_mutable_commands_khr( command_buffer: cl_command_buffer_khr, mutable_config: *const cl_mutable_base_config_khr, @@ -581,7 +581,7 @@ pub unsafe fn update_mutable_commands_khr( } } -#[cfg(feature = "cl_khr_command_buffer_mutable_dispatch")] +#[cfg(any(feature = "cl_khr_command_buffer_mutable_dispatch", feature = "dynamic"))] pub fn get_command_buffer_mutable_dispatch_data( command: cl_mutable_command_khr, param_name: cl_mutable_command_info_khr, @@ -592,7 +592,7 @@ pub fn get_command_buffer_mutable_dispatch_data( get_vector(command, param_name, size) } -#[cfg(feature = "cl_apple_setmemobjectdestructor")] +#[cfg(any(feature = "cl_apple_setmemobjectdestructor", feature = "dynamic"))] pub unsafe fn set_mem_object_destructor_apple( memobj: cl_mem, pfn_notify: Option, @@ -638,7 +638,7 @@ pub fn icd_get_platform_ids_khr() -> Result, cl_int> { } } -#[cfg(feature = "cl_khr_il_program")] +#[cfg(any(feature = "cl_khr_il_program", feature = "dynamic"))] pub fn create_program_with_il_khr(context: cl_context, il: &[u8]) -> Result { let mut status: cl_int = CL_INVALID_VALUE; let program = unsafe { @@ -656,7 +656,7 @@ pub fn create_program_with_il_khr(context: cl_context, il: &[u8]) -> Result Result<(), cl_int> { let status = cl_call!(clTerminateContextKHR(context)); if CL_SUCCESS == status { @@ -666,7 +666,7 @@ pub unsafe fn terminate_context_khr(context: cl_context) -> Result<(), cl_int> { } } -#[cfg(feature = "cl_khr_create_command_queue")] +#[cfg(any(feature = "cl_khr_create_command_queue", feature = "dynamic"))] pub fn create_command_queue_with_properties_khr( context: cl_context, device: cl_device_id, @@ -688,7 +688,7 @@ pub fn create_command_queue_with_properties_khr( } } -#[cfg(feature = "cl_ext_device_fission")] +#[cfg(any(feature = "cl_ext_device_fission", feature = "dynamic"))] pub unsafe fn release_device_ext(device: cl_device_id) -> Result<(), cl_int> { let status = cl_call!(clReleaseDeviceEXT(device)); if CL_SUCCESS == status { @@ -698,7 +698,7 @@ pub unsafe fn release_device_ext(device: cl_device_id) -> Result<(), cl_int> { } } -#[cfg(feature = "cl_ext_device_fission")] +#[cfg(any(feature = "cl_ext_device_fission", feature = "dynamic"))] pub unsafe fn retain_device_ext(device: cl_device_id) -> Result<(), cl_int> { let status = cl_call!(clRetainDeviceEXT(device)); if CL_SUCCESS == status { @@ -709,7 +709,7 @@ pub unsafe fn retain_device_ext(device: cl_device_id) -> Result<(), cl_int> { } // helper function for create_sub_devices_ext -#[cfg(feature = "cl_ext_device_fission")] +#[cfg(any(feature = "cl_ext_device_fission", feature = "dynamic"))] fn count_sub_devices_ext( in_device: cl_device_id, properties: &[cl_device_partition_property_ext], @@ -731,7 +731,7 @@ fn count_sub_devices_ext( } } -#[cfg(feature = "cl_ext_device_fission")] +#[cfg(any(feature = "cl_ext_device_fission", feature = "dynamic"))] #[allow(clippy::cast_possible_truncation)] pub fn create_sub_devices_ext( in_device: cl_device_id, @@ -760,7 +760,7 @@ pub fn create_sub_devices_ext( } } -#[cfg(feature = "cl_ext_migrate_memobject")] +#[cfg(any(feature = "cl_ext_migrate_memobject", feature = "dynamic"))] pub unsafe fn enqueue_migrate_mem_object_ext( command_queue: cl_command_queue, num_mem_objects: cl_uint, @@ -786,7 +786,7 @@ pub unsafe fn enqueue_migrate_mem_object_ext( } } -#[cfg(feature = "cl_qcom_ext_host_ptr")] +#[cfg(any(feature = "cl_qcom_ext_host_ptr", feature = "dynamic"))] pub fn get_device_image_info_qcom( device: cl_device_id, image_width: size_t, @@ -815,7 +815,7 @@ pub fn get_device_image_info_qcom( } } -#[cfg(feature = "cl_img_use_gralloc_ptr")] +#[cfg(any(feature = "cl_img_use_gralloc_ptr", feature = "dynamic"))] pub unsafe fn enqueue_acquire_gralloc_objects_img( command_queue: cl_command_queue, num_objects: cl_uint, @@ -839,7 +839,7 @@ pub unsafe fn enqueue_acquire_gralloc_objects_img( } } -#[cfg(feature = "cl_img_use_gralloc_ptr")] +#[cfg(any(feature = "cl_img_use_gralloc_ptr", feature = "dynamic"))] pub unsafe fn enqueue_release_gralloc_objects_img( command_queue: cl_command_queue, num_objects: cl_uint, @@ -863,7 +863,7 @@ pub unsafe fn enqueue_release_gralloc_objects_img( } } -#[cfg(feature = "cl_img_generate_mipmap")] +#[cfg(any(feature = "cl_img_generate_mipmap", feature = "dynamic"))] pub unsafe fn enqueue_generate_mipmap_img( command_queue: cl_command_queue, src_image: cl_mem, @@ -893,7 +893,7 @@ pub unsafe fn enqueue_generate_mipmap_img( } } -#[cfg(feature = "cl_khr_subgroups")] +#[cfg(any(feature = "cl_khr_subgroups", feature = "dynamic"))] pub fn get_kernel_sub_group_info_khr( kernel: cl_kernel, device: cl_device_id, @@ -930,7 +930,7 @@ pub fn get_kernel_sub_group_info_khr( } } -#[cfg(feature = "cl_khr_suggested_local_work_size")] +#[cfg(any(feature = "cl_khr_suggested_local_work_size", feature = "dynamic"))] pub fn get_kernel_suggested_local_work_size_khr( command_queue: cl_command_queue, kernel: cl_kernel, @@ -956,7 +956,7 @@ pub fn get_kernel_suggested_local_work_size_khr( } } -#[cfg(feature = "cl_khr_external_memory")] +#[cfg(any(feature = "cl_khr_external_memory", feature = "dynamic"))] pub unsafe fn enqueue_acquire_external_mem_objects_khr( command_queue: cl_command_queue, num_mem_objects: cl_uint, @@ -980,7 +980,7 @@ pub unsafe fn enqueue_acquire_external_mem_objects_khr( } } -#[cfg(feature = "cl_khr_external_memory")] +#[cfg(any(feature = "cl_khr_external_memory", feature = "dynamic"))] pub unsafe fn enqueue_release_external_mem_objects_khr( command_queue: cl_command_queue, num_mem_objects: cl_uint, @@ -1004,7 +1004,7 @@ pub unsafe fn enqueue_release_external_mem_objects_khr( } } -#[cfg(feature = "cl_khr_external_semaphore")] +#[cfg(any(feature = "cl_khr_external_semaphore", feature = "dynamic"))] pub fn get_semaphore_handle_for_type_khr( sema_object: cl_semaphore_khr, device: cl_device_id, @@ -1045,7 +1045,7 @@ pub fn get_semaphore_handle_for_type_khr( } } -#[cfg(feature = "cl_khr_external_semaphore_sync_fd")] +#[cfg(any(feature = "cl_khr_external_semaphore_sync_fd", feature = "dynamic"))] pub unsafe fn reimport_semaphore_sync_fd( sema_object: cl_semaphore_khr, reimport_props: *mut cl_semaphore_reimport_properties_khr, @@ -1063,7 +1063,7 @@ pub unsafe fn reimport_semaphore_sync_fd( } } -#[cfg(feature = "cl_khr_semaphore")] +#[cfg(any(feature = "cl_khr_semaphore", feature = "dynamic"))] pub fn create_semaphore_with_properties_khr( context: cl_context, sema_props: *const cl_semaphore_properties_khr, @@ -1083,7 +1083,7 @@ pub fn create_semaphore_with_properties_khr( } } -#[cfg(feature = "cl_khr_semaphore")] +#[cfg(any(feature = "cl_khr_semaphore", feature = "dynamic"))] pub unsafe fn enqueue_wait_semaphores_khr( command_queue: cl_command_queue, num_sema_objects: cl_uint, @@ -1109,7 +1109,7 @@ pub unsafe fn enqueue_wait_semaphores_khr( } } -#[cfg(feature = "cl_khr_semaphore")] +#[cfg(any(feature = "cl_khr_semaphore", feature = "dynamic"))] pub unsafe fn enqueue_signal_semaphores_khr( command_queue: cl_command_queue, num_sema_objects: cl_uint, @@ -1135,7 +1135,7 @@ pub unsafe fn enqueue_signal_semaphores_khr( } } -#[cfg(feature = "cl_khr_semaphore")] +#[cfg(any(feature = "cl_khr_semaphore", feature = "dynamic"))] pub fn get_semaphore_info_khr( sema_object: cl_semaphore_khr, param_name: cl_semaphore_info_khr, @@ -1146,7 +1146,7 @@ pub fn get_semaphore_info_khr( get_vector(sema_object, param_name, size) } -#[cfg(feature = "cl_khr_semaphore")] +#[cfg(any(feature = "cl_khr_semaphore", feature = "dynamic"))] pub unsafe fn release_semaphore_khr(sema_object: cl_semaphore_khr) -> Result<(), cl_int> { let status: cl_int = cl_call!(clReleaseSemaphoreKHR(sema_object)); if CL_SUCCESS == status { @@ -1156,7 +1156,7 @@ pub unsafe fn release_semaphore_khr(sema_object: cl_semaphore_khr) -> Result<(), } } -#[cfg(feature = "cl_khr_semaphore")] +#[cfg(any(feature = "cl_khr_semaphore", feature = "dynamic"))] pub unsafe fn retain_semaphore_khr(sema_object: cl_semaphore_khr) -> Result<(), cl_int> { let status: cl_int = cl_call!(clRetainSemaphoreKHR(sema_object)); if CL_SUCCESS == status { @@ -1166,7 +1166,7 @@ pub unsafe fn retain_semaphore_khr(sema_object: cl_semaphore_khr) -> Result<(), } } -#[cfg(feature = "cl_arm_import_memory")] +#[cfg(any(feature = "cl_arm_import_memory", feature = "dynamic"))] pub unsafe fn import_memory_arm( context: cl_context, flags: cl_mem_flags, @@ -1190,7 +1190,7 @@ pub unsafe fn import_memory_arm( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub unsafe fn svm_alloc_arm( context: cl_context, flags: cl_svm_mem_flags_arm, @@ -1205,13 +1205,13 @@ pub unsafe fn svm_alloc_arm( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub unsafe fn svm_free_arm(context: cl_context, svm_pointer: *mut c_void) -> Result<(), cl_int> { cl_call!(clSVMFreeARM(context, svm_pointer)); Ok(()) } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub unsafe fn enqueue_svm_free_arm( command_queue: cl_command_queue, num_svm_pointers: cl_uint, @@ -1246,7 +1246,7 @@ pub unsafe fn enqueue_svm_free_arm( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub unsafe fn enqueue_svm_mem_cpy_arm( command_queue: cl_command_queue, blocking_copy: cl_bool, @@ -1274,7 +1274,7 @@ pub unsafe fn enqueue_svm_mem_cpy_arm( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub unsafe fn enqueue_svm_mem_fill_arm( command_queue: cl_command_queue, svm_ptr: *mut c_void, @@ -1302,7 +1302,7 @@ pub unsafe fn enqueue_svm_mem_fill_arm( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub unsafe fn enqueue_svm_map_arm( command_queue: cl_command_queue, blocking_map: cl_bool, @@ -1330,7 +1330,7 @@ pub unsafe fn enqueue_svm_map_arm( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub unsafe fn enqueue_svm_unmap_arm( command_queue: cl_command_queue, svm_ptr: *mut c_void, @@ -1352,7 +1352,7 @@ pub unsafe fn enqueue_svm_unmap_arm( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub fn set_kernel_arg_svm_pointer( kernel: cl_kernel, arg_index: cl_uint, @@ -1367,7 +1367,7 @@ pub fn set_kernel_arg_svm_pointer( } } -#[cfg(feature = "cl_arm_shared_virtual_memory")] +#[cfg(any(feature = "cl_arm_shared_virtual_memory", feature = "dynamic"))] pub fn set_kernel_exec_info_arm( kernel: cl_kernel, param_name: cl_kernel_exec_info_arm, @@ -1389,7 +1389,7 @@ pub fn set_kernel_exec_info_arm( } } -#[cfg(feature = "cl_intel_accelerator")] +#[cfg(any(feature = "cl_intel_accelerator", feature = "dynamic"))] pub fn create_accelerator_intel( context: cl_context, accelerator_type: cl_accelerator_type_intel, @@ -1413,7 +1413,7 @@ pub fn create_accelerator_intel( } } -#[cfg(feature = "cl_intel_accelerator")] +#[cfg(any(feature = "cl_intel_accelerator", feature = "dynamic"))] pub fn get_accelerator_data_intel( accelerator: cl_accelerator_intel, param_name: cl_accelerator_info_intel, @@ -1424,7 +1424,7 @@ pub fn get_accelerator_data_intel( get_vector(accelerator, param_name, size) } -#[cfg(feature = "cl_intel_accelerator")] +#[cfg(any(feature = "cl_intel_accelerator", feature = "dynamic"))] pub fn get_accelerator_info_intel( accelerator: cl_accelerator_intel, param_name: cl_accelerator_info_intel, @@ -1450,7 +1450,7 @@ pub fn get_accelerator_info_intel( } } -#[cfg(feature = "cl_intel_accelerator")] +#[cfg(any(feature = "cl_intel_accelerator", feature = "dynamic"))] pub unsafe fn retain_accelerator_intel(accelerator: cl_accelerator_intel) -> Result<(), cl_int> { let status = cl_call!(clRetainAcceleratorINTEL(accelerator)); if CL_SUCCESS == status { @@ -1460,7 +1460,7 @@ pub unsafe fn retain_accelerator_intel(accelerator: cl_accelerator_intel) -> Res } } -#[cfg(feature = "cl_intel_accelerator")] +#[cfg(any(feature = "cl_intel_accelerator", feature = "dynamic"))] pub unsafe fn release_accelerator_intel(accelerator: cl_accelerator_intel) -> Result<(), cl_int> { let status = cl_call!(clReleaseAcceleratorINTEL(accelerator)); if CL_SUCCESS == status { @@ -1470,7 +1470,7 @@ pub unsafe fn release_accelerator_intel(accelerator: cl_accelerator_intel) -> Re } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn host_mem_alloc_intel( context: cl_context, properties: *const cl_mem_properties_intel, @@ -1492,7 +1492,7 @@ pub unsafe fn host_mem_alloc_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn device_mem_alloc_intel( context: cl_context, device: cl_device_id, @@ -1516,7 +1516,7 @@ pub unsafe fn device_mem_alloc_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn shared_mem_alloc_intel( context: cl_context, device: cl_device_id, @@ -1540,7 +1540,7 @@ pub unsafe fn shared_mem_alloc_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn mem_free_intel(context: cl_context, ptr: *mut c_void) -> Result<(), cl_int> { let status = cl_call!(clMemFreeINTEL(context, ptr)); if CL_SUCCESS == status { @@ -1550,7 +1550,7 @@ pub unsafe fn mem_free_intel(context: cl_context, ptr: *mut c_void) -> Result<() } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn mem_blocking_free_intel(context: cl_context, ptr: *mut c_void) -> Result<(), cl_int> { let status = cl_call!(clMemBlockingFreeINTEL(context, ptr)); if CL_SUCCESS == status { @@ -1560,7 +1560,7 @@ pub unsafe fn mem_blocking_free_intel(context: cl_context, ptr: *mut c_void) -> } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] fn mem_alloc_info_intel( context: cl_context, ptr: *const c_void, @@ -1585,7 +1585,7 @@ fn mem_alloc_info_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub fn get_mem_alloc_info_intel( context: cl_context, ptr: *const c_void, @@ -1645,7 +1645,7 @@ pub fn get_mem_alloc_info_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn set_kernel_arg_mem_pointer_intel( kernel: cl_kernel, arg_index: cl_uint, @@ -1659,7 +1659,7 @@ pub unsafe fn set_kernel_arg_mem_pointer_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn enqueue_mem_set_intel( command_queue: cl_command_queue, dst_ptr: *mut c_void, @@ -1685,7 +1685,7 @@ pub unsafe fn enqueue_mem_set_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn enqueue_mem_fill_intel( command_queue: cl_command_queue, dst_ptr: *mut c_void, @@ -1713,7 +1713,7 @@ pub unsafe fn enqueue_mem_fill_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn enqueue_mem_copy_intel( command_queue: cl_command_queue, blocking: cl_bool, @@ -1741,7 +1741,7 @@ pub unsafe fn enqueue_mem_copy_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn enqueue_migrate_mem_intel( command_queue: cl_command_queue, ptr: *const c_void, @@ -1767,7 +1767,7 @@ pub unsafe fn enqueue_migrate_mem_intel( } } -#[cfg(feature = "cl_intel_unified_shared_memory")] +#[cfg(any(feature = "cl_intel_unified_shared_memory", feature = "dynamic"))] pub unsafe fn enqueue_mem_advise_intel( command_queue: cl_command_queue, ptr: *const c_void, @@ -1793,7 +1793,7 @@ pub unsafe fn enqueue_mem_advise_intel( } } -#[cfg(feature = "cl_intel_create_buffer_with_properties")] +#[cfg(any(feature = "cl_intel_create_buffer_with_properties", feature = "dynamic"))] pub unsafe fn create_buffer_with_properties_intel( context: cl_context, properties: *const cl_mem_properties_intel, @@ -1817,7 +1817,7 @@ pub unsafe fn create_buffer_with_properties_intel( } } -#[cfg(feature = "cl_intel_program_scope_host_pipe")] +#[cfg(any(feature = "cl_intel_program_scope_host_pipe", feature = "dynamic"))] pub unsafe fn enqueue_read_host_pipe_intel( command_queue: cl_command_queue, program: cl_program, @@ -1847,7 +1847,7 @@ pub unsafe fn enqueue_read_host_pipe_intel( } } -#[cfg(feature = "cl_intel_program_scope_host_pipe")] +#[cfg(any(feature = "cl_intel_program_scope_host_pipe", feature = "dynamic"))] pub unsafe fn enqueue_write_host_pipe_intel( command_queue: cl_command_queue, program: cl_program, @@ -1877,7 +1877,7 @@ pub unsafe fn enqueue_write_host_pipe_intel( } } -#[cfg(feature = "cl_ext_image_requirements_info")] +#[cfg(any(feature = "cl_ext_image_requirements_info", feature = "dynamic"))] pub fn get_image_requirements_info_ext( context: cl_context, properties: *const cl_mem_properties, @@ -1961,7 +1961,7 @@ pub fn get_icd_loader_info_oclicd(param_name: cl_icdl_info) -> Result, c } } -#[cfg(feature = "cl_pocl_content_size")] +#[cfg(any(feature = "cl_pocl_content_size", feature = "dynamic"))] pub fn set_content_size_buffer_pocl( buffer: cl_mem, content_size_buffer: cl_mem, diff --git a/src/gl.rs b/src/gl.rs index 0a4fd2d..b936a07 100644 --- a/src/gl.rs +++ b/src/gl.rs @@ -387,7 +387,7 @@ pub unsafe fn create_from_gl_texture_3d( /// /// returns a Result containing the desired information in an `InfoType` enum /// or the error code from the `OpenCL` C API function. -#[cfg(feature = "cl_khr_gl_sharing")] +#[cfg(any(feature = "cl_khr_gl_sharing", feature = "dynamic"))] pub fn get_gl_context_info_khr( properties: *mut cl_context_properties, param_name: cl_gl_context_info, @@ -496,7 +496,7 @@ pub fn get_gl_context_info_khr( /// /// returns a Result containing the new `OpenCL` event /// or the error code from the `OpenCL` C API function. -#[cfg(feature = "cl_khr_gl_event")] +#[cfg(any(feature = "cl_khr_gl_event", feature = "dynamic"))] #[inline] pub fn create_event_from_gl_sync_khr( context: cl_context,