diff --git a/kernels/common/device.cpp b/kernels/common/device.cpp index 7ccaad635c..a596ffa0b9 100644 --- a/kernels/common/device.cpp +++ b/kernels/common/device.cpp @@ -665,18 +665,18 @@ namespace embree bool ze_rtas_builder = false; for (uint32_t i=0; i(); gpu_maxComputeUnits = getGPUDevice().get_info(); diff --git a/kernels/level_zero/ze_api.h b/kernels/level_zero/ze_api.h index 9a2f8750d0..8e09980183 100644 --- a/kernels/level_zero/ze_api.h +++ b/kernels/level_zero/ze_api.h @@ -1,11 +1,11 @@ /* * - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * * @file ze_api.h - * @version v1.7-r1.7.9 + * @version v1.15-r1.15.31 * */ #ifndef _ZE_API_H @@ -248,8 +248,17 @@ typedef enum _ze_result_t ZE_RESULT_ERROR_OVERLAPPING_REGIONS = 0x7800001a, ///< [Validation] copy operations do not support overlapping regions of ///< memory ZE_RESULT_WARNING_ACTION_REQUIRED = 0x7800001b, ///< [Sysman] an action is required to complete the desired operation + ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE = 0x7800001c, ///< [Core, Validation] kernel handle is invalid for the operation + ZE_RESULT_EXT_RTAS_BUILD_RETRY = 0x7800001d, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< failed due to insufficient resources, retry with a larger acceleration + ///< structure buffer allocation + ZE_RESULT_EXT_RTAS_BUILD_DEFERRED = 0x7800001e, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< deferred to parallel operation join + ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE = 0x7800001f, ///< [Core, Extension] operands of comparison are not compatible + ZE_RESULT_ERROR_SURVIVABILITY_MODE_DETECTED = 0x78000020, ///< [Sysman] device is in survivability mode, firmware update needed + ZE_RESULT_ERROR_ADDRESS_NOT_FOUND = 0x78000021, ///< [Core] address not found within specified or current context ZE_RESULT_ERROR_UNKNOWN = 0x7ffffffe, ///< [Core] unknown or internal error - ZE_RESULT_FORCE_UINT32 = 0x7fffffff + ZE_RESULT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RESULT_* ENUMs } ze_result_t; @@ -311,6 +320,7 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_PROPERTIES = 0x10011, ///< ::ze_event_query_kernel_timestamps_ext_properties_t ZE_STRUCTURE_TYPE_EVENT_QUERY_KERNEL_TIMESTAMPS_RESULTS_EXT_PROPERTIES = 0x10012, ///< ::ze_event_query_kernel_timestamps_results_ext_properties_t ZE_STRUCTURE_TYPE_KERNEL_MAX_GROUP_SIZE_EXT_PROPERTIES = 0x10013, ///< ::ze_kernel_max_group_size_ext_properties_t + ZE_STRUCTURE_TYPE_IMAGE_FORMAT_SUPPORT_EXT_PROPERTIES = 0x10014, ///< ::ze_image_format_support_ext_properties_t ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC = 0x00020001, ///< ::ze_relaxed_allocation_limits_exp_desc_t ZE_STRUCTURE_TYPE_MODULE_PROGRAM_EXP_DESC = 0x00020002, ///< ::ze_module_program_exp_desc_t ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_PROPERTIES = 0x00020003, ///< ::ze_scheduling_hint_exp_properties_t @@ -330,7 +340,48 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXP_PROPERTIES = 0x00020011, ///< ::ze_rtas_parallel_operation_exp_properties_t ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXP_PROPERTIES = 0x00020012, ///< ::ze_rtas_device_exp_properties_t ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXP_CB_PARAMS = 0x00020013, ///< ::ze_rtas_geometry_aabbs_exp_cb_params_t - ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_STRUCTURE_TYPE_COUNTER_BASED_EVENT_POOL_EXP_DESC = 0x00020014, ///< ::ze_event_pool_counter_based_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_COMMAND_LIST_EXP_PROPERTIES = 0x00020015, ///< ::ze_mutable_command_list_exp_properties_t + ZE_STRUCTURE_TYPE_MUTABLE_COMMAND_LIST_EXP_DESC = 0x00020016, ///< ::ze_mutable_command_list_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_COMMAND_ID_EXP_DESC = 0x00020017, ///< ::ze_mutable_command_id_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_COMMANDS_EXP_DESC = 0x00020018, ///< ::ze_mutable_commands_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_KERNEL_ARGUMENT_EXP_DESC = 0x00020019, ///< ::ze_mutable_kernel_argument_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_GROUP_COUNT_EXP_DESC = 0x0002001A, ///< ::ze_mutable_group_count_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_GROUP_SIZE_EXP_DESC = 0x0002001B, ///< ::ze_mutable_group_size_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_GLOBAL_OFFSET_EXP_DESC = 0x0002001C, ///< ::ze_mutable_global_offset_exp_desc_t + ZE_STRUCTURE_TYPE_PITCHED_ALLOC_DEVICE_EXP_PROPERTIES = 0x0002001D, ///< ::ze_device_pitched_alloc_exp_properties_t + ZE_STRUCTURE_TYPE_BINDLESS_IMAGE_EXP_DESC = 0x0002001E, ///< ::ze_image_bindless_exp_desc_t + ZE_STRUCTURE_TYPE_PITCHED_IMAGE_EXP_DESC = 0x0002001F, ///< ::ze_image_pitched_exp_desc_t + ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC = 0x00020020, ///< ::ze_mutable_graph_argument_exp_desc_t + ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC = 0x00020021, ///< ::ze_init_driver_type_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_EXT_DESC = 0x00020022, ///< ::ze_external_semaphore_ext_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WIN32_EXT_DESC = 0x00020023, ///< ::ze_external_semaphore_win32_ext_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_FD_EXT_DESC = 0x00020024, ///< ::ze_external_semaphore_fd_ext_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025, ///< ::ze_external_semaphore_signal_params_ext_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026, ///< ::ze_external_semaphore_wait_params_ext_t + ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027, ///< ::ze_driver_ddi_handles_ext_properties_t + ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT = 0x00020028, ///< ::ze_device_cache_line_size_ext_t + ZE_STRUCTURE_TYPE_DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029, ///< ::ze_device_vector_width_properties_ext_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC = 0x00020030, ///< ::ze_rtas_builder_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031, ///< ::ze_rtas_builder_build_op_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_PROPERTIES = 0x00020032, ///< ::ze_rtas_builder_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033, ///< ::ze_rtas_parallel_operation_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES = 0x00020034, ///< ::ze_rtas_device_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035, ///< ::ze_rtas_geometry_aabbs_ext_cb_params_t + ZE_STRUCTURE_TYPE_COMMAND_LIST_APPEND_PARAM_COOPERATIVE_DESC = 0x00020036, ///< ::ze_command_list_append_launch_kernel_param_cooperative_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_MEMMAP_SYSMEM_EXT_DESC = 0x00020037, ///< ::ze_external_memmap_sysmem_ext_desc_t + ZE_STRUCTURE_TYPE_PITCHED_ALLOC_2DIMAGE_LINEAR_PITCH_EXP_INFO = 0x00020038, ///< ::ze_pitched_alloc_2dimage_linear_pitch_exp_info_t + ZE_STRUCTURE_TYPE_KERNEL_ALLOCATION_PROPERTIES = 0x00020039, ///< ::ze_kernel_allocation_exp_properties_t + ZE_STRUCTURE_TYPE_EVENT_COUNTER_BASED_DESC = 0x0002003A, ///< ::ze_event_counter_based_desc_t + ZE_STRUCTURE_TYPE_EVENT_COUNTER_BASED_EXTERNAL_SYNC_ALLOCATION_DESC = 0x0002003B, ///< ::ze_event_counter_based_external_sync_allocation_desc_t + ZE_STRUCTURE_TYPE_EVENT_SYNC_MODE_DESC = 0x0002003C, ///< ::ze_event_sync_mode_desc_t + ZE_STRUCTURE_TYPE_IPC_MEM_HANDLE_TYPE_EXT_DESC = 0x0002003D, ///< ::ze_ipc_mem_handle_type_ext_desc_t + ZE_STRUCTURE_TYPE_DEVICE_EVENT_PROPERTIES = 0x0002003E, ///< ::ze_device_event_properties_t + ZE_STRUCTURE_TYPE_EVENT_COUNTER_BASED_EXTERNAL_AGGREGATE_STORAGE_DESC = 0x0002003F, ///< ::ze_event_counter_based_external_aggregate_storage_desc_t + ZE_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES = 0x00020040, ///< ::ze_physical_mem_properties_t + ZE_STRUCTURE_TYPE_DEVICE_USABLEMEM_SIZE_EXT_PROPERTIES = 0x00020041, ///< ::ze_device_usablemem_size_ext_properties_t + ZE_STRUCTURE_TYPE_CUSTOM_PITCH_EXP_DESC = 0x00020042, ///< ::ze_custom_pitch_exp_desc_t + ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_STRUCTURE_TYPE_* ENUMs } ze_structure_type_t; @@ -348,7 +399,7 @@ typedef enum _ze_external_memory_type_flag_t ///< resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP = ZE_BIT(6), ///< an NT handle referring to a Direct3D 12 heap resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE = ZE_BIT(7), ///< an NT handle referring to a Direct3D 12 committed resource - ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_MEMORY_TYPE_FLAG_* ENUMs } ze_external_memory_type_flag_t; @@ -359,7 +410,7 @@ typedef enum _ze_bandwidth_unit_t ZE_BANDWIDTH_UNIT_UNKNOWN = 0, ///< The unit used for bandwidth is unknown ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC = 1, ///< Bandwidth is provided in bytes/nanosec ZE_BANDWIDTH_UNIT_BYTES_PER_CLOCK = 2, ///< Bandwidth is provided in bytes/clock - ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BANDWIDTH_UNIT_* ENUMs } ze_bandwidth_unit_t; @@ -372,7 +423,7 @@ typedef enum _ze_latency_unit_t ZE_LATENCY_UNIT_CLOCK = 2, ///< Latency is provided in clocks ZE_LATENCY_UNIT_HOP = 3, ///< Latency is provided in hops (normalized so that the lowest latency ///< link has a latency of 1 hop) - ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LATENCY_UNIT_* ENUMs } ze_latency_unit_t; @@ -420,6 +471,14 @@ typedef struct _ze_base_desc_t } ze_base_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief IPC handle to counter based event +typedef struct _ze_ipc_event_counter_based_handle_t +{ + char data[ZE_MAX_IPC_HANDLE_SIZE]; ///< [out] Opaque data representing an IPC handle + +} ze_ipc_event_counter_based_handle_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forces driver to only report devices (and sub-devices) as specified by /// values @@ -434,6 +493,9 @@ typedef struct _ze_base_desc_t /// @brief Defines the device hierarchy model exposed by Level Zero driver /// implementation +/////////////////////////////////////////////////////////////////////////////// +/// @brief Defines/Refines ordering of drivers reported to user + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_ipc_mem_handle_t typedef struct _ze_ipc_mem_handle_t ze_ipc_mem_handle_t; @@ -458,6 +520,14 @@ typedef struct _ze_base_properties_t ze_base_properties_t; /// @brief Forward-declare ze_base_desc_t typedef struct _ze_base_desc_t ze_base_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_ipc_event_counter_based_handle_t +typedef struct _ze_ipc_event_counter_based_handle_t ze_ipc_event_counter_based_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_init_driver_type_desc_t +typedef struct _ze_init_driver_type_desc_t ze_init_driver_type_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_driver_uuid_t typedef struct _ze_driver_uuid_t ze_driver_uuid_t; @@ -526,6 +596,10 @@ typedef struct _ze_device_external_memory_properties_t ze_device_external_memory /// @brief Forward-declare ze_device_p2p_properties_t typedef struct _ze_device_p2p_properties_t ze_device_p2p_properties_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_event_properties_t +typedef struct _ze_device_event_properties_t ze_device_event_properties_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_context_desc_t typedef struct _ze_context_desc_t ze_context_desc_t; @@ -550,10 +624,26 @@ typedef struct _ze_image_region_t ze_image_region_t; /// @brief Forward-declare ze_event_pool_desc_t typedef struct _ze_event_pool_desc_t ze_event_pool_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_event_sync_mode_desc_t +typedef struct _ze_event_sync_mode_desc_t ze_event_sync_mode_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_event_desc_t typedef struct _ze_event_desc_t ze_event_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_event_counter_based_desc_t +typedef struct _ze_event_counter_based_desc_t ze_event_counter_based_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_event_counter_based_external_sync_allocation_desc_t +typedef struct _ze_event_counter_based_external_sync_allocation_desc_t ze_event_counter_based_external_sync_allocation_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_event_counter_based_external_aggregate_storage_desc_t +typedef struct _ze_event_counter_based_external_aggregate_storage_desc_t ze_event_counter_based_external_aggregate_storage_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_kernel_timestamp_data_t typedef struct _ze_kernel_timestamp_data_t ze_kernel_timestamp_data_t; @@ -618,6 +708,10 @@ typedef struct _ze_module_constants_t ze_module_constants_t; /// @brief Forward-declare ze_module_desc_t typedef struct _ze_module_desc_t ze_module_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_command_list_append_launch_kernel_param_cooperative_desc_t +typedef struct _ze_command_list_append_launch_kernel_param_cooperative_desc_t ze_command_list_append_launch_kernel_param_cooperative_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_module_properties_t typedef struct _ze_module_properties_t ze_module_properties_t; @@ -642,6 +736,10 @@ typedef struct _ze_kernel_preferred_group_size_properties_t ze_kernel_preferred_ /// @brief Forward-declare ze_group_count_t typedef struct _ze_group_count_t ze_group_count_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_group_size_t +typedef struct _ze_group_size_t ze_group_size_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_module_program_exp_desc_t typedef struct _ze_module_program_exp_desc_t ze_module_program_exp_desc_t; @@ -662,6 +760,10 @@ typedef struct _ze_sampler_desc_t ze_sampler_desc_t; /// @brief Forward-declare ze_physical_mem_desc_t typedef struct _ze_physical_mem_desc_t ze_physical_mem_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_physical_mem_properties_t +typedef struct _ze_physical_mem_properties_t ze_physical_mem_properties_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_float_atomic_ext_properties_t typedef struct _ze_float_atomic_ext_properties_t ze_float_atomic_ext_properties_t; @@ -670,6 +772,130 @@ typedef struct _ze_float_atomic_ext_properties_t ze_float_atomic_ext_properties_ /// @brief Forward-declare ze_relaxed_allocation_limits_exp_desc_t typedef struct _ze_relaxed_allocation_limits_exp_desc_t ze_relaxed_allocation_limits_exp_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_driver_ddi_handles_ext_properties_t +typedef struct _ze_driver_ddi_handles_ext_properties_t ze_driver_ddi_handles_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_ext_desc_t +typedef struct _ze_external_semaphore_ext_desc_t ze_external_semaphore_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_win32_ext_desc_t +typedef struct _ze_external_semaphore_win32_ext_desc_t ze_external_semaphore_win32_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_fd_ext_desc_t +typedef struct _ze_external_semaphore_fd_ext_desc_t ze_external_semaphore_fd_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_signal_params_ext_t +typedef struct _ze_external_semaphore_signal_params_ext_t ze_external_semaphore_signal_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_wait_params_ext_t +typedef struct _ze_external_semaphore_wait_params_ext_t ze_external_semaphore_wait_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_cache_line_size_ext_t +typedef struct _ze_device_cache_line_size_ext_t ze_device_cache_line_size_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_ext_desc_t +typedef struct _ze_rtas_builder_ext_desc_t ze_rtas_builder_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_ext_properties_t +typedef struct _ze_rtas_builder_ext_properties_t ze_rtas_builder_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_parallel_operation_ext_properties_t +typedef struct _ze_rtas_parallel_operation_ext_properties_t ze_rtas_parallel_operation_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_device_ext_properties_t +typedef struct _ze_rtas_device_ext_properties_t ze_rtas_device_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_float3_ext_t +typedef struct _ze_rtas_float3_ext_t ze_rtas_float3_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_column_major_ext_t +typedef struct _ze_rtas_transform_float3x4_column_major_ext_t ze_rtas_transform_float3x4_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_aligned_column_major_ext_t +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t ze_rtas_transform_float3x4_aligned_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_row_major_ext_t +typedef struct _ze_rtas_transform_float3x4_row_major_ext_t ze_rtas_transform_float3x4_row_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_aabb_ext_t +typedef struct _ze_rtas_aabb_ext_t ze_rtas_aabb_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_triangle_indices_uint32_ext_t +typedef struct _ze_rtas_triangle_indices_uint32_ext_t ze_rtas_triangle_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_quad_indices_uint32_ext_t +typedef struct _ze_rtas_quad_indices_uint32_ext_t ze_rtas_quad_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_geometry_info_ext_t +typedef struct _ze_rtas_builder_geometry_info_ext_t ze_rtas_builder_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_triangles_geometry_info_ext_t +typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t ze_rtas_builder_triangles_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_quads_geometry_info_ext_t +typedef struct _ze_rtas_builder_quads_geometry_info_ext_t ze_rtas_builder_quads_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_geometry_aabbs_ext_cb_params_t +typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_t ze_rtas_geometry_aabbs_ext_cb_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_procedural_geometry_info_ext_t +typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t ze_rtas_builder_procedural_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_instance_geometry_info_ext_t +typedef struct _ze_rtas_builder_instance_geometry_info_ext_t ze_rtas_builder_instance_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_build_op_ext_desc_t +typedef struct _ze_rtas_builder_build_op_ext_desc_t ze_rtas_builder_build_op_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_vector_width_properties_ext_t +typedef struct _ze_device_vector_width_properties_ext_t ze_device_vector_width_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_memmap_sysmem_ext_desc_t +typedef struct _ze_external_memmap_sysmem_ext_desc_t ze_external_memmap_sysmem_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_kernel_allocation_exp_properties_t +typedef struct _ze_kernel_allocation_exp_properties_t ze_kernel_allocation_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_usablemem_size_ext_properties_t +typedef struct _ze_device_usablemem_size_ext_properties_t ze_device_usablemem_size_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_image_format_support_ext_properties_t +typedef struct _ze_image_format_support_ext_properties_t ze_image_format_support_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_ipc_mem_handle_type_ext_desc_t +typedef struct _ze_ipc_mem_handle_type_ext_desc_t ze_ipc_mem_handle_type_ext_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_cache_reservation_ext_desc_t typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; @@ -874,6 +1100,66 @@ typedef struct _ze_rtas_builder_instance_geometry_info_exp_t ze_rtas_builder_ins /// @brief Forward-declare ze_rtas_builder_build_op_exp_desc_t typedef struct _ze_rtas_builder_build_op_exp_desc_t ze_rtas_builder_build_op_exp_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_event_pool_counter_based_exp_desc_t +typedef struct _ze_event_pool_counter_based_exp_desc_t ze_event_pool_counter_based_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_image_bindless_exp_desc_t +typedef struct _ze_image_bindless_exp_desc_t ze_image_bindless_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_image_pitched_exp_desc_t +typedef struct _ze_image_pitched_exp_desc_t ze_image_pitched_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_pitched_alloc_exp_properties_t +typedef struct _ze_device_pitched_alloc_exp_properties_t ze_device_pitched_alloc_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_pitched_alloc_2dimage_linear_pitch_exp_info_t +typedef struct _ze_pitched_alloc_2dimage_linear_pitch_exp_info_t ze_pitched_alloc_2dimage_linear_pitch_exp_info_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_custom_pitch_exp_desc_t +typedef struct _ze_custom_pitch_exp_desc_t ze_custom_pitch_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_command_id_exp_desc_t +typedef struct _ze_mutable_command_id_exp_desc_t ze_mutable_command_id_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_command_list_exp_properties_t +typedef struct _ze_mutable_command_list_exp_properties_t ze_mutable_command_list_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_command_list_exp_desc_t +typedef struct _ze_mutable_command_list_exp_desc_t ze_mutable_command_list_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_commands_exp_desc_t +typedef struct _ze_mutable_commands_exp_desc_t ze_mutable_commands_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_kernel_argument_exp_desc_t +typedef struct _ze_mutable_kernel_argument_exp_desc_t ze_mutable_kernel_argument_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_group_count_exp_desc_t +typedef struct _ze_mutable_group_count_exp_desc_t ze_mutable_group_count_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_group_size_exp_desc_t +typedef struct _ze_mutable_group_size_exp_desc_t ze_mutable_group_size_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_global_offset_exp_desc_t +typedef struct _ze_mutable_global_offset_exp_desc_t ze_mutable_global_offset_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_graph_argument_exp_desc_t +typedef struct _ze_mutable_graph_argument_exp_desc_t ze_mutable_graph_argument_exp_desc_t; + #if !defined(__GNUC__) #pragma endregion @@ -889,7 +1175,7 @@ typedef enum _ze_init_flag_t { ZE_INIT_FLAG_GPU_ONLY = ZE_BIT(0), ///< only initialize GPU drivers ZE_INIT_FLAG_VPU_ONLY = ZE_BIT(1), ///< only initialize VPU drivers - ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_INIT_FLAG_* ENUMs } ze_init_flag_t; @@ -897,8 +1183,9 @@ typedef enum _ze_init_flag_t /// @brief Initialize the 'oneAPI' driver(s) /// /// @details -/// - The application must call this function before calling any other -/// function. +/// - @deprecated since 1.10. Please use zeInitDrivers() +/// - The application must call this function or zeInitDrivers before +/// calling any other function. /// - If this function is not called then all other functions will return /// ::ZE_RESULT_ERROR_UNINITIALIZED. /// - Only one instance of each driver will be initialized per process. @@ -916,8 +1203,17 @@ typedef enum _ze_init_flag_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x3 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeInit( ze_init_flags_t flags ///< [in] initialization flags. @@ -928,6 +1224,10 @@ zeInit( /// @brief Retrieves driver instances /// /// @details +/// - @deprecated since 1.10. Please use zeInitDrivers() +/// - Usage of zeInitDrivers and zeDriverGet is mutually exclusive and +/// should not be used together. Usage of them together will result in +/// undefined behavior. /// - A driver represents a collection of physical devices. /// - Multiple calls to this function will return identical driver handles, /// in the same order. @@ -946,6 +1246,14 @@ zeInit( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -960,6 +1268,114 @@ zeDriverGet( ///< shall only retrieve that number of drivers. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported driver initialization type flags +/// +/// @details +/// - Bit Field which details the driver types to be initialized and +/// returned to the user. +/// - Value Definition: +/// - 0, do not init or retrieve any drivers. +/// - ZE_INIT_DRIVER_TYPE_FLAG_GPU, GPU Drivers are Init and driver handles +/// retrieved. +/// - ZE_INIT_DRIVER_TYPE_FLAG_NPU, NPU Drivers are Init and driver handles +/// retrieved. +/// - ZE_INIT_DRIVER_TYPE_FLAG_GPU | ZE_INIT_DRIVER_TYPE_FLAG_NPU, NPU & GPU +/// Drivers are Init and driver handles retrieved. +/// - UINT32_MAX All Drivers of any type are Init and driver handles +/// retrieved. +typedef uint32_t ze_init_driver_type_flags_t; +typedef enum _ze_init_driver_type_flag_t +{ + ZE_INIT_DRIVER_TYPE_FLAG_GPU = ZE_BIT(0), ///< initialize and retrieve GPU drivers + ZE_INIT_DRIVER_TYPE_FLAG_NPU = ZE_BIT(1), ///< initialize and retrieve NPU drivers + ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_INIT_DRIVER_TYPE_FLAG_* ENUMs + +} ze_init_driver_type_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Init Driver Type descriptor +typedef struct _ze_init_driver_type_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_init_driver_type_flags_t flags; ///< [in] driver type init flags. + ///< must be a valid combination of ::ze_init_driver_type_flag_t or UINT32_MAX; + ///< driver types are init and retrieved based on these init flags in zeInitDrivers(). + +} ze_init_driver_type_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Initialize the 'oneAPI' driver(s) based on the driver types requested +/// and retrieve the driver handles. +/// +/// @details +/// - The application must call this function or zeInit before calling any +/// other function. (zeInit is [Deprecated] and is replaced by +/// zeInitDrivers) +/// - Calls to zeInit[Deprecated] or InitDrivers will not alter the drivers +/// retrieved through either api. +/// - Drivers init through zeInit[Deprecated] or InitDrivers will not be +/// reInitialized once init in an application. The Loader will determine +/// if the already init driver needs to be delivered to the user through +/// the init type flags. +/// - Already init Drivers will not be uninitialized if the call to +/// InitDrivers does not include that driver's type. Those init drivers +/// which don't match the init flags will not have their driver handles +/// returned to the user in that InitDrivers call. +/// - If this function or zeInit[Deprecated] is not called, then all other +/// functions will return ::ZE_RESULT_ERROR_UNINITIALIZED. +/// - Only one instance of each driver will be initialized per process. +/// - A driver represents a collection of physical devices. +/// - Multiple calls to this function will return identical driver handles, +/// in the same order. +/// - The drivers returned to the caller will be based on the init types +/// which state the drivers to be included. +/// - The application may pass nullptr for pDrivers when only querying the +/// number of drivers. +/// - The application may call this function multiple times with different +/// flags or environment variables enabled. +/// - The application must call this function after forking new processes. +/// Each forked process must call this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe for scenarios +/// where multiple libraries may initialize the driver(s) simultaneously. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +/// + `nullptr == desc` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x0 == desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeInitDrivers( + uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. + ///< if count is zero, then the loader shall update the value with the + ///< total number of drivers available. + ///< if count is greater than the number of drivers available, then the + ///< loader shall update the value with the correct number of drivers available. + ze_driver_handle_t* phDrivers, ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. + ///< if count is less than the number of drivers available, then the loader + ///< shall only retrieve that number of drivers. + ze_init_driver_type_desc_t* desc ///< [in] descriptor containing the driver type initialization details + ///< including ::ze_init_driver_type_flag_t combinations. + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Supported API versions /// @@ -976,11 +1392,25 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_5 = ZE_MAKE_VERSION( 1, 5 ), ///< version 1.5 ZE_API_VERSION_1_6 = ZE_MAKE_VERSION( 1, 6 ), ///< version 1.6 ZE_API_VERSION_1_7 = ZE_MAKE_VERSION( 1, 7 ), ///< version 1.7 - ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 7 ), ///< latest known version - ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_API_VERSION_1_8 = ZE_MAKE_VERSION( 1, 8 ), ///< version 1.8 + ZE_API_VERSION_1_9 = ZE_MAKE_VERSION( 1, 9 ), ///< version 1.9 + ZE_API_VERSION_1_10 = ZE_MAKE_VERSION( 1, 10 ), ///< version 1.10 + ZE_API_VERSION_1_11 = ZE_MAKE_VERSION( 1, 11 ), ///< version 1.11 + ZE_API_VERSION_1_12 = ZE_MAKE_VERSION( 1, 12 ), ///< version 1.12 + ZE_API_VERSION_1_13 = ZE_MAKE_VERSION( 1, 13 ), ///< version 1.13 + ZE_API_VERSION_1_14 = ZE_MAKE_VERSION( 1, 14 ), ///< version 1.14 + ZE_API_VERSION_1_15 = ZE_MAKE_VERSION( 1, 15 ), ///< version 1.15 + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 15 ), ///< latest known version + ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_API_VERSION_* ENUMs } ze_api_version_t; +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_API_VERSION_CURRENT_M +/// @brief Current API version as a macro +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 15 ) +#endif // ZE_API_VERSION_CURRENT_M + /////////////////////////////////////////////////////////////////////////////// /// @brief Returns the API version supported by the specified driver /// @@ -994,6 +1424,14 @@ typedef enum _ze_api_version_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1049,6 +1487,14 @@ typedef struct _ze_driver_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1068,7 +1514,7 @@ typedef enum _ze_ipc_property_flag_t ///< ::zeMemGetIpcHandle. ZE_IPC_PROPERTY_FLAG_EVENT_POOL = ZE_BIT(1), ///< Supports passing event pools between processes. See ///< ::zeEventPoolGetIpcHandle. - ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_PROPERTY_FLAG_* ENUMs } ze_ipc_property_flag_t; @@ -1096,6 +1542,14 @@ typedef struct _ze_driver_ipc_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1138,6 +1592,14 @@ typedef struct _ze_driver_extension_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1171,6 +1633,14 @@ zeDriverGetExtensionProperties( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1202,6 +1672,14 @@ zeDriverGetExtensionFunctionAddress( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1213,6 +1691,27 @@ zeDriverGetLastErrorDescription( ///< cause of error. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves handle to default context from the driver. +/// +/// @details +/// - The implementation of this function should be lock-free. +/// - This returned context contains all the devices available in the +/// driver. +/// - This function does not return error code, to get info about failure +/// user may use ::zeDriverGetLastErrorDescription function. +/// - In case of failure, this function returns null. +/// - Details on the error can be retrieved using +/// ::zeDriverGetLastErrorDescription function. +/// +/// @returns +/// - handle of the default context +/// - nullptr +ZE_APIEXPORT ze_context_handle_t ZE_APICALL +zeDriverGetDefaultContext( + ze_driver_handle_t hDriver ///< [in] handle of the driver instance + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -1227,7 +1726,7 @@ zeDriverGetLastErrorDescription( /// - Multiple calls to this function will return identical device handles, /// in the same order. /// - The number and order of handles returned from this function is -/// affected by the ::ZE_AFFINITY_MASK and ::ZE_ENABLE_PCI_ID_DEVICE_ORDER +/// affected by the `ZE_AFFINITY_MASK` and `ZE_ENABLE_PCI_ID_DEVICE_ORDER` /// environment variables. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. @@ -1238,6 +1737,14 @@ zeDriverGetLastErrorDescription( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1276,6 +1783,14 @@ zeDeviceGet( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1295,7 +1810,7 @@ zeDeviceGetRootDevice( /// - Multiple calls to this function will return identical device handles, /// in the same order. /// - The number of handles returned from this function is affected by the -/// ::ZE_AFFINITY_MASK environment variable. +/// `ZE_AFFINITY_MASK` environment variable. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -1309,6 +1824,14 @@ zeDeviceGetRootDevice( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1335,7 +1858,7 @@ typedef enum _ze_device_type_t ZE_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZE_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZE_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_TYPE_* ENUMs } ze_device_type_t; @@ -1368,7 +1891,7 @@ typedef enum _ze_device_property_flag_t ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZE_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_PROPERTY_FLAG_* ENUMs } ze_device_property_flag_t; @@ -1381,7 +1904,7 @@ typedef struct _ze_device_properties_t ///< structure (i.e. contains stype and pNext). ze_device_type_t type; ///< [out] generic device type uint32_t vendorId; ///< [out] vendor id from PCI configuration - uint32_t deviceId; ///< [out] device id from PCI configuration + uint32_t deviceId; ///< [out] device id from PCI configuration. ///< Note, the device id uses little-endian format. ze_device_property_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_device_property_flag_t uint32_t subdeviceId; ///< [out] sub-device id. Only valid if ::ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE @@ -1444,6 +1967,14 @@ typedef struct _ze_device_thread_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1499,6 +2030,14 @@ typedef struct _ze_device_compute_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1532,7 +2071,7 @@ typedef enum _ze_device_module_flag_t ZE_DEVICE_MODULE_FLAG_FP64 = ZE_BIT(1), ///< Device supports 64-bit floating-point operations ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS = ZE_BIT(2), ///< Device supports 64-bit atomic operations ZE_DEVICE_MODULE_FLAG_DP4A = ZE_BIT(3), ///< Device supports four component dot product and accumulate operations - ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MODULE_FLAG_* ENUMs } ze_device_module_flag_t; @@ -1550,7 +2089,7 @@ typedef enum _ze_device_fp_flag_t ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT = ZE_BIT(6), ///< Supports rounding as defined by IEEE754 for divide and sqrt ///< operations. ZE_DEVICE_FP_FLAG_SOFT_FLOAT = ZE_BIT(7), ///< Uses software implementation for basic floating-point operations. - ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_FP_FLAG_* ENUMs } ze_device_fp_flag_t; @@ -1598,6 +2137,14 @@ typedef struct _ze_device_module_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1618,7 +2165,7 @@ typedef enum _ze_command_queue_group_property_flag_t ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS = ZE_BIT(2), ///< Command queue group supports cooperative kernels. ///< See ::zeCommandListAppendLaunchCooperativeKernel for more details. ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS = ZE_BIT(3), ///< Command queue groups supports metric queries. - ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_* ENUMs } ze_command_queue_group_property_flag_t; @@ -1642,12 +2189,12 @@ typedef struct _ze_command_queue_group_properties_t /// @brief Retrieves command queue group properties of the device. /// /// @details -/// - Properties are reported for each physical command queue type supported -/// by the device. +/// - Properties are reported for each physical command queue group +/// available on the device. /// - Multiple calls to this function will return properties in the same /// order. -/// - The order in which the properties are returned defines the command -/// queue group's ordinal. +/// - The order in which the properties are returned is defined by the +/// command queue group's ordinal. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -1661,6 +2208,14 @@ typedef struct _ze_command_queue_group_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1668,17 +2223,21 @@ typedef struct _ze_command_queue_group_properties_t ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetCommandQueueGroupProperties( ze_device_handle_t hDevice, ///< [in] handle of the device - uint32_t* pCount, ///< [in,out] pointer to the number of command queue group properties. - ///< if count is zero, then the driver shall update the value with the - ///< total number of command queue group properties available. - ///< if count is greater than the number of command queue group properties - ///< available, then the driver shall update the value with the correct - ///< number of command queue group properties available. + uint32_t* pCount, ///< [in,out] pointer to the number of available command queue groups. + ///< If count is zero, then the driver shall update the value with the + ///< total number of command queue groups available. + ///< If count is less than the number of command queue groups available, + ///< then the driver shall only retrieve command queue group properties for + ///< the given number of command queue groups. + ///< If count is greater than or equal to the number of command queue + ///< groups available, then the driver shall retrieve command queue group + ///< properties for all available command queue groups. ze_command_queue_group_properties_t* pCommandQueueGroupProperties ///< [in,out][optional][range(0, *pCount)] array of query results for ///< command queue group properties. - ///< if count is less than the number of command queue group properties - ///< available, then driver shall only retrieve that number of command - ///< queue group properties. + ///< If count is less than the number of command queue groups available, + ///< then the driver shall only retrieve that number of command queue group properties. + ///< The order of properties in the array corresponds to the command queue + ///< group ordinal. ); /////////////////////////////////////////////////////////////////////////////// @@ -1687,7 +2246,7 @@ typedef uint32_t ze_device_memory_property_flags_t; typedef enum _ze_device_memory_property_flag_t { ZE_DEVICE_MEMORY_PROPERTY_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTY_FLAG_* ENUMs } ze_device_memory_property_flag_t; @@ -1731,6 +2290,14 @@ typedef struct _ze_device_memory_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1763,7 +2330,7 @@ typedef enum _ze_memory_access_cap_flag_t ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC = ZE_BIT(1), ///< Supports atomic access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT = ZE_BIT(2), ///< Supports concurrent access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC = ZE_BIT(3), ///< Supports concurrent atomic access - ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_ACCESS_CAP_FLAG_* ENUMs } ze_memory_access_cap_flag_t; @@ -1805,6 +2372,14 @@ typedef struct _ze_device_memory_access_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1821,7 +2396,7 @@ typedef uint32_t ze_device_cache_property_flags_t; typedef enum _ze_device_cache_property_flag_t { ZE_DEVICE_CACHE_PROPERTY_FLAG_USER_CONTROL = ZE_BIT(0), ///< Device support User Cache Control (i.e. SLM section vs Generic Cache) - ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_CACHE_PROPERTY_FLAG_* ENUMs } ze_device_cache_property_flag_t; @@ -1855,6 +2430,14 @@ typedef struct _ze_device_cache_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1915,6 +2498,14 @@ typedef struct _ze_device_image_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1952,6 +2543,14 @@ typedef struct _ze_device_external_memory_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -1969,7 +2568,7 @@ typedef enum _ze_device_p2p_property_flag_t { ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS = ZE_BIT(0), ///< Device supports access between peer devices. ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS = ZE_BIT(1), ///< Device supports atomics between peer devices. - ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_P2P_PROPERTY_FLAG_* ENUMs } ze_device_p2p_property_flag_t; @@ -2000,6 +2599,14 @@ typedef struct _ze_device_p2p_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// + `nullptr == hPeerDevice` @@ -2039,6 +2646,14 @@ zeDeviceGetP2PProperties( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// + `nullptr == hPeerDevice` @@ -2062,11 +2677,17 @@ zeDeviceCanAccessPeer( /// - The implementation of this function must be thread-safe. /// /// @returns -/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_SUCCESS @@ -2092,49 +2713,153 @@ zeDeviceGetStatus( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == hostTimestamp` /// + `nullptr == deviceTimestamp` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + The feature is not supported by the underlying platform. ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value + ///< Device's global timestamp value. uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value + ///< Host's global timestamp value. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero APIs for Context -#if !defined(__GNUC__) -#pragma region context -#endif -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported context creation flags -typedef uint32_t ze_context_flags_t; -typedef enum _ze_context_flag_t -{ - ZE_CONTEXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff - -} ze_context_flag_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Context descriptor -typedef struct _ze_context_desc_t -{ - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_context_flags_t flags; ///< [in] creation flags. - ///< must be 0 (default) or a valid combination of ::ze_context_flag_t; - ///< default behavior may use implicit driver-based heuristics. - -} ze_context_desc_t; +/// @brief Synchronizes all command queues related to the device. +/// +/// @details +/// - The application may call this function from simultaneous threads with +/// the same device handle. +/// - The implementation of this function should be thread-safe. +/// - This function blocks until all preceding submissions to all queues on +/// the device are completed. +/// - This function returns an error if device execution fails. +/// - This function hangs indefinitely if the device is blocked on a +/// non-signaled event. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceSynchronize( + ze_device_handle_t hDevice ///< [in] handle of the device + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported Event properties flags +typedef uint32_t ze_device_event_properties_flags_t; +typedef enum _ze_device_event_properties_flag_t +{ + ZE_DEVICE_EVENT_PROPERTIES_FLAG_COUNTER_BASED_EXTERNAL_AGGREGATE_STORAGE = ZE_BIT(0), ///< Counter-based Event with external aggregate storage supported + ZE_DEVICE_EVENT_PROPERTIES_FLAG_COUNTER_BASED_IPC = ZE_BIT(1), ///< Counter-based Event IPC sharing supported + ZE_DEVICE_EVENT_PROPERTIES_FLAG_COUNTER_BASED_EXTERNAL_SYNC_ALLOCATION = ZE_BIT(2), ///< Counter-based Event with external sync allocation supported + ZE_DEVICE_EVENT_PROPERTIES_FLAG_COUNTER_BASED_EXTERNAL_INTERRUPT_WAIT = ZE_BIT(3), ///< Counter-based Event waiting for external interrupt id supported + ZE_DEVICE_EVENT_PROPERTIES_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_EVENT_PROPERTIES_FLAG_* ENUMs + +} ze_device_event_properties_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Event properties struct. Can be passed as pNext to +/// ::ze_device_properties_t to obtain properties +typedef struct _ze_device_event_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_device_event_properties_flags_t flags; ///< [out] Supported Event properties. Valid combination of + ///< ::ze_device_event_properties_flag_t. + +} ze_device_event_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns unified increment value that can be used for Counter Based +/// Events created with +/// ::ze_event_counter_based_external_aggregate_storage_desc_t +/// +/// @details +/// - Value is applicable only to this specific device +/// - It may be used, when user is not able define number of internal driver +/// operations during given append call, for example dividing copy into +/// multiple engines. More details can be found in programming guide. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == incrementValue` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceGetAggregatedCopyOffloadIncrementValue( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* incrementValue ///< [out] increment value that can be used for Event creation + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Context +#if !defined(__GNUC__) +#pragma region context +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported context creation flags +typedef uint32_t ze_context_flags_t; +typedef enum _ze_context_flag_t +{ + ZE_CONTEXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use + ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CONTEXT_FLAG_* ENUMs + +} ze_context_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Context descriptor +typedef struct _ze_context_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_context_flags_t flags; ///< [in] creation flags. + ///< must be 0 (default) or a valid combination of ::ze_context_flag_t; + ///< default behavior may use implicit driver-based heuristics. + +} ze_context_desc_t; /////////////////////////////////////////////////////////////////////////////// /// @brief Creates a context for the driver. @@ -2151,6 +2876,14 @@ typedef struct _ze_context_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -2158,6 +2891,7 @@ typedef struct _ze_context_desc_t /// + `nullptr == phContext` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x1 < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeContextCreate( ze_driver_handle_t hDriver, ///< [in] handle of the driver object @@ -2180,6 +2914,14 @@ zeContextCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -2187,6 +2929,7 @@ zeContextCreate( /// + `nullptr == phContext` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x1 < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phDevices) && (0 < numDevices)` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -2224,6 +2967,14 @@ zeContextCreateEx( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -2241,11 +2992,17 @@ zeContextDestroy( /// - The implementation of this function should be lock-free. /// /// @returns -/// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_SUCCESS @@ -2274,6 +3031,8 @@ typedef enum _ze_command_queue_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** as flag + ///< ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. ZE_COMMAND_QUEUE_FLAG_IN_ORDER = ZE_BIT(1), ///< To be used only when creating immediate command lists. Commands ///< appended to the immediate command ///< list are executed in-order, with driver implementation enforcing @@ -2283,7 +3042,12 @@ typedef enum _ze_command_queue_flag_t ///< the next to define an in-order list, and application is allowed to ///< pass signal and wait events ///< to each appended command to implement more complex dependency graphs. - ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_FLAG_COPY_OFFLOAD_HINT = ZE_BIT(2), ///< To be used only when creating immediate command lists and only for + ///< compute queues. + ///< Try to offload copy operations to different engines. This is only a hint. + ///< Driver may ignore it per append call, based on platform capabilities + ///< or internal heuristics. + ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_QUEUE_FLAG_* ENUMs } ze_command_queue_flag_t; @@ -2296,7 +3060,7 @@ typedef enum _ze_command_queue_mode_t ///< Host thread is blocked using wait on implicit synchronization object ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS = 2, ///< Device execution is scheduled and will complete in future; ///< explicit synchronization object must be used to determine completeness - ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_QUEUE_MODE_* ENUMs } ze_command_queue_mode_t; @@ -2307,7 +3071,7 @@ typedef enum _ze_command_queue_priority_t ZE_COMMAND_QUEUE_PRIORITY_NORMAL = 0, ///< [default] normal priority ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW = 1, ///< lower priority than normal ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH = 2, ///< higher priority than normal - ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_QUEUE_PRIORITY_* ENUMs } ze_command_queue_priority_t; @@ -2320,7 +3084,7 @@ typedef struct _ze_command_queue_desc_t ///< structure (i.e. contains stype and pNext). uint32_t ordinal; ///< [in] command queue group ordinal uint32_t index; ///< [in] command queue index within the group; - ///< must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set + ///< must be zero. ze_command_queue_flags_t flags; ///< [in] usage flags. ///< must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ///< default behavior may use implicit driver-based heuristics to balance @@ -2351,6 +3115,14 @@ typedef struct _ze_command_queue_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -2358,9 +3130,10 @@ typedef struct _ze_command_queue_desc_t /// + `nullptr == desc` /// + `nullptr == phCommandQueue` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` +/// + `0x7 < desc->flags` /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < desc->mode` /// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < desc->priority` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueCreate( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -2393,6 +3166,14 @@ zeCommandQueueCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandQueue` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -2433,6 +3214,14 @@ zeCommandQueueDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandQueue` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -2463,6 +3252,14 @@ zeCommandQueueExecuteCommandLists( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandQueue` /// - ::ZE_RESULT_NOT_READY @@ -2479,6 +3276,68 @@ zeCommandQueueSynchronize( ///< value allowed by the accuracy of those dependencies. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets the command queue group ordinal. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pOrdinal` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandQueueGetOrdinal( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + uint32_t* pOrdinal ///< [out] command queue group ordinal + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets the command queue index within the group. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pIndex` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandQueueGetIndex( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + uint32_t* pIndex ///< [out] command queue index within the group + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -2505,6 +3364,8 @@ typedef enum _ze_command_list_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** and implementations are not expected to + ///< support this feature. ZE_COMMAND_LIST_FLAG_IN_ORDER = ZE_BIT(3), ///< commands appended to this command list are executed in-order, with ///< driver implementation ///< enforcing dependencies between them. Application is not required to @@ -2514,7 +3375,13 @@ typedef enum _ze_command_list_flag_t ///< application is allowed to pass signal and wait events to each appended ///< command to implement ///< more complex dependency graphs. Cannot be combined with ::ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING. - ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE = ZE_BIT(4), ///< this command list may be cloned using ::zeCommandListCreateCloneExp + ///< after ::zeCommandListClose. + ZE_COMMAND_LIST_FLAG_COPY_OFFLOAD_HINT = ZE_BIT(5), ///< Try to offload copy operations to different engines. Applicable only + ///< for compute queues. + ///< This is only a hint. Driver may ignore it per append call, based on + ///< platform capabilities or internal heuristics. + ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_LIST_FLAG_* ENUMs } ze_command_list_flag_t; @@ -2552,6 +3419,14 @@ typedef struct _ze_command_list_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -2559,7 +3434,8 @@ typedef struct _ze_command_list_desc_t /// + `nullptr == desc` /// + `nullptr == phCommandList` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0xf < desc->flags` +/// + `0x3f < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListCreate( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -2592,6 +3468,14 @@ zeCommandListCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -2599,9 +3483,10 @@ zeCommandListCreate( /// + `nullptr == altdesc` /// + `nullptr == phCommandList` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < altdesc->flags` +/// + `0x7 < altdesc->flags` /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode` /// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListCreateImmediate( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -2628,6 +3513,14 @@ zeCommandListCreateImmediate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -2650,6 +3543,14 @@ zeCommandListDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -2674,6 +3575,14 @@ zeCommandListClose( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -2706,6 +3615,14 @@ zeCommandListReset( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -2745,6 +3662,13 @@ zeCommandListAppendWriteGlobalTimestamp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_NOT_READY @@ -2763,70 +3687,42 @@ zeCommandListHostSynchronize( ///< value allowed by the accuracy of those dependencies. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero APIs for Barrier -#if !defined(__GNUC__) -#pragma region barrier -#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends an execution and global memory barrier into a command list. +/// @brief Gets the handle of the device on which the command list was created. /// /// @details -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - If numWaitEvents is zero, then all previous commands, enqueued on same -/// command queue, must complete prior to the execution of the barrier. -/// This is not the case when numWaitEvents is non-zero. -/// - If numWaitEvents is non-zero, then only all phWaitEvents must be -/// signaled prior to the execution of the barrier. -/// - This command blocks all following commands from beginning until the -/// execution of the barrier completes. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - **vkCmdPipelineBarrier** -/// - clEnqueueBarrierWithWaitList -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phDevice` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendBarrier( +zeCommandListGetDeviceHandle( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing barrier + ze_device_handle_t* phDevice ///< [out] handle of the device on which the command list was created ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Appends a global memory ranges barrier into a command list. +/// @brief Gets the handle of the context on which the command list was created. /// /// @details -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - If numWaitEvents is zero, then all previous commands are completed -/// prior to the execution of the barrier. -/// - If numWaitEvents is non-zero, then then all phWaitEvents must be -/// signaled prior to the execution of the barrier. -/// - This command blocks all following commands from beginning until the -/// execution of the barrier completes. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// /// @returns @@ -2835,37 +3731,29 @@ zeCommandListAppendBarrier( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pRangeSizes` -/// + `nullptr == pRanges` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == phContext` ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendMemoryRangesBarrier( +zeCommandListGetContextHandle( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list - uint32_t numRanges, ///< [in] number of memory ranges - const size_t* pRangeSizes, ///< [in][range(0, numRanges)] array of sizes of memory range - const void** pRanges, ///< [in][range(0, numRanges)] array of memory ranges - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; - ///< must be 0 if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before executing barrier + ze_context_handle_t* phContext ///< [out] handle of the context on which the command list was created ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Ensures in-bound writes to the device are globally observable. +/// @brief Gets the command queue group ordinal to which the command list is +/// submitted. /// /// @details -/// - This is a special-case system level barrier that can be used to ensure -/// global observability of writes; -/// typically needed after a producer (e.g., NIC) performs direct writes -/// to the device's memory (e.g., Direct RDMA writes). -/// This is typically required when the memory corresponding to the writes -/// is subsequently accessed from a remote device. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -2875,38 +3763,260 @@ zeCommandListAppendMemoryRangesBarrier( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pOrdinal` ZE_APIEXPORT ze_result_t ZE_APICALL -zeContextSystemBarrier( - ze_context_handle_t hContext, ///< [in] handle of context object - ze_device_handle_t hDevice ///< [in] handle of the device +zeCommandListGetOrdinal( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t* pOrdinal ///< [out] command queue group ordinal to which command list is submitted ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero APIs for Copies -#if !defined(__GNUC__) -#pragma region copy -#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies host, device, or shared memory. +/// @brief Gets the command queue index within the group to which the immediate +/// command list is submitted. /// /// @details -/// - The application must ensure the memory pointed to by dstptr and srcptr -/// is accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr and -/// srcptr as they are free to be modified by either the Host or device up -/// until execution. -/// - The application must ensure the events are accessible by the device on -/// which the command list was created. -/// - The application must ensure the command list and events were created, -/// and the memory was allocated, on the same context. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. -/// - The implementation of this function should be lock-free. +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandListImmediate` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pIndex` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListImmediateGetIndex( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t* pIndex ///< [out] command queue index within the group to which the immediate + ///< command list is submitted + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query whether a command list is an immediate command list. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pIsImmediate` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListIsImmediate( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_bool_t* pIsImmediate ///< [out] Boolean indicating whether the command list is an immediate + ///< command list (true) or not (false) + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Barrier +#if !defined(__GNUC__) +#pragma region barrier +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends an execution and global memory barrier into a command list. +/// +/// @details +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - If numWaitEvents is zero, then all previous commands, enqueued on same +/// command queue, must complete prior to the execution of the barrier. +/// This is not the case when numWaitEvents is non-zero. +/// - If numWaitEvents is non-zero, then only all phWaitEvents must be +/// signaled prior to the execution of the barrier. +/// - This command blocks all following commands from beginning until the +/// execution of the barrier completes. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - **vkCmdPipelineBarrier** +/// - clEnqueueBarrierWithWaitList +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendBarrier( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; + ///< must be 0 if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing barrier + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends a global memory ranges barrier into a command list. +/// +/// @details +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - If numWaitEvents is zero, then all previous commands are completed +/// prior to the execution of the barrier. +/// - If numWaitEvents is non-zero, then then all phWaitEvents must be +/// signaled prior to the execution of the barrier. +/// - This command blocks all following commands from beginning until the +/// execution of the barrier completes. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRangeSizes` +/// + `nullptr == pRanges` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendMemoryRangesBarrier( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numRanges, ///< [in] number of memory ranges + const size_t* pRangeSizes, ///< [in][range(0, numRanges)] array of sizes of memory range + const void** pRanges, ///< [in][range(0, numRanges)] array of memory ranges + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; + ///< must be 0 if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing barrier + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ensures in-bound writes to the device are globally observable. +/// +/// @details +/// - This is a special-case system level barrier that can be used to ensure +/// global observability of writes; +/// typically needed after a producer (e.g., NIC) performs direct writes +/// to the device's memory (e.g., Direct RDMA writes). +/// This is typically required when the memory corresponding to the writes +/// is subsequently accessed from a remote device. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeContextSystemBarrier( + ze_context_handle_t hContext, ///< [in] handle of context object + ze_device_handle_t hDevice ///< [in] handle of the device + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Copies +#if !defined(__GNUC__) +#pragma region copy +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Copies host, device, or shared memory. +/// +/// @details +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - The application must ensure the command list and events were created, +/// and the memory was allocated, on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. /// /// @remarks /// _Analogues_ @@ -2921,6 +4031,14 @@ zeContextSystemBarrier( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -2946,11 +4064,12 @@ zeCommandListAppendMemoryCopy( /// @brief Initializes host, device, or shared memory. /// /// @details -/// - The application must ensure the memory pointed to by dstptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr as -/// it is free to be modified by either the Host or device up until +/// - The application must ensure the memory pointed to by ptr is accessible +/// by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by ptr as it +/// is free to be modified by either the Host or device up until /// execution. +/// - The ptr must be aligned to pattern_size /// - The value to initialize memory to is described by the pattern and the /// pattern size. /// - The pattern size must be a power-of-two and less than or equal to the @@ -2975,12 +4094,21 @@ zeCommandListAppendMemoryCopy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == ptr` /// + `nullptr == pattern` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -3038,6 +4166,14 @@ typedef struct _ze_copy_region_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -3095,6 +4231,14 @@ zeCommandListAppendMemoryCopyRegion( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hContextSrc` @@ -3142,6 +4286,14 @@ zeCommandListAppendMemoryCopyFromContext( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hDstImage` @@ -3198,6 +4350,14 @@ typedef struct _ze_image_region_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hDstImage` @@ -3249,6 +4409,14 @@ zeCommandListAppendImageCopyRegion( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hSrcImage` @@ -3299,6 +4467,14 @@ zeCommandListAppendImageCopyToMemory( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hDstImage` @@ -3355,6 +4531,14 @@ zeCommandListAppendImageCopyFromMemory( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -3381,7 +4565,7 @@ typedef enum _ze_memory_advice_t ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION = 8, ///< hint that the preferred memory location is host memory ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION = 9, ///< removes the effect of ///< ::ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION - ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_ADVICE_* ENUMs } ze_memory_advice_t; @@ -3415,6 +4599,14 @@ typedef enum _ze_memory_advice_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hDevice` @@ -3422,6 +4614,7 @@ typedef enum _ze_memory_advice_t /// + `nullptr == ptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `::ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION < advice` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemAdvise( ze_command_list_handle_t hCommandList, ///< [in] handle of command list @@ -3449,7 +4642,7 @@ typedef enum _ze_event_pool_flag_t ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP = ZE_BIT(3), ///< Indicates all events in pool will contain kernel timestamps ///< synchronized to host time domain; cannot be combined with ///< ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP - ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_POOL_FLAG_* ENUMs } ze_event_pool_flag_t; @@ -3483,6 +4676,14 @@ typedef struct _ze_event_pool_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -3490,6 +4691,7 @@ typedef struct _ze_event_pool_desc_t /// + `nullptr == phEventPool` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0xf < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `0 == desc->count` /// + `(nullptr == phDevices) && (0 < numDevices)` @@ -3526,6 +4728,14 @@ zeEventPoolCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEventPool` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -3545,10 +4755,60 @@ typedef enum _ze_event_scope_flag_t ///< device access and peer device access ZE_EVENT_SCOPE_FLAG_HOST = ZE_BIT(2), ///< cache hierarchies are flushed or invalidated sufficient for device and ///< host access - ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_SCOPE_FLAG_* ENUMs } ze_event_scope_flag_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported flags for defining counter based event +typedef uint32_t ze_event_counter_based_flags_t; +typedef enum _ze_event_counter_based_flag_t +{ + ZE_EVENT_COUNTER_BASED_FLAG_IMMEDIATE = ZE_BIT(0), ///< Counter-based event is used for immediate command lists (default) + ZE_EVENT_COUNTER_BASED_FLAG_NON_IMMEDIATE = ZE_BIT(1), ///< Counter-based event is used for non-immediate command lists + ZE_EVENT_COUNTER_BASED_FLAG_HOST_VISIBLE = ZE_BIT(2), ///< Signals and waits are also visible to host + ZE_EVENT_COUNTER_BASED_FLAG_IPC = ZE_BIT(3), ///< Event can be shared across processes for waiting + ZE_EVENT_COUNTER_BASED_FLAG_DEVICE_TIMESTAMP = ZE_BIT(4), ///< Event contains timestamps populated in the device time domain. + ///< Implementation of this can be vendor specific, but typically pulled + ///< from timers on the offload device and not the host. + ///< Cannot be combined with ::ZE_EVENT_COUNTER_BASED_FLAG_HOST_TIMESTAMP + ZE_EVENT_COUNTER_BASED_FLAG_HOST_TIMESTAMP = ZE_BIT(5), ///< Indicates that event will contain timestamps converted to the host + ///< time domain + ///< Cannot be combined with ::ZE_EVENT_COUNTER_BASED_FLAG_DEVICE_TIMESTAMP + ///< It is recommended to use this flag for most users that want to + ///< correlate timestamps from the host and device into a single timeline. + ///< For host timestamps see ::zeDeviceGetGlobalTimestamps. + ZE_EVENT_COUNTER_BASED_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_COUNTER_BASED_FLAG_* ENUMs + +} ze_event_counter_based_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported event sync mode flags +typedef uint32_t ze_event_sync_mode_flags_t; +typedef enum _ze_event_sync_mode_flag_t +{ + ZE_EVENT_SYNC_MODE_FLAG_LOW_POWER_WAIT = ZE_BIT(0), ///< Low power host synchronization mode, for better CPU utilization + ZE_EVENT_SYNC_MODE_FLAG_SIGNAL_INTERRUPT = ZE_BIT(1), ///< Generate interrupt when Event is signalled on Device. It may be used + ///< to optimize low power CPU synchronization + ZE_EVENT_SYNC_MODE_FLAG_EXTERNAL_INTERRUPT_WAIT = ZE_BIT(2), ///< Host synchronization APIs wait for external interrupt id. Can be used + ///< only for Counter Based Events + ZE_EVENT_SYNC_MODE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_SYNC_MODE_FLAG_* ENUMs + +} ze_event_sync_mode_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event sync mode descriptor +typedef struct _ze_event_sync_mode_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_event_sync_mode_flags_t syncModeFlags; ///< [in] valid combination of ::ze_event_sync_mode_flag_t + uint32_t externalInterruptId; ///< [in] External interrupt id. Used only when + ///< ::ZE_EVENT_SYNC_MODE_FLAG_EXTERNAL_INTERRUPT_WAIT flag is set + +} ze_event_sync_mode_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Event descriptor typedef struct _ze_event_desc_t @@ -3572,28 +4832,88 @@ typedef struct _ze_event_desc_t } ze_event_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates an event from the pool. -/// -/// @details -/// - An event is used to communicate fine-grain host-to-device, -/// device-to-host or device-to-device dependencies have completed. -/// - The application must ensure the location in the pool is not being used -/// by another event. -/// - The application must **not** call this function from simultaneous -/// threads with the same event pool handle. -/// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - **clCreateUserEvent** -/// - vkCreateEvent -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// @brief Counter Based Event descriptor +typedef struct _ze_event_counter_based_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_event_counter_based_flags_t flags; ///< [in] counter based event flags. + ///< Must be 0 (default) or a valid combination of ::ze_event_counter_based_flag_t + ze_event_scope_flags_t signal; ///< [in] defines the scope of relevant cache hierarchies to flush on a + ///< signal action before the event is triggered. + ///< must be 0 (default) or a valid combination of ::ze_event_scope_flag_t; + ///< default behavior is synchronization within the command list only, no + ///< additional cache hierarchies are flushed. + ze_event_scope_flags_t wait; ///< [in] defines the scope of relevant cache hierarchies to invalidate on + ///< a wait action after the event is complete. + ///< must be 0 (default) or a valid combination of ::ze_event_scope_flag_t; + ///< default behavior is synchronization within the command list only, no + ///< additional cache hierarchies are invalidated. + +} ze_event_counter_based_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Counter Based Event external sync allocation descriptor. Passed as +/// pNext to ::ze_event_counter_based_desc_t +typedef struct _ze_event_counter_based_external_sync_allocation_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t* deviceAddress; ///< [in] device address for external synchronization allocation + uint64_t* hostAddress; ///< [in] host address for external synchronization allocation + uint64_t completionValue; ///< [in] completion value for external synchronization allocation + +} ze_event_counter_based_external_sync_allocation_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Counter Based Event external aggregate storage. Passed as pNext to +/// ::ze_event_counter_based_desc_t +typedef struct _ze_event_counter_based_external_aggregate_storage_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t* deviceAddress; ///< [in] device address that would be updated with atomic_add upon + ///< signaling of this event, must be device USM memory + uint64_t incrementValue; ///< [in] value which would by atomically added upon each completion + uint64_t completionValue; ///< [in] final completion value, when value under deviceAddress is equal + ///< or greater then this value then event is considered as completed + +} ze_event_counter_based_external_aggregate_storage_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates an event from the pool. +/// +/// @details +/// - An event is used to communicate fine-grain host-to-device, +/// device-to-host or device-to-device dependencies have completed. +/// - The application must ensure the location in the pool is not being used +/// by another event. +/// - The application must **not** call this function from simultaneous +/// threads with the same event pool handle. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - **clCreateUserEvent** +/// - vkCreateEvent +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEventPool` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -3602,6 +4922,7 @@ typedef struct _ze_event_desc_t /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < desc->signal` /// + `0x7 < desc->wait` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeEventCreate( ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool @@ -3609,6 +4930,42 @@ zeEventCreate( ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates Counter Based Event +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phEvent` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3f < desc->flags` +/// + `0x7 < desc->signal` +/// + `0x7 < desc->wait` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventCounterBasedCreate( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device object + const ze_event_counter_based_desc_t* desc, ///< [in] pointer to counter based event descriptor + ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Deletes an event object. /// @@ -3632,6 +4989,14 @@ zeEventCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -3654,6 +5019,14 @@ zeEventDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEventPool` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -3687,6 +5060,14 @@ zeEventPoolGetIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -3705,6 +5086,18 @@ zeEventPoolPutIpcHandle( /// unique event pool handles. /// - The event handle in this process should not be freed with /// ::zeEventPoolDestroy, but rather with ::zeEventPoolCloseIpcHandle. +/// - If the original event pool has been created for a device containing a +/// number of sub-devices, then the event pool +/// returned by this call may be used on a device containing the same +/// number of sub-devices, or on any of +/// those sub-devices. +/// - However, if the original event pool has been created for a sub-device, +/// then the event pool returned by this call +/// cannot be used on a device containing any number of sub-devices, and +/// must be used only in a sub-device. This ensures +/// functional correctness for any implementation or optimizations the +/// underlying Level Zero driver may do on +/// event pools and events. /// - The application may call this function from simultaneous threads. /// /// @returns @@ -3713,6 +5106,14 @@ zeEventPoolPutIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -3740,6 +5141,14 @@ zeEventPoolOpenIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEventPool` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -3747,6 +5156,119 @@ zeEventPoolCloseIpcHandle( ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets an IPC counter based event handle that can be shared with another +/// process. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phIpc` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventCounterBasedGetIpcHandle( + ze_event_handle_t hEvent, ///< [in] handle of event object + ze_ipc_event_counter_based_handle_t* phIpc ///< [out] Returned IPC event handle + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Opens an IPC event handle to retrieve from another process. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phEvent` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventCounterBasedOpenIpcHandle( + ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event + ///< handle + ze_ipc_event_counter_based_handle_t hIpc, ///< [in] IPC event handle + ze_event_handle_t* phEvent ///< [out] pointer handle of event object created + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Closes an IPC event handle in the current process. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventCounterBasedCloseIpcHandle( + ze_event_handle_t hEvent ///< [in][release] handle of event object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns Counter Based Event completion value (counter) and its device +/// address +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == completionValue` +/// + `nullptr == deviceAddress` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventCounterBasedGetDeviceAddress( + ze_event_handle_t hEvent, ///< [in] handle of event object + uint64_t* completionValue, ///< [in][out] completion value + uint64_t* deviceAddress ///< [in][out] counter device address + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Appends a signal of the event from the device into a command list. /// @@ -3775,6 +5297,14 @@ zeEventPoolCloseIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hEvent` @@ -3803,6 +5333,14 @@ zeCommandListAppendSignalEvent( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -3838,6 +5376,14 @@ zeCommandListAppendWaitOnEvents( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT @@ -3863,6 +5409,14 @@ zeEventHostSignal( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT @@ -3898,6 +5452,14 @@ zeEventHostSynchronize( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT @@ -3931,6 +5493,14 @@ zeEventQueryStatus( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hEvent` @@ -3958,6 +5528,14 @@ zeCommandListAppendEventReset( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT @@ -4009,6 +5587,14 @@ typedef struct _ze_kernel_timestamp_result_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4049,6 +5635,14 @@ zeEventQueryKernelTimestamp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4074,49 +5668,12 @@ zeCommandListAppendQueryKernelTimestamps( ///< on before executing query ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero APIs for Fence -#if !defined(__GNUC__) -#pragma region fence -#endif -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported fence creation flags -typedef uint32_t ze_fence_flags_t; -typedef enum _ze_fence_flag_t -{ - ZE_FENCE_FLAG_SIGNALED = ZE_BIT(0), ///< fence is created in the signaled state, otherwise not signaled. - ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff - -} ze_fence_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Fence descriptor -typedef struct _ze_fence_desc_t -{ - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_fence_flags_t flags; ///< [in] creation flags. - ///< must be 0 (default) or a valid combination of ::ze_fence_flag_t. - -} ze_fence_desc_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a fence for the command queue. +/// @brief Gets the handle of the event pool for the event. /// /// @details -/// - A fence is a heavyweight synchronization primitive used to communicate -/// to the host that command list execution has completed. -/// - The application must only use the fence for the command queue which -/// was provided during creation. /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @remarks -/// _Analogues_ -/// - **vkCreateFence** +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4124,35 +5681,30 @@ typedef struct _ze_fence_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandQueue` +/// + `nullptr == hEvent` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phFence` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1 < desc->flags` +/// + `nullptr == phEventPool` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFenceCreate( - ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue - const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor - ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created +zeEventGetEventPool( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_pool_handle_t* phEventPool ///< [out] handle of the event pool for the event ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Deletes a fence object. +/// @brief Gets the signal event scope. /// /// @details -/// - The application must ensure the device is not currently referencing -/// the fence before it is deleted. -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this fence. -/// - The application must **not** call this function from simultaneous -/// threads with the same fence handle. -/// - The implementation of this function must be thread-safe. -/// -/// @remarks -/// _Analogues_ -/// - **vkDestroyFence** +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -4160,31 +5712,258 @@ zeFenceCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hFence` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pSignalScope` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFenceDestroy( - ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy +zeEventGetSignalScope( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_scope_flags_t* pSignalScope ///< [out] signal event scope. This is the scope of relevant cache + ///< hierarchies that are flushed on a signal action before the event is + ///< triggered. May be 0 or a valid combination of ::ze_event_scope_flag_t. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief The current host thread waits on a fence to be signaled. +/// @brief Gets the wait event scope. /// /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// -/// @remarks -/// _Analogues_ -/// - **vkWaitForFences** -/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pWaitScope` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventGetWaitScope( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_event_scope_flags_t* pWaitScope ///< [out] wait event scope. This is the scope of relevant cache + ///< hierarchies invalidated on a wait action after the event is complete. + ///< May be 0 or a valid combination of ::ze_event_scope_flag_t. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets the handle of the context on which the event pool was created. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEventPool` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phContext` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventPoolGetContextHandle( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + ze_context_handle_t* phContext ///< [out] handle of the context on which the event pool was created + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets the creation flags used to create the event pool. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEventPool` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pFlags` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventPoolGetFlags( + ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool + ze_event_pool_flags_t* pFlags ///< [out] creation flags used to create the event pool; may be 0 or a + ///< valid combination of ::ze_event_pool_flag_t + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Fence +#if !defined(__GNUC__) +#pragma region fence +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported fence creation flags +typedef uint32_t ze_fence_flags_t; +typedef enum _ze_fence_flag_t +{ + ZE_FENCE_FLAG_SIGNALED = ZE_BIT(0), ///< fence is created in the signaled state, otherwise not signaled. + ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FENCE_FLAG_* ENUMs + +} ze_fence_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Fence descriptor +typedef struct _ze_fence_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_fence_flags_t flags; ///< [in] creation flags. + ///< must be 0 (default) or a valid combination of ::ze_fence_flag_t. + +} ze_fence_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a fence for the command queue. +/// +/// @details +/// - A fence is a heavyweight synchronization primitive used to communicate +/// to the host that command list execution has completed. +/// - The application must only use the fence for the command queue which +/// was provided during creation. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @remarks +/// _Analogues_ +/// - **vkCreateFence** +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandQueue` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phFence` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x1 < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFenceCreate( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue + const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor + ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Deletes a fence object. +/// +/// @details +/// - The application must ensure the device is not currently referencing +/// the fence before it is deleted. +/// - The implementation of this function may immediately free all Host and +/// Device allocations associated with this fence. +/// - The application must **not** call this function from simultaneous +/// threads with the same fence handle. +/// - The implementation of this function must be thread-safe. +/// +/// @remarks +/// _Analogues_ +/// - **vkDestroyFence** +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hFence` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFenceDestroy( + ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief The current host thread waits on a fence to be signaled. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - **vkWaitForFences** +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hFence` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT @@ -4219,6 +5998,14 @@ zeFenceHostSynchronize( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hFence` /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT @@ -4246,6 +6033,14 @@ zeFenceQueryStatus( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hFence` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -4267,7 +6062,7 @@ typedef enum _ze_image_flag_t { ZE_IMAGE_FLAG_KERNEL_WRITE = ZE_BIT(0), ///< kernels will write contents ZE_IMAGE_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache contents - ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_FLAG_* ENUMs } ze_image_flag_t; @@ -4281,7 +6076,7 @@ typedef enum _ze_image_type_t ZE_IMAGE_TYPE_2DARRAY = 3, ///< 2D array ZE_IMAGE_TYPE_3D = 4, ///< 3D ZE_IMAGE_TYPE_BUFFER = 5, ///< Buffer - ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_TYPE_* ENUMs } ze_image_type_t; @@ -4332,7 +6127,10 @@ typedef enum _ze_image_format_layout_t ZE_IMAGE_FORMAT_LAYOUT_444P = 40, ///< Media Format: 444P. Format type and swizzle is ignored for this. ZE_IMAGE_FORMAT_LAYOUT_RGBP = 41, ///< Media Format: RGBP. Format type and swizzle is ignored for this. ZE_IMAGE_FORMAT_LAYOUT_BRGP = 42, ///< Media Format: BRGP. Format type and swizzle is ignored for this. - ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_LAYOUT_8_8_8 = 43, ///< 3-component 8-bit layout + ZE_IMAGE_FORMAT_LAYOUT_16_16_16 = 44, ///< 3-component 16-bit layout + ZE_IMAGE_FORMAT_LAYOUT_32_32_32 = 45, ///< 3-component 32-bit layout + ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_FORMAT_LAYOUT_* ENUMs } ze_image_format_layout_t; @@ -4345,7 +6143,7 @@ typedef enum _ze_image_format_type_t ZE_IMAGE_FORMAT_TYPE_UNORM = 2, ///< Unsigned normalized integer ZE_IMAGE_FORMAT_TYPE_SNORM = 3, ///< Signed normalized integer ZE_IMAGE_FORMAT_TYPE_FLOAT = 4, ///< Float - ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_FORMAT_TYPE_* ENUMs } ze_image_format_type_t; @@ -4360,7 +6158,8 @@ typedef enum _ze_image_format_swizzle_t ZE_IMAGE_FORMAT_SWIZZLE_0 = 4, ///< Zero ZE_IMAGE_FORMAT_SWIZZLE_1 = 5, ///< One ZE_IMAGE_FORMAT_SWIZZLE_X = 6, ///< Don't care - ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_SWIZZLE_D = 7, ///< Depth Component + ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_FORMAT_SWIZZLE_* ENUMs } ze_image_format_swizzle_t; @@ -4425,7 +6224,7 @@ typedef enum _ze_image_sampler_filter_flag_t { ZE_IMAGE_SAMPLER_FILTER_FLAG_POINT = ZE_BIT(0), ///< device supports point filtering ZE_IMAGE_SAMPLER_FILTER_FLAG_LINEAR = ZE_BIT(1), ///< device supports linear filtering - ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_SAMPLER_FILTER_FLAG_* ENUMs } ze_image_sampler_filter_flag_t; @@ -4454,6 +6253,14 @@ typedef struct _ze_image_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4462,6 +6269,7 @@ typedef struct _ze_image_properties_t /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x3 < desc->flags` /// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeImageGetProperties( ze_device_handle_t hDevice, ///< [in] handle of the device @@ -4488,6 +6296,14 @@ zeImageGetProperties( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -4497,6 +6313,7 @@ zeImageGetProperties( /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x3 < desc->flags` /// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ZE_APIEXPORT ze_result_t ZE_APICALL zeImageCreate( @@ -4524,6 +6341,14 @@ zeImageCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -4547,7 +6372,7 @@ typedef enum _ze_device_mem_alloc_flag_t ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(2), ///< optimize shared allocation for first access on the device - ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEM_ALLOC_FLAG_* ENUMs } ze_device_mem_alloc_flag_t; @@ -4575,7 +6400,7 @@ typedef enum _ze_host_mem_alloc_flag_t ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< host should not cache allocation (UC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = ZE_BIT(2), ///< host memory should be allocated write-combined (WC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(3), ///< optimize shared allocation for first access on the host - ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_HOST_MEM_ALLOC_FLAG_* ENUMs } ze_host_mem_alloc_flag_t; @@ -4620,6 +6445,14 @@ typedef struct _ze_host_mem_alloc_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4629,6 +6462,7 @@ typedef struct _ze_host_mem_alloc_desc_t /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < device_desc->flags` /// + `0xf < host_desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE /// + `0 == size` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT @@ -4665,6 +6499,14 @@ zeMemAllocShared( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -4673,6 +6515,7 @@ zeMemAllocShared( /// + `nullptr == pptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < device_desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE /// + `0 == size` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT @@ -4710,6 +6553,14 @@ zeMemAllocDevice( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4717,6 +6568,7 @@ zeMemAllocDevice( /// + `nullptr == pptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0xf < host_desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE /// + `0 == size` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT @@ -4740,8 +6592,11 @@ zeMemAllocHost( /// @details /// - The application must ensure the device is not currently referencing /// the memory before it is freed -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this memory +/// - The implementation will use the default and immediate policy to +/// schedule all Host and Device allocations associated with this memory +/// to be freed, without any safety checking. Actual freeing of memory is +/// specific to user mode driver and kernel mode driver implementation and +/// may be done asynchronously. /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -4752,6 +6607,14 @@ zeMemAllocHost( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4770,7 +6633,9 @@ typedef enum _ze_memory_type_t ZE_MEMORY_TYPE_HOST = 1, ///< the memory pointed to is a host allocation ZE_MEMORY_TYPE_DEVICE = 2, ///< the memory pointed to is a device allocation ZE_MEMORY_TYPE_SHARED = 3, ///< the memory pointed to is a shared ownership allocation - ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_TYPE_HOST_IMPORTED = 4, ///< the memory pointed to is a host allocation created from external + ///< system memory + ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_TYPE_* ENUMs } ze_memory_type_t; @@ -4804,6 +6669,14 @@ typedef struct _ze_memory_allocation_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4829,10 +6702,19 @@ zeMemGetAllocProperties( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_ADDRESS_NOT_FOUND ZE_APIEXPORT ze_result_t ZE_APICALL zeMemGetAddressRange( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -4859,6 +6741,14 @@ zeMemGetAddressRange( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4876,7 +6766,8 @@ zeMemGetIpcHandle( /// /// @details /// - Handle passed must be a valid file descriptor obtained with -/// ::ze_external_memory_export_fd_t via ::zeMemGetAllocProperties. +/// ::ze_external_memory_export_fd_t via ::zeMemGetAllocProperties or +/// ::zePhysicalMemGetProperties. /// - Returned IPC handle may contain metadata in addition to the file /// descriptor. /// - The application may call this function from simultaneous threads. @@ -4888,6 +6779,14 @@ zeMemGetIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4914,6 +6813,14 @@ zeMemGetIpcHandleFromFileDescriptorExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -4930,7 +6837,8 @@ zeMemGetFileDescriptorFromIpcHandleExp( /// /// @details /// - This call may be used for IPC handles previously obtained with either -/// ::zeMemGetIpcHandle or with ::ze_external_memory_export_fd_t via ::zeMemGetAllocProperties. +/// ::zeMemGetIpcHandle or with ::ze_external_memory_export_fd_t via +/// ::zeMemGetAllocProperties or ::zePhysicalMemGetProperties. /// - Upon call, driver may release any underlying resources associated with /// the IPC handle. /// For instance, it may close the file descriptor contained in the IPC @@ -4947,6 +6855,14 @@ zeMemGetFileDescriptorFromIpcHandleExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -4962,7 +6878,7 @@ typedef enum _ze_ipc_memory_flag_t { ZE_IPC_MEMORY_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) - ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_MEMORY_FLAG_* ENUMs } ze_ipc_memory_flag_t; @@ -4986,11 +6902,20 @@ typedef enum _ze_ipc_memory_flag_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x3 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == pptr` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -5019,6 +6944,14 @@ zeMemOpenIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5033,10 +6966,11 @@ zeMemCloseIpcHandle( /// @brief Additional allocation descriptor for exporting external memory /// /// @details -/// - This structure may be passed to ::zeMemAllocDevice and -/// ::zeMemAllocHost, via the `pNext` member of -/// ::ze_device_mem_alloc_desc_t or ::ze_host_mem_alloc_desc_t, -/// respectively, to indicate an exportable memory allocation. +/// - This structure may be passed to ::zeMemAllocDevice, ::zeMemAllocHost, +/// or ::zePhysicalMemCreate, via the `pNext` member of +/// ::ze_device_mem_alloc_desc_t or ::ze_host_mem_alloc_desc_t, or +/// ::ze_physical_mem_desc_t, respectively, to indicate an exportable +/// memory allocation. /// - This structure may be passed to ::zeImageCreate, via the `pNext` /// member of ::ze_image_desc_t, to indicate an exportable image. typedef struct _ze_external_memory_export_desc_t @@ -5054,10 +6988,11 @@ typedef struct _ze_external_memory_export_desc_t /// file descriptor /// /// @details -/// - This structure may be passed to ::zeMemAllocDevice or -/// ::zeMemAllocHost, via the `pNext` member of -/// ::ze_device_mem_alloc_desc_t or of ::ze_host_mem_alloc_desc_t, -/// respectively, to import memory from a file descriptor. +/// - This structure may be passed to ::zeMemAllocDevice, ::zeMemAllocHost, +/// or ::zePhysicalMemCreate, via the `pNext` member of +/// ::ze_device_mem_alloc_desc_t or ::ze_host_mem_alloc_desc_t, or +/// ::ze_physical_mem_desc_t, respectively, to import memory from a file +/// descriptor. /// - This structure may be passed to ::zeImageCreate, via the `pNext` /// member of ::ze_image_desc_t, to import memory from a file descriptor. typedef struct _ze_external_memory_import_fd_t @@ -5081,6 +7016,9 @@ typedef struct _ze_external_memory_import_fd_t /// - This structure may be passed to ::zeImageGetAllocPropertiesExt, via /// the `pNext` member of ::ze_image_allocation_ext_properties_t, to /// export an image as a file descriptor. +/// - This structure may be passed to ::zePhysicalMemGetProperties, via the +/// `pNext` member of ::ze_physical_mem_properties_t, to export physical +/// memory as a file descriptor. /// - The requested memory export type must have been specified when the /// allocation was made. typedef struct _ze_external_memory_export_fd_t @@ -5103,10 +7041,11 @@ typedef struct _ze_external_memory_export_fd_t /// - When `name` is `nullptr`, `handle` must not be `nullptr`. /// - When `flags` is ::ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT, /// `name` must be `nullptr`. -/// - This structure may be passed to ::zeMemAllocDevice or -/// ::zeMemAllocHost, via the `pNext` member of -/// ::ze_device_mem_alloc_desc_t or of ::ze_host_mem_alloc_desc_t, -/// respectively, to import memory from a Win32 handle. +/// - This structure may be passed to ::zeMemAllocDevice, ::zeMemAllocHost, +/// or ::zePhysicalMemCreate, via the `pNext` member of +/// ::ze_device_mem_alloc_desc_t or ::ze_host_mem_alloc_desc_t, or +/// ::ze_physical_mem_desc_t, respectively, to import memory from a Win32 +/// handle. /// - This structure may be passed to ::zeImageCreate, via the `pNext` /// member of ::ze_image_desc_t, to import memory from a Win32 handle. typedef struct _ze_external_memory_import_win32_handle_t @@ -5131,6 +7070,9 @@ typedef struct _ze_external_memory_import_win32_handle_t /// - This structure may be passed to ::zeImageGetAllocPropertiesExt, via /// the `pNext` member of ::ze_image_allocation_ext_properties_t, to /// export an image as a Win32 handle. +/// - This structure may be passed to ::zePhysicalMemGetProperties, via the +/// `pNext` member of ::ze_physical_mem_properties_t, to export physical +/// memory as a Win32 handle. /// - The requested memory export type must have been specified when the /// allocation was made. typedef struct _ze_external_memory_export_win32_handle_t @@ -5163,7 +7105,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_SYSTEM_ATOMICS = ZE_BIT(6), ///< Concurrent atomics on the pointer from both host and device are ///< allowed. Requires ::ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC ///< returned by ::zeDeviceGetMemoryAccessProperties. - ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_* ENUMs } ze_memory_atomic_attr_exp_flag_t; @@ -5177,7 +7119,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t /// passed in hDevice, then the atomic attributes are set in all devices /// associated with the allocation. /// - If the atomic access attribute select is not supported by the driver, -/// ::ZE_RESULT_INVALID_ARGUMENT is returned. +/// ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. /// - The atomic access attribute may be only supported at a device-specific /// granularity, such as at a page boundary. In this case, the memory range /// may be expanded such that the start and end of the range satisfy granularity @@ -5196,6 +7138,14 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -5203,6 +7153,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t /// + `nullptr == ptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7f < attr` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeMemSetAtomicAccessAttributeExp( ze_context_handle_t hContext, ///< [in] handle of context @@ -5228,6 +7179,14 @@ zeMemSetAtomicAccessAttributeExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -5256,7 +7215,7 @@ typedef enum _ze_module_format_t { ZE_MODULE_FORMAT_IL_SPIRV = 0, ///< Format is SPIRV IL format ZE_MODULE_FORMAT_NATIVE = 1, ///< Format is device native format - ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MODULE_FORMAT_* ENUMs } ze_module_format_t; @@ -5308,6 +7267,17 @@ typedef struct _ze_module_desc_t } ze_module_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Append launch kernel with parameters cooperative descriptor +typedef struct _ze_command_list_append_launch_kernel_param_cooperative_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_bool_t isCooperative; ///< [in] When true, kernel is treated as cooperative. + +} ze_command_list_append_launch_kernel_param_cooperative_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Creates a module on the context. /// @@ -5330,6 +7300,14 @@ typedef struct _ze_module_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -5339,6 +7317,7 @@ typedef struct _ze_module_desc_t /// + `nullptr == phModule` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `::ZE_MODULE_FORMAT_NATIVE < desc->format` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_NATIVE_BINARY /// - ::ZE_RESULT_ERROR_INVALID_SIZE /// + `0 == desc->inputSize` @@ -5372,6 +7351,14 @@ zeModuleCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -5419,6 +7406,14 @@ zeModuleDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phModules` /// - ::ZE_RESULT_ERROR_MODULE_LINK_FAILURE @@ -5448,6 +7443,14 @@ zeModuleDynamicLink( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModuleBuildLog` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -5471,6 +7474,14 @@ zeModuleBuildLogDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModuleBuildLog` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5503,6 +7514,14 @@ zeModuleBuildLogGetString( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5531,6 +7550,14 @@ zeModuleGetNativeBinary( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5557,6 +7584,14 @@ zeModuleGetGlobalPointer( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5581,7 +7616,7 @@ typedef enum _ze_module_property_flag_t { ZE_MODULE_PROPERTY_FLAG_IMPORTS = ZE_BIT(0), ///< Module has imports (i.e. imported global variables and/or kernels). ///< See ::zeModuleDynamicLink. - ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MODULE_PROPERTY_FLAG_* ENUMs } ze_module_property_flag_t; @@ -5609,6 +7644,14 @@ typedef struct _ze_module_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5627,7 +7670,7 @@ typedef enum _ze_kernel_flag_t ZE_KERNEL_FLAG_FORCE_RESIDENCY = ZE_BIT(0), ///< force all device allocations to be resident during execution ZE_KERNEL_FLAG_EXPLICIT_RESIDENCY = ZE_BIT(1), ///< application is responsible for all residency of device allocations. ///< driver may disable implicit residency management. - ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_FLAG_* ENUMs } ze_kernel_flag_t; @@ -5660,6 +7703,14 @@ typedef struct _ze_kernel_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5668,6 +7719,7 @@ typedef struct _ze_kernel_desc_t /// + `nullptr == phKernel` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x3 < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_KERNEL_NAME /// - ::ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED ZE_APIEXPORT ze_result_t ZE_APICALL @@ -5695,6 +7747,14 @@ zeKernelCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -5721,6 +7781,14 @@ zeKernelDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hModule` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5750,6 +7818,14 @@ zeModuleGetFunctionPointer( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION @@ -5777,6 +7853,14 @@ zeKernelSetGroupSize( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5801,6 +7885,10 @@ zeKernelSuggestGroupSize( /// @details /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. +/// - Applications are recommended to use ::zeKernelSuggestGroupSize and +/// ::zeKernelSetGroupSize first before calling this function and +/// launching cooperative kernels. Otherwise, implementation may return +/// ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5808,6 +7896,14 @@ zeKernelSuggestGroupSize( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5827,6 +7923,8 @@ zeKernelSuggestMaxCooperativeGroupCount( /// - The application must **not** call this function from simultaneous /// threads with the same kernel handle. /// - The implementation of this function should be lock-free. +/// - If argument is SLM (size), then SLM size in bytes for this resource is +/// provided as argument size and argument value is null /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -5834,10 +7932,19 @@ zeKernelSuggestMaxCooperativeGroupCount( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX /// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSetArgumentValue( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object @@ -5855,7 +7962,7 @@ typedef enum _ze_kernel_indirect_access_flag_t ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST = ZE_BIT(0), ///< Indicates that the kernel accesses host allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE = ZE_BIT(1), ///< Indicates that the kernel accesses device allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED = ZE_BIT(2), ///< Indicates that the kernel accesses shared allocations indirectly. - ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_INDIRECT_ACCESS_FLAG_* ENUMs } ze_kernel_indirect_access_flag_t; @@ -5876,10 +7983,19 @@ typedef enum _ze_kernel_indirect_access_flag_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x7 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSetIndirectAccess( ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object @@ -5900,6 +8016,14 @@ zeKernelSetIndirectAccess( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5925,6 +8049,14 @@ zeKernelGetIndirectAccess( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -5937,10 +8069,14 @@ zeKernelGetSourceAttributes( char** pString ///< [in,out][optional] pointer to application-managed character array ///< (string data). ///< If NULL, the string length of the kernel source attributes, including - ///< a null-terminating character, is returned in pSize. - ///< Otherwise, pString must point to valid application memory that is - ///< greater than or equal to *pSize bytes in length, and on return the - ///< pointed-to string will contain a space-separated list of kernel source attributes. + ///< a null-terminating character, is returned in pSize. Otherwise, pString + ///< must point to valid application memory that is greater than or equal + ///< to *pSize bytes in length, and on return the pointed-to string will + ///< contain a space-separated list of kernel source attributes. Note: This + ///< API was originally intended to ship with a char *pString, however this + ///< typo was introduced. Thus the API has to stay this way for backwards + ///< compatible reasons. It can be corrected in v2.0. Suggestion is to + ///< create your own char *pString and then pass to this API with &pString. ); /////////////////////////////////////////////////////////////////////////////// @@ -5950,7 +8086,7 @@ typedef enum _ze_cache_config_flag_t { ZE_CACHE_CONFIG_FLAG_LARGE_SLM = ZE_BIT(0), ///< Large SLM size ZE_CACHE_CONFIG_FLAG_LARGE_DATA = ZE_BIT(1), ///< Large General Data size - ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_CONFIG_FLAG_* ENUMs } ze_cache_config_flag_t; @@ -5970,10 +8106,18 @@ typedef enum _ze_cache_config_flag_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `0x3 < flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSetCacheConfig( @@ -6059,6 +8203,14 @@ typedef struct _ze_kernel_preferred_group_size_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -6085,6 +8237,14 @@ zeKernelGetProperties( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -6127,6 +8287,14 @@ typedef struct _ze_group_count_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hKernel` @@ -6147,6 +8315,132 @@ zeCommandListAppendLaunchKernel( ///< on before launching ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Launch kernel over one or more work groups and allow to pass +/// additional parameters. +/// +/// @details +/// - The application must ensure the kernel and events are accessible by +/// the device on which the command list was created. +/// - This may **only** be called for a command list created with command +/// queue group ordinal that supports compute. +/// - The application must ensure the command list, kernel and events were +/// created on the same context. +/// - This function may **not** be called from simultaneous threads with the +/// same command list handle. +/// - The implementation of this function should be lock-free. +/// - This function allows to pass additional parameters in the form of +/// `${x}_base_desc_t` +/// - This function can replace ::zeCommandListAppendLaunchCooperativeKernel +/// with additional parameter +/// `${x}_command_list_append_launch_kernel_param_cooperative_desc_t` +/// - This function supports both immediate and regular command lists. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pGroupCounts` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + when passed additional parameters are invalid or incompatible with the device or command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendLaunchKernelWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t* pGroupCounts, ///< [in] thread group launch arguments + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Kernel dispatch group sizes. +typedef struct _ze_group_size_t +{ + uint32_t groupSizeX; ///< [in] size of thread group in X dimension + uint32_t groupSizeY; ///< [in] size of thread group in Y dimension + uint32_t groupSizeZ; ///< [in] size of thread group in Z dimension + +} ze_group_size_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Launch kernel over one or more work groups with specifying work group +/// size and all kernel arguments and allow to pass additional extensions. +/// +/// @details +/// - The application must ensure the kernel and events are accessible by +/// the device on which the command list was created. +/// - This may **only** be called for a command list created with command +/// queue group ordinal that supports compute. +/// - The application must ensure the command list, kernel and events were +/// created on the same context. +/// - This function may **not** be called from simultaneous threads with the +/// same command list handle. +/// - The implementation of this function should be lock-free. +/// - This function supports both immediate and regular command lists. +/// - This function changes kernel state as if separate +/// ${x}KernelSetGroupSize and ${x}KernelSetArgumentValue functions were +/// called. +/// - This function allows to pass additional extensions in the form of +/// `${x}_base_desc_t` +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + when passed additional extensions are invalid or incompatible with the device or command list +/// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - "as per ${x}KernelSetGroupSize" +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - "as per ${x}KernelSetArgumentValue" +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendLaunchKernelWithArguments( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + const ze_group_count_t groupCounts, ///< [in] thread group counts + const ze_group_size_t groupSizes, ///< [in] thread group sizes + void ** pArguments, ///< [in]pointer to an array of pointers + const void * pNext, ///< [in][optional] additional extensions passed to the function + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Launch kernel cooperatively over one or more work groups. /// @@ -6171,6 +8465,14 @@ zeCommandListAppendLaunchKernel( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hKernel` @@ -6216,6 +8518,14 @@ zeCommandListAppendLaunchCooperativeKernel( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// + `nullptr == hKernel` @@ -6264,6 +8574,14 @@ zeCommandListAppendLaunchKernelIndirect( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -6309,7 +8627,7 @@ typedef enum _ze_module_program_exp_version_t { ZE_MODULE_PROGRAM_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_MODULE_PROGRAM_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MODULE_PROGRAM_EXP_VERSION_* ENUMs } ze_module_program_exp_version_t; @@ -6317,24 +8635,24 @@ typedef enum _ze_module_program_exp_version_t /// @brief Module extended descriptor to support multiple input modules. /// /// @details -/// - Implementation must support ::ZE_experimental_module_program extension +/// - Implementation must support ::ZE_MODULE_PROGRAM_EXP_NAME extension /// - Modules support import and export linkage for functions and global /// variables. -/// - SPIR-V import and export linkage types are used. See SPIR-V -/// specification for linkage details. /// - pInputModules, pBuildFlags, and pConstants from ::ze_module_desc_t is /// ignored. /// - Format in ::ze_module_desc_t needs to be set to -/// ::ZE_MODULE_FORMAT_IL_SPIRV. +/// ::ZE_MODULE_FORMAT_IL_SPIRV or ::ZE_MODULE_FORMAT_NATIVE. +/// - All modules in the list must be of the same format and match the +/// format specified in ::ze_module_desc_t. typedef struct _ze_module_program_exp_desc_t { ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). uint32_t count; ///< [in] Count of input modules - const size_t* inputSizes; ///< [in][range(0, count)] sizes of each input IL module in pInputModules. - const uint8_t** pInputModules; ///< [in][range(0, count)] pointer to an array of IL (e.g. SPIR-V modules). - ///< Valid only for SPIR-V input. + const size_t* inputSizes; ///< [in][range(0, count)] sizes of each input module in pInputModules. + const uint8_t** pInputModules; ///< [in][range(0, count)] pointer to an array of binary modules in format + ///< specified as part of ::ze_module_desc_t. const char** pBuildFlags; ///< [in][optional][range(0, count)] array of strings containing build ///< flags. See pBuildFlags in ::ze_module_desc_t. const ze_module_constants_t** pConstants; ///< [in][optional][range(0, count)] pointer to array of specialization @@ -6362,7 +8680,7 @@ typedef enum _ze_raytracing_ext_version_t { ZE_RAYTRACING_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RAYTRACING_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RAYTRACING_EXT_VERSION_* ENUMs } ze_raytracing_ext_version_t; @@ -6372,7 +8690,7 @@ typedef uint32_t ze_device_raytracing_ext_flags_t; typedef enum _ze_device_raytracing_ext_flag_t { ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY = ZE_BIT(0), ///< Supports rayquery - ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_RAYTRACING_EXT_FLAG_* ENUMs } ze_device_raytracing_ext_flag_t; @@ -6398,7 +8716,7 @@ typedef uint32_t ze_raytracing_mem_alloc_ext_flags_t; typedef enum _ze_raytracing_mem_alloc_ext_flag_t { ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_* ENUMs } ze_raytracing_mem_alloc_ext_flag_t; @@ -6443,11 +8761,20 @@ typedef struct _ze_raytracing_mem_alloc_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + ptr is not recognized by the implementation ZE_APIEXPORT ze_result_t ZE_APICALL zeContextMakeMemoryResident( ze_context_handle_t hContext, ///< [in] handle of context object @@ -6473,6 +8800,14 @@ zeContextMakeMemoryResident( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -6501,6 +8836,14 @@ zeContextEvictMemory( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -6529,6 +8872,14 @@ zeContextMakeImageResident( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -6558,7 +8909,7 @@ typedef enum _ze_sampler_address_mode_t ///< 0.0f, 0.0f, 0.0f) if image format swizzle contains alpha, otherwise ///< (0.0f, 0.0f, 0.0f, 1.0f). ZE_SAMPLER_ADDRESS_MODE_MIRROR = 4, ///< Out-of-bounds coordinates are mirrored starting from edge. - ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SAMPLER_ADDRESS_MODE_* ENUMs } ze_sampler_address_mode_t; @@ -6568,7 +8919,7 @@ typedef enum _ze_sampler_filter_mode_t { ZE_SAMPLER_FILTER_MODE_NEAREST = 0, ///< No coordinate modifications for out of bounds image access. ZE_SAMPLER_FILTER_MODE_LINEAR = 1, ///< Out-of-bounds coordinates are wrapped back around. - ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SAMPLER_FILTER_MODE_* ENUMs } ze_sampler_filter_mode_t; @@ -6601,6 +8952,14 @@ typedef struct _ze_sampler_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -6610,6 +8969,7 @@ typedef struct _ze_sampler_desc_t /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `::ZE_SAMPLER_ADDRESS_MODE_MIRROR < desc->addressMode` /// + `::ZE_SAMPLER_FILTER_MODE_LINEAR < desc->filterMode` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL zeSamplerCreate( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -6636,6 +8996,14 @@ zeSamplerCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hSampler` /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE @@ -6658,7 +9026,7 @@ typedef enum _ze_memory_access_attribute_t ZE_MEMORY_ACCESS_ATTRIBUTE_NONE = 0, ///< Indicates the memory page is inaccessible. ZE_MEMORY_ACCESS_ATTRIBUTE_READWRITE = 1, ///< Indicates the memory page supports read write access. ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY = 2, ///< Indicates the memory page supports read-only access. - ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_ACCESS_ATTRIBUTE_* ENUMs } ze_memory_access_attribute_t; @@ -6684,6 +9052,14 @@ typedef enum _ze_memory_access_attribute_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -6715,6 +9091,14 @@ zeVirtualMemReserve( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -6743,6 +9127,14 @@ zeVirtualMemFree( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -6764,8 +9156,9 @@ zeVirtualMemQueryPageSize( typedef uint32_t ze_physical_mem_flags_t; typedef enum _ze_physical_mem_flag_t { - ZE_PHYSICAL_MEM_FLAG_TBD = ZE_BIT(0), ///< reserved for future use. - ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_DEVICE = ZE_BIT(0), ///< [default] allocate physical device memory. + ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_HOST = ZE_BIT(1), ///< Allocate physical host memory instead. + ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_PHYSICAL_MEM_FLAG_* ENUMs } ze_physical_mem_flag_t; @@ -6777,18 +9170,68 @@ typedef struct _ze_physical_mem_desc_t const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). ze_physical_mem_flags_t flags; ///< [in] creation flags. - ///< must be 0 (default) or a valid combination of ::ze_physical_mem_flag_t. + ///< must be 0 (default) or a valid combination of + ///< ::ze_physical_mem_flag_t; default is to create physical device memory. size_t size; ///< [in] size in bytes to reserve; must be page aligned. } ze_physical_mem_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Physical memory properties queried using ::zePhysicalMemGetProperties +typedef struct _ze_physical_mem_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t id; ///< [out] unique identifier for the physical memory object + uint64_t size; ///< [out] size of the physical memory object in bytes + +} ze_physical_mem_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves memory properties of the physical memory object. +/// +/// @details +/// - The application must only use the physical memory object on the +/// context for which it was created. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// + `nullptr == hPhysicalMem` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMemProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zePhysicalMemGetProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_physical_mem_handle_t hPhysicalMem, ///< [in] handle of the physical memory object + ze_physical_mem_properties_t* pMemProperties ///< [in,out] pointer to physical memory properties structure. + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Creates a physical memory object for the context. /// /// @details /// - The application must only use the physical memory object on the /// context for which it was created. -/// - The size must be page aligned. See ::zeVirtualMemQueryPageSize. +/// - The size must be page aligned. For host memory, the operating system +/// page size should be used. For device memory, see +/// ::zeVirtualMemQueryPageSize. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -6798,6 +9241,14 @@ typedef struct _ze_physical_mem_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hDevice` @@ -6805,14 +9256,16 @@ typedef struct _ze_physical_mem_desc_t /// + `nullptr == desc` /// + `nullptr == phPhysicalMemory` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1 < desc->flags` +/// + `0x3 < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE /// + `0 == desc->size` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT ZE_APIEXPORT ze_result_t ZE_APICALL zePhysicalMemCreate( ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object + ze_device_handle_t hDevice, ///< [in] handle of the device object, can be `nullptr` if creating + ///< physical host memory. ze_physical_mem_desc_t* desc, ///< [in] pointer to physical memory descriptor. ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created ); @@ -6833,6 +9286,14 @@ zePhysicalMemCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hPhysicalMemory` @@ -6865,6 +9326,14 @@ zePhysicalMemDestroy( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// + `nullptr == hPhysicalMemory` @@ -6872,6 +9341,7 @@ zePhysicalMemDestroy( /// + `nullptr == ptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE /// + `0 == size` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT @@ -6904,6 +9374,14 @@ zeVirtualMemMap( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -6934,12 +9412,21 @@ zeVirtualMemUnmap( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == ptr` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION /// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT /// + Address must be page aligned /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE @@ -6970,6 +9457,14 @@ zeVirtualMemSetAccessAttribute( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hContext` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER @@ -7010,7 +9505,7 @@ typedef enum _ze_float_atomics_ext_version_t { ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_FLOAT_ATOMICS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FLOAT_ATOMICS_EXT_VERSION_* ENUMs } ze_float_atomics_ext_version_t; @@ -7025,7 +9520,7 @@ typedef enum _ze_device_fp_atomic_ext_flag_t ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE = ZE_BIT(16), ///< Supports atomic load, store, and exchange ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_ADD = ZE_BIT(17), ///< Supports atomic add and subtract ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX = ZE_BIT(18), ///< Supports atomic min and max - ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_FP_ATOMIC_EXT_FLAG_* ENUMs } ze_device_fp_atomic_ext_flag_t; @@ -7068,7 +9563,7 @@ typedef enum _ze_global_offset_exp_version_t { ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_GLOBAL_OFFSET_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_GLOBAL_OFFSET_EXP_VERSION_* ENUMs } ze_global_offset_exp_version_t; @@ -7088,6 +9583,14 @@ typedef enum _ze_global_offset_exp_version_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hKernel` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -7117,7 +9620,7 @@ typedef enum _ze_relaxed_allocation_limits_exp_version_t { ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_* ENUMs } ze_relaxed_allocation_limits_exp_version_t; @@ -7128,7 +9631,7 @@ typedef enum _ze_relaxed_allocation_limits_exp_flag_t { ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE = ZE_BIT(0), ///< Allocation size may exceed the `maxMemAllocSize` member of ///< ::ze_device_properties_t. - ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_* ENUMs } ze_relaxed_allocation_limits_exp_flag_t; @@ -7154,95 +9657,35 @@ typedef struct _ze_relaxed_allocation_limits_exp_desc_t #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +// Intel 'oneAPI' Level-Zero Extension for retrieving kernel binary program data. #if !defined(__GNUC__) -#pragma region cacheReservation +#pragma region kernelBinary #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_CACHE_RESERVATION_EXT_NAME -/// @brief Cache_Reservation Extension Name -#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" -#endif // ZE_CACHE_RESERVATION_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Cache_Reservation Extension Version(s) -typedef enum _ze_cache_reservation_ext_version_t -{ - ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_cache_reservation_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Cache Reservation Region -typedef enum _ze_cache_ext_region_t -{ - ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use - ///< ::ZE_CACHE_EXT_REGION_DEFAULT. - ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use - ///< ::ZE_CACHE_EXT_REGION_RESERVED. - ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use - ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. - ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme - ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region - ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region - ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff - -} ze_cache_ext_region_t; +#ifndef ZE_GET_KERNEL_BINARY_EXP_NAME +/// @brief Get Kernel Binary Extension Name +#define ZE_GET_KERNEL_BINARY_EXP_NAME "ZE_extension_kernel_binary_exp" +#endif // ZE_GET_KERNEL_BINARY_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheReservation structure -/// -/// @details -/// - This structure must be passed to ::zeDeviceGetCacheProperties via the -/// `pNext` member of ::ze_device_cache_properties_t -/// - Used for determining the max cache reservation allowed on device. Size -/// of zero means no reservation available. -typedef struct _ze_cache_reservation_ext_desc_t +/// @brief Get Kernel Binary Extension Version(s) +typedef enum _ze_kernel_get_binary_exp_version_t { - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - size_t maxCacheReservationSize; ///< [out] max cache reservation size + ZE_KERNEL_GET_BINARY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_KERNEL_GET_BINARY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_KERNEL_GET_BINARY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_GET_BINARY_EXP_VERSION_* ENUMs -} ze_cache_reservation_ext_desc_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Reserve Cache on Device -/// -/// @details -/// - The application may call this function but may not be successful as -/// some other application may have reserve prior -/// -/// @remarks -/// _Analogues_ -/// - None -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST -/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY -/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation - ); +} ze_kernel_get_binary_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Assign VA section to use reserved section +/// @brief Retrieves kernel binary program data (ISA GEN format). /// /// @details -/// - The application may call this function to assign VA to particular -/// reservartion region +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data +/// for kernel handle. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7250,135 +9693,194 @@ zeDeviceReserveCacheExt( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +/// + `nullptr == pSize` +/// + `nullptr == pKernelBinary` ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceSetCacheAdviceExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - void* ptr, ///< [in] memory pointer to query - size_t regionSize, ///< [in] region size, in pages - ze_cache_ext_region_t cacheRegion ///< [in] reservation region +zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. +// Intel 'oneAPI' Level-Zero Extension for Driver Direct Device Interface (DDI) Handles #if !defined(__GNUC__) -#pragma region eventquerytimestamps +#pragma region driverDDIHandles #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME -/// @brief Event Query Timestamps Extension Name -#define ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME "ZE_experimental_event_query_timestamps" -#endif // ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +#ifndef ZE_DRIVER_DDI_HANDLES_EXT_NAME +/// @brief Driver Direct Device Interface (DDI) Handles Extension Name +#define ZE_DRIVER_DDI_HANDLES_EXT_NAME "ZE_extension_driver_ddi_handles" +#endif // ZE_DRIVER_DDI_HANDLES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Event Query Timestamps Extension Version(s) -typedef enum _ze_event_query_timestamps_exp_version_t +/// @brief Driver Direct Device Interface (DDI) Handles Extension Version(s) +typedef enum _ze_driver_ddi_handles_ext_version_t { - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_DDI_HANDLES_EXT_VERSION_* ENUMs -} ze_event_query_timestamps_exp_version_t; +} ze_driver_ddi_handles_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Query event timestamps for a device or sub-device. +/// @brief Driver Direct Device Interface (DDI) Handle Extension Flags +typedef uint32_t ze_driver_ddi_handle_ext_flags_t; +typedef enum _ze_driver_ddi_handle_ext_flag_t +{ + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED = ZE_BIT(0), ///< Driver Supports DDI Handles Extension + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_DDI_HANDLE_EXT_FLAG_* ENUMs + +} ze_driver_ddi_handle_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Driver DDI Handles properties queried using ::zeDriverGetProperties /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_event_query_timestamps. -/// - The implementation must return all timestamps for the specified event -/// and device pair. -/// - The implementation must return all timestamps for all sub-devices when -/// device handle is parent device. -/// - The implementation may return all timestamps for sub-devices when -/// device handle is sub-device or may return 0 for count. -/// -/// @remarks -/// _Analogues_ -/// - None -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST -/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY -/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeEventQueryTimestampsExp( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. - ///< if count is zero, then the driver shall update the value with the - ///< total number of timestamps available. - ///< if count is greater than the number of timestamps available, then the - ///< driver shall update the value with the correct number of timestamps available. - ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. - ///< if count is less than the number of timestamps available, then driver - ///< shall only retrieve that number of timestamps. - ); +/// - This structure may be returned from ::zeDriverGetProperties, via the +/// `pNext` member of ::ze_driver_properties_t. +typedef struct _ze_driver_ddi_handles_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_driver_ddi_handle_ext_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_driver_ddi_handle_ext_flags_t + +} ze_driver_ddi_handles_ext_properties_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for supporting image memory properties. +// Intel 'oneAPI' Level-Zero Extension for external semaphores #if !defined(__GNUC__) -#pragma region imagememoryproperties +#pragma region externalSemaphores #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME -/// @brief Image Memory Properties Extension Name -#define ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME "ZE_experimental_image_memory_properties" -#endif // ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME +#ifndef ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME +/// @brief External Semaphores Extension Name +#define ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME "ZE_extension_external_semaphores" +#endif // ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Image Memory Properties Extension Version(s) -typedef enum _ze_image_memory_properties_exp_version_t +/// @brief External Semaphores Extension Version +typedef enum _ze_external_semaphore_ext_version_t { - ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_* ENUMs -} ze_image_memory_properties_exp_version_t; +} ze_external_semaphore_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image memory properties -typedef struct _ze_image_memory_properties_exp_t +/// @brief Handle of external semaphore object +typedef struct _ze_external_semaphore_ext_handle_t *ze_external_semaphore_ext_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphores Type Flags +typedef uint32_t ze_external_semaphore_ext_flags_t; +typedef enum _ze_external_semaphore_ext_flag_t +{ + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_FD = ZE_BIT(0), ///< Semaphore is an Linux opaque file descriptor + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32 = ZE_BIT(1), ///< Semaphore is an opaque Win32 handle for monitored fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32_KMT = ZE_BIT(2), ///< Semaphore is an opaque Win32 KMT handle for monitored fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE = ZE_BIT(3), ///< Semaphore is a D3D12 fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D11_FENCE = ZE_BIT(4), ///< Semaphore is a D3D11 fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX = ZE_BIT(5), ///< Semaphore is a keyed mutex for Win32 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX_KMT = ZE_BIT(6), ///< Semaphore is a keyed mutex for Win32 KMT + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_FD = ZE_BIT(7), ///< Semaphore is a Vulkan Timeline semaphore for Linux + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_WIN32 = ZE_BIT(8), ///< Semaphore is a Vulkan Timeline semaphore for Win32 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_* ENUMs + +} ze_external_semaphore_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore Descriptor +typedef struct _ze_external_semaphore_ext_desc_t { ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint64_t size; ///< [out] size of image allocation in bytes. - uint64_t rowPitch; ///< [out] size of image row in bytes. - uint64_t slicePitch; ///< [out] size of image slice in bytes. + ze_external_semaphore_ext_flags_t flags; ///< [in] The flags describing the type of the semaphore. + ///< must be 0 (default) or a valid combination of ::ze_external_semaphore_ext_flag_t. + ///< When importing a semaphore, pNext should be pointing to one of the + ///< following structures: ::ze_external_semaphore_win32_ext_desc_t or ::ze_external_semaphore_fd_ext_desc_t. -} ze_image_memory_properties_exp_t; +} ze_external_semaphore_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Query image memory properties. +/// @brief External Semaphore Win32 Descriptor +typedef struct _ze_external_semaphore_win32_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + void* handle; ///< [in] Win32 handle of the semaphore. + ///< Must be a valid Win32 handle. + const char* name; ///< [in] Name of the semaphore. + ///< Must be a valid null-terminated string. + +} ze_external_semaphore_win32_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore FD Descriptor +typedef struct _ze_external_semaphore_fd_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + int fd; ///< [in] File descriptor of the semaphore. + ///< Must be a valid file descriptor. + +} ze_external_semaphore_fd_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore Signal parameters +typedef struct _ze_external_semaphore_signal_params_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t value; ///< [in] [optional] Value to signal. + ///< Specified by user as an expected value with some of semaphore types, + ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. + +} ze_external_semaphore_signal_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore Wait parameters +typedef struct _ze_external_semaphore_wait_params_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t value; ///< [in] [optional] Value to wait for. + ///< Specified by user as an expected value with some of semaphore types, + ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. + +} ze_external_semaphore_wait_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Import an external semaphore /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_experimental_image_memory_properties extension. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - Imports an external semaphore. +/// - This function may be called from simultaneous threads with the same +/// device handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7386,58 +9888,38 @@ typedef struct _ze_image_memory_properties_exp_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hImage` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemoryProperties` +/// + `nullptr == desc` +/// + `nullptr == phSemaphore` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x1ff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageGetMemoryPropertiesExp( - ze_image_handle_t hImage, ///< [in] handle of image object - ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. +zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting image views. -#if !defined(__GNUC__) -#pragma region imageview -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_EXT_NAME -/// @brief Image View Extension Name -#define ZE_IMAGE_VIEW_EXT_NAME "ZE_extension_image_view" -#endif // ZE_IMAGE_VIEW_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Extension Version(s) -typedef enum _ze_image_view_ext_version_t -{ - ZE_IMAGE_VIEW_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_image_view_ext_version_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Release an external semaphore /// /// @details -/// - The application must only use the image view for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. +/// - The application must ensure the device is not currently referencing +/// the semaphore before it is released. +/// - The application must **not** call this function from simultaneous +/// threads with the same semaphore handle. /// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_extension_image_view extension. -/// - Image views are treated as images from the API. -/// - Image views provide a mechanism to redescribe how an image is -/// interpreted (e.g. different format). -/// - Image views become disabled when their corresponding image resource is -/// destroyed. -/// - Use ::zeImageDestroy to destroy image view objects. -/// -/// @remarks -/// _Analogues_ -/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7445,64 +9927,31 @@ typedef enum _ze_image_view_ext_version_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// + `nullptr == hImage` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phImageView` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +/// + `nullptr == hSemaphore` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageViewCreateExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view +zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. ); /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_EXP_NAME -/// @brief Image View Extension Name -#define ZE_IMAGE_VIEW_EXP_NAME "ZE_experimental_image_view" -#endif // ZE_IMAGE_VIEW_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Extension Version(s) -typedef enum _ze_image_view_exp_version_t -{ - ZE_IMAGE_VIEW_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_image_view_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Create image view on the context. +/// @brief Signal an external semaphore /// /// @details -/// - The application must only use the image view for the device, or its -/// sub-devices, which was provided during creation. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_experimental_image_view -/// extension. -/// - Image views are treated as images from the API. -/// - Image views provide a mechanism to redescribe how an image is -/// interpreted (e.g. different format). -/// - Image views become disabled when their corresponding image resource is -/// destroyed. -/// - Use ::zeImageDestroy to destroy image view objects. -/// - Note: This function is deprecated and replaced by -/// ::zeImageViewCreateExt. -/// -/// @remarks -/// _Analogues_ -/// - None +/// - Signals an external semaphore. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7510,505 +9959,720 @@ typedef enum _ze_image_view_exp_version_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hDevice` -/// + `nullptr == hImage` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == desc` -/// + `nullptr == phImageView` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < desc->flags` -/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT +/// + `nullptr == phSemaphores` +/// + `nullptr == signalParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == signalParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageViewCreateExp( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device - const ze_image_desc_t* desc, ///< [in] pointer to image descriptor - ze_image_handle_t hImage, ///< [in] handle of image object to create view from - ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view +zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore handles to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams, ///< [in][range(0, numSemaphores)] The array of pointers to external + ///< semaphore signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting image views for planar images. -#if !defined(__GNUC__) -#pragma region imageviewplanar -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_PLANAR_EXT_NAME -/// @brief Image View Planar Extension Name -#define ZE_IMAGE_VIEW_PLANAR_EXT_NAME "ZE_extension_image_view_planar" -#endif // ZE_IMAGE_VIEW_PLANAR_EXT_NAME - /////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Planar Extension Version(s) -typedef enum _ze_image_view_planar_ext_version_t -{ - ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_image_view_planar_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image view planar descriptor -typedef struct _ze_image_view_planar_ext_desc_t -{ - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint32_t planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) - -} ze_image_view_planar_ext_desc_t; +/// @brief Wait on external semaphores +/// +/// @details +/// - Waits on external semaphores. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phSemaphores` +/// + `nullptr == waitParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == waitParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore handles to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams, ///< [in][range(0,numSemaphores)] The array of pointers to external + ///< semaphore wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for CacheLine Size +#if !defined(__GNUC__) +#pragma region CacheLineSize +#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_VIEW_PLANAR_EXP_NAME -/// @brief Image View Planar Extension Name -#define ZE_IMAGE_VIEW_PLANAR_EXP_NAME "ZE_experimental_image_view_planar" -#endif // ZE_IMAGE_VIEW_PLANAR_EXP_NAME +#ifndef ZE_CACHELINE_SIZE_EXT_NAME +/// @brief CacheLine Size Extension Name +#define ZE_CACHELINE_SIZE_EXT_NAME "ZE_extension_device_cache_line_size" +#endif // ZE_CACHELINE_SIZE_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Image View Planar Extension Version(s) -typedef enum _ze_image_view_planar_exp_version_t +/// @brief CacheLine Size Extension Version(s) +typedef enum _ze_device_cache_line_size_ext_version_t { - ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_* ENUMs -} ze_image_view_planar_exp_version_t; +} ze_device_cache_line_size_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image view planar descriptor -typedef struct _ze_image_view_planar_exp_desc_t +/// @brief CacheLine Size queried using ::zeDeviceGetCacheProperties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetCacheProperties via +/// the `pNext` member of ::ze_device_cache_properties_t. +/// - Used for determining the cache line size supported on a device. +typedef struct _ze_device_cache_line_size_ext_t { ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) + size_t cacheLineSize; ///< [out] The cache line size in bytes. -} ze_image_view_planar_exp_desc_t; +} ze_device_cache_line_size_ext_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for specifying kernel scheduling hints. +// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure. #if !defined(__GNUC__) -#pragma region kernelSchedulingHints +#pragma region RTAS #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME -/// @brief Kernel Scheduling Hints Extension Name -#define ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME "ZE_experimental_scheduling_hints" -#endif // ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME +#ifndef ZE_RTAS_EXT_NAME +/// @brief Ray Tracing Acceleration Structure Extension Name +#define ZE_RTAS_EXT_NAME "ZE_extension_rtas" +#endif // ZE_RTAS_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel Scheduling Hints Extension Version(s) -typedef enum _ze_scheduling_hints_exp_version_t +/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) +typedef enum _ze_rtas_builder_ext_version_t { - ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SCHEDULING_HINTS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RTAS_BUILDER_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RTAS_BUILDER_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXT_VERSION_* ENUMs -} ze_scheduling_hints_exp_version_t; +} ze_rtas_builder_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported kernel scheduling hint flags -typedef uint32_t ze_scheduling_hint_exp_flags_t; -typedef enum _ze_scheduling_hint_exp_flag_t +/// @brief Ray tracing acceleration structure device flags +typedef uint32_t ze_rtas_device_ext_flags_t; +typedef enum _ze_rtas_device_ext_flag_t { - ZE_SCHEDULING_HINT_EXP_FLAG_OLDEST_FIRST = ZE_BIT(0), ///< Hint that the kernel prefers oldest-first scheduling - ZE_SCHEDULING_HINT_EXP_FLAG_ROUND_ROBIN = ZE_BIT(1), ///< Hint that the kernel prefers round-robin scheduling - ZE_SCHEDULING_HINT_EXP_FLAG_STALL_BASED_ROUND_ROBIN = ZE_BIT(2), ///< Hint that the kernel prefers stall-based round-robin scheduling - ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_DEVICE_EXT_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use + ZE_RTAS_DEVICE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_DEVICE_EXT_FLAG_* ENUMs -} ze_scheduling_hint_exp_flag_t; +} ze_rtas_device_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device kernel scheduling hint properties queried using -/// ::zeDeviceGetModuleProperties +/// @brief Ray tracing acceleration structure format /// /// @details -/// - This structure may be returned from ::zeDeviceGetModuleProperties, via -/// the `pNext` member of ::ze_device_module_properties_t. -typedef struct _ze_scheduling_hint_exp_properties_t +/// - This is an opaque ray tracing acceleration structure format +/// identifier. +typedef enum _ze_rtas_format_ext_t { - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_scheduling_hint_exp_flags_t schedulingHintFlags; ///< [out] Supported kernel scheduling hints. - ///< May be 0 (none) or a valid combination of ::ze_scheduling_hint_exp_flag_t. + ZE_RTAS_FORMAT_EXT_INVALID = 0x0, ///< Invalid acceleration structure format code + ZE_RTAS_FORMAT_EXT_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code + ZE_RTAS_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_FORMAT_EXT_* ENUMs -} ze_scheduling_hint_exp_properties_t; +} ze_rtas_format_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel scheduling hint descriptor -/// -/// @details -/// - This structure may be passed to ::zeKernelSchedulingHintExp. -typedef struct _ze_scheduling_hint_exp_desc_t +/// @brief Ray tracing acceleration structure builder flags +typedef uint32_t ze_rtas_builder_ext_flags_t; +typedef enum _ze_rtas_builder_ext_flag_t { - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_scheduling_hint_exp_flags_t flags; ///< [in] flags specifying kernel scheduling hints. - ///< must be 0 (default) or a valid combination of ::ze_scheduling_hint_exp_flag_t. + ZE_RTAS_BUILDER_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_BUILDER_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXT_FLAG_* ENUMs -} ze_scheduling_hint_exp_desc_t; +} ze_rtas_builder_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Provide kernel scheduling hints that may improve performance -/// -/// @details -/// - The scheduling hints may improve performance only and are not required -/// for correctness. -/// - If a specified scheduling hint is unsupported it will be silently -/// ignored. -/// - If two conflicting scheduling hints are specified there is no defined behavior; -/// the hints may be ignored or one hint may be chosen arbitrarily. -/// - The application must not call this function from simultaneous threads -/// with the same kernel handle. -/// - The implementation of this function should be lock-free. -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST -/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY -/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hKernel` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pHint` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < pHint->flags` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeKernelSchedulingHintExp( - ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object - ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor - ); +/// @brief Ray tracing acceleration structure builder parallel operation flags +typedef uint32_t ze_rtas_parallel_operation_ext_flags_t; +typedef enum _ze_rtas_parallel_operation_ext_flag_t +{ + ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_* ENUMs + +} ze_rtas_parallel_operation_ext_flag_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for One-Definition-Rule Linkage Types -#if !defined(__GNUC__) -#pragma region linkonceodr -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_LINKONCE_ODR_EXT_NAME -/// @brief Linkonce ODR Extension Name -#define ZE_LINKONCE_ODR_EXT_NAME "ZE_extension_linkonce_odr" -#endif // ZE_LINKONCE_ODR_EXT_NAME +/// @brief Ray tracing acceleration structure builder geometry flags +typedef uint32_t ze_rtas_builder_geometry_ext_flags_t; +typedef enum _ze_rtas_builder_geometry_ext_flag_t +{ + ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader + ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_* ENUMs + +} ze_rtas_builder_geometry_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Linkonce ODR Extension Version(s) -typedef enum _ze_linkonce_odr_ext_version_t +/// @brief Packed ray tracing acceleration structure builder geometry flags (see +/// ::ze_rtas_builder_geometry_ext_flags_t) +typedef uint8_t ze_rtas_builder_packed_geometry_ext_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance flags +typedef uint32_t ze_rtas_builder_instance_ext_flags_t; +typedef enum _ze_rtas_builder_instance_ext_flag_t { - ZE_LINKONCE_ODR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_LINKONCE_ODR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to + ///< be non-opaque + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it + ///< to be opaque + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_* ENUMs -} ze_linkonce_odr_ext_version_t; +} ze_rtas_builder_instance_ext_flag_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting power saving hint. -#if !defined(__GNUC__) -#pragma region powersavinghint -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME -/// @brief Power Saving Hint Extension Name -#define ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME "ZE_experimental_power_saving_hint" -#endif // ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME +/// @brief Packed ray tracing acceleration structure builder instance flags (see +/// ::ze_rtas_builder_instance_ext_flags_t) +typedef uint8_t ze_rtas_builder_packed_instance_ext_flags_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Power Saving Hint Extension Version(s) -typedef enum _ze_power_saving_hint_exp_version_t +/// @brief Ray tracing acceleration structure builder build operation flags +/// +/// @details +/// - These flags allow the application to tune the acceleration structure +/// build operation. +/// - The acceleration structure builder implementation might choose to use +/// spatial splitting to split large or long primitives into smaller +/// pieces. This may result in any-hit shaders being invoked multiple +/// times for non-opaque primitives, unless +/// ::ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. +/// - Usage of any of these flags may reduce ray tracing performance. +typedef uint32_t ze_rtas_builder_build_op_ext_flags_t; +typedef enum _ze_rtas_builder_build_op_ext_flag_t { - ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_* ENUMs -} ze_power_saving_hint_exp_version_t; +} ze_rtas_builder_build_op_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported device types -typedef enum _ze_power_saving_hint_type_t +/// @brief Ray tracing acceleration structure builder build quality hint +/// +/// @details +/// - Depending on use case different quality modes for acceleration +/// structure build are supported. +/// - A low-quality build builds an acceleration structure fast, but at the +/// cost of some reduction in ray tracing performance. This mode is +/// recommended for dynamic content, such as animated characters. +/// - A medium-quality build uses a compromise between build quality and ray +/// tracing performance. This mode should be used by default. +/// - Higher ray tracing performance can be achieved by using a high-quality +/// build, but acceleration structure build performance might be +/// significantly reduced. +typedef enum _ze_rtas_builder_build_quality_hint_ext_t { - ZE_POWER_SAVING_HINT_TYPE_MIN = 0, ///< Minumum power savings. The device will make no attempt to save power - ///< while executing work submitted to this context. - ZE_POWER_SAVING_HINT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to - ///< a minimum while executing work submitted to this context. - ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW = 0, ///< build low-quality acceleration structure (fast) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH = 2, ///< build high-quality acceleration structure (slow) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_* ENUMs -} ze_power_saving_hint_type_t; +} ze_rtas_builder_build_quality_hint_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Extended context descriptor containing power saving hint. -typedef struct _ze_context_power_saving_hint_exp_desc_t +/// @brief Ray tracing acceleration structure builder geometry type +typedef enum _ze_rtas_builder_geometry_type_ext_t { - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint32_t hint; ///< [in] power saving hint (default value = 0). This is value from [0,100] - ///< and can use pre-defined settings from ::ze_power_saving_hint_type_t. + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES = 0, ///< triangle mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS = 1, ///< quad mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL = 2, ///< procedural geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE = 3, ///< instance geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_* ENUMs -} ze_context_power_saving_hint_exp_desc_t; +} ze_rtas_builder_geometry_type_ext_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Subgroups -#if !defined(__GNUC__) -#pragma region subgroups -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_SUBGROUPS_EXT_NAME -/// @brief Subgroups Extension Name -#define ZE_SUBGROUPS_EXT_NAME "ZE_extension_subgroups" -#endif // ZE_SUBGROUPS_EXT_NAME +/// @brief Packed ray tracing acceleration structure builder geometry type (see +/// ::ze_rtas_builder_geometry_type_ext_t) +typedef uint8_t ze_rtas_builder_packed_geometry_type_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Subgroups Extension Version(s) -typedef enum _ze_subgroup_ext_version_t +/// @brief Ray tracing acceleration structure data buffer element format +/// +/// @details +/// - Specifies the format of data buffer elements. +/// - Data buffers may contain instancing transform matrices, triangle/quad +/// vertex indices, etc... +typedef enum _ze_rtas_builder_input_data_format_ext_t { - ZE_SUBGROUP_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SUBGROUP_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_column_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_aligned_column_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see + ///< ::ze_rtas_transform_float3x4_row_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see + ///< ::ze_rtas_triangle_indices_uint32_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_* ENUMs -} ze_subgroup_ext_version_t; +} ze_rtas_builder_input_data_format_ext_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for EU Count -#if !defined(__GNUC__) -#pragma region EUCount -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EU_COUNT_EXT_NAME -/// @brief EU Count Extension Name -#define ZE_EU_COUNT_EXT_NAME "ZE_extension_eu_count" -#endif // ZE_EU_COUNT_EXT_NAME +/// @brief Packed ray tracing acceleration structure data buffer element format +/// (see ::ze_rtas_builder_input_data_format_ext_t) +typedef uint8_t ze_rtas_builder_packed_input_data_format_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief EU Count Extension Version(s) -typedef enum _ze_eu_count_ext_version_t -{ - ZE_EU_COUNT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EU_COUNT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff +/// @brief Handle of ray tracing acceleration structure builder object +typedef struct _ze_rtas_builder_ext_handle_t *ze_rtas_builder_ext_handle_t; -} ze_eu_count_ext_version_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder parallel +/// operation object +typedef struct _ze_rtas_parallel_operation_ext_handle_t *ze_rtas_parallel_operation_ext_handle_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief EU count queried using ::zeDeviceGetProperties -/// -/// @details -/// - This structure may be returned from ::zeDeviceGetProperties via the -/// `pNext` member of ::ze_device_properties_t. -/// - Used for determining the total number of EUs available on device. -typedef struct _ze_eu_count_ext_t +/// @brief Ray tracing acceleration structure builder descriptor +typedef struct _ze_rtas_builder_ext_desc_t { ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t numTotalEUs; ///< [out] Total number of EUs available + ze_rtas_builder_ext_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version -} ze_eu_count_ext_t; +} ze_rtas_builder_ext_desc_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for PCI Properties -#if !defined(__GNUC__) -#pragma region PCIProperties -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_PCI_PROPERTIES_EXT_NAME -/// @brief PCI Properties Extension Name -#define ZE_PCI_PROPERTIES_EXT_NAME "ZE_extension_pci_properties" -#endif // ZE_PCI_PROPERTIES_EXT_NAME +/// @brief Ray tracing acceleration structure builder properties +typedef struct _ze_rtas_builder_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_builder_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder flags + size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is expected to succeed; however, it is possible that the build + ///< may fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY + size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is guaranteed to not run out of memory. + size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration + ///< structure build. + +} ze_rtas_builder_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief PCI Properties Extension Version(s) -typedef enum _ze_pci_properties_ext_version_t +/// @brief Ray tracing acceleration structure builder parallel operation +/// properties +typedef struct _ze_rtas_parallel_operation_ext_properties_t { - ZE_PCI_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_PCI_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_parallel_operation_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation + ///< flags + uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation -} ze_pci_properties_ext_version_t; +} ze_rtas_parallel_operation_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device PCI address +/// @brief Ray tracing acceleration structure device properties /// /// @details -/// - This structure may be passed to ::zeDevicePciGetPropertiesExt as an -/// attribute of ::ze_pci_ext_properties_t. -/// - A PCI BDF address is the bus:device:function address of the device and -/// is useful for locating the device in the PCI switch fabric. -typedef struct _ze_pci_address_ext_t +/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` +/// member of ::ze_device_properties_t. +/// - The implementation shall populate `format` with a value other than +/// ::ZE_RTAS_FORMAT_EXT_INVALID when the device supports ray tracing. +typedef struct _ze_rtas_device_ext_properties_t { - uint32_t domain; ///< [out] PCI domain number - uint32_t bus; ///< [out] PCI BDF bus number - uint32_t device; ///< [out] PCI BDF device number - uint32_t function; ///< [out] PCI BDF function number + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_device_ext_flags_t flags; ///< [out] ray tracing acceleration structure device flags + ze_rtas_format_ext_t rtasFormat; ///< [out] ray tracing acceleration structure format + uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer -} ze_pci_address_ext_t; +} ze_rtas_device_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device PCI speed -typedef struct _ze_pci_speed_ext_t +/// @brief A 3-component vector type +typedef struct _ze_rtas_float3_ext_t { - int32_t genVersion; ///< [out] The link generation. A value of -1 means that this property is - ///< unknown. - int32_t width; ///< [out] The number of lanes. A value of -1 means that this property is - ///< unknown. - int64_t maxBandwidth; ///< [out] The theoretical maximum bandwidth in bytes/sec (sum of all - ///< lanes). A value of -1 means that this property is unknown. + float x; ///< [in] x-coordinate of float3 vector + float y; ///< [in] y-coordinate of float3 vector + float z; ///< [in] z-coordinate of float3 vector -} ze_pci_speed_ext_t; +} ze_rtas_float3_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Static PCI properties -typedef struct _ze_pci_ext_properties_t +/// @brief 3x4 affine transformation in column-major layout +/// +/// @details +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_column_major_ext_t { - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_pci_address_ext_t address; ///< [out] The BDF address - ze_pci_speed_ext_t maxSpeed; ///< [out] Fastest port configuration supported by the device (sum of all - ///< lanes) + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix -} ze_pci_ext_properties_t; +} ze_rtas_transform_float3x4_column_major_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Get PCI properties - address, max speed +/// @brief 3x4 affine transformation in column-major layout with aligned column +/// vectors /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - None -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST -/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY -/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pPciProperties` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeDevicePciGetPropertiesExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object. - ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. - ); - -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for sRGB -#if !defined(__GNUC__) -#pragma region SRGB -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_SRGB_EXT_NAME -/// @brief sRGB Extension Name -#define ZE_SRGB_EXT_NAME "ZE_extension_srgb" -#endif // ZE_SRGB_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief sRGB Extension Version(s) -typedef enum _ze_srgb_ext_version_t +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +/// - The column vectors are aligned to 16-bytes and pad members are +/// ignored. +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t { - ZE_SRGB_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SRGB_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float pad0; ///< [in] ignored padding + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float pad1; ///< [in] ignored padding + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float pad2; ///< [in] ignored padding + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + float pad3; ///< [in] ignored padding -} ze_srgb_ext_version_t; +} ze_rtas_transform_float3x4_aligned_column_major_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief sRGB image descriptor +/// @brief 3x4 affine transformation in row-major layout /// /// @details -/// - This structure may be passed to ::zeImageCreate via the `pNext` member -/// of ::ze_image_desc_t -/// - Used for specifying that the image is in sRGB format. -typedef struct _ze_srgb_ext_desc_t +/// - A 3x4 affine transformation in row-major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_row_major_ext_t { - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_bool_t sRGB; ///< [in] Is sRGB. - -} ze_srgb_ext_desc_t; + float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix + float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix + float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix + float p_x; ///< [in] element 3 of row 0 of 3x4 matrix + float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix + float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix + float p_y; ///< [in] element 3 of row 1 of 3x4 matrix + float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix + float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix + float p_z; ///< [in] element 3 of row 2 of 3x4 matrix -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Image Copy To/From Memory -#if !defined(__GNUC__) -#pragma region imageCopy -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_COPY_EXT_NAME -/// @brief Image Copy Extension Name -#define ZE_IMAGE_COPY_EXT_NAME "ZE_extension_image_copy" -#endif // ZE_IMAGE_COPY_EXT_NAME +} ze_rtas_transform_float3x4_row_major_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Image Copy Extension Version(s) -typedef enum _ze_image_copy_ext_version_t +/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds +/// in each dimension +typedef struct _ze_rtas_aabb_ext_t { - ZE_IMAGE_COPY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_COPY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ze_rtas_float3_ext_t lower; ///< [in] lower bounds of AABB + ze_rtas_float3_ext_t upper; ///< [in] upper bounds of AABB -} ze_image_copy_ext_version_t; +} ze_rtas_aabb_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies from an image to device or shared memory. +/// @brief Triangle represented using 3 vertex indices /// /// @details -/// - The application must ensure the memory pointed to by dstptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by dstptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the source -/// image is a single-planar format. -/// - The application must ensure that the rowPitch is set to 0 if image is -/// a 1D image. Otherwise the rowPitch must be greater than or equal to -/// the element size in bytes x width. -/// - If rowPitch is set to 0, the appropriate row pitch is calculated based -/// on the size of each element in bytes multiplied by width -/// - The application must ensure that the slicePitch is set to 0 if image -/// is a 1D or 2D image. Otherwise this value must be greater than or -/// equal to rowPitch x height. -/// - If slicePitch is set to 0, the appropriate slice pitch is calculated -/// based on the rowPitch x height. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, on the same context. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. -/// - The implementation of this function should be lock-free. +/// - Represents a triangle using 3 vertex indices that index into a vertex +/// array that needs to be provided together with the index array. +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_triangle_indices_uint32_ext_t +{ + uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex + ///< array + uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array + +} ze_rtas_triangle_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Quad represented using 4 vertex indices /// -/// @remarks -/// _Analogues_ -/// - clEnqueueReadImage +/// @details +/// - Represents a quad composed of 4 indices that index into a vertex array +/// that needs to be provided together with the index array. +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_quad_indices_uint32_ext_t +{ + uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array + uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array + uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array + +} ze_rtas_quad_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry info +typedef struct _ze_rtas_builder_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type + +} ze_rtas_builder_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder triangle mesh geometry info +/// +/// @details +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t triangleFormat; ///< [in] format of triangle buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 + uint32_t triangleCount; ///< [in] number of triangles in triangle buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format + +} ze_rtas_builder_triangles_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder quad mesh geometry info +/// +/// @details +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_builder_quads_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t quadFormat; ///< [in] format of quad buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 + uint32_t quadCount; ///< [in] number of quads in quad buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format + +} ze_rtas_builder_quads_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief AABB callback function parameters +typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t primID; ///< [in] first primitive to return bounds for + uint32_t primIDCount; ///< [in] number of primitives to return bounds for + void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor + void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExt function + ze_rtas_aabb_ext_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to + +} ze_rtas_geometry_aabbs_ext_cb_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function pointer type to return AABBs for a range of +/// procedural primitives +typedef void (*ze_rtas_geometry_aabbs_cb_ext_t)( + ze_rtas_geometry_aabbs_ext_cb_params_t* params ///< [in] callback function parameters structure + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder procedural primitives +/// geometry info +/// +/// @details +/// - A host-side bounds callback function is invoked by the acceleration +/// structure builder to query the bounds of procedural primitives on +/// demand. The callback is passed some `pGeomUserPtr` that can point to +/// an application-side representation of the procedural primitives. +/// Further, a second `pBuildUserPtr`, which is set by a parameter to +/// ::zeRTASBuilderBuildExt, is passed to the callback. This allows the +/// build to change the bounds of the procedural geometry, for example, to +/// build a BVH only over a short time range to implement multi-segment +/// motion blur. +typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + uint8_t reserved; ///< [in] reserved for future use + uint32_t primCount; ///< [in] number of primitives in geometry + ze_rtas_geometry_aabbs_cb_ext_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box + ///< for a range of primitives + void* pGeomUserPtr; ///< [in] user data pointer passed to callback + +} ze_rtas_builder_procedural_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance geometry info +typedef struct _ze_rtas_builder_instance_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE + ze_rtas_builder_packed_instance_ext_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t transformFormat; ///< [in] format of the specified transformation + uint32_t instanceUserID; ///< [in] user-specified identifier for the instance + void* pTransform; ///< [in] object-to-world instance transformation in specified format + ze_rtas_aabb_ext_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced + ///< acceleration structure + void* pAccelerationStructure; ///< [in] device pointer to acceleration structure to instantiate + +} ze_rtas_builder_instance_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief +typedef struct _ze_rtas_builder_build_op_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_format_ext_t rtasFormat; ///< [in] ray tracing acceleration structure format + ze_rtas_builder_build_quality_hint_ext_t buildQuality; ///< [in] acceleration structure build quality hint + ze_rtas_builder_build_op_ext_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_ext_flag_t + ///< flags + const ze_rtas_builder_geometry_info_ext_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of + ///< pointers to geometry infos + uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when + ///< `ppGeometries` is NULL + +} ze_rtas_builder_build_op_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a ray tracing acceleration structure builder object +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8016,63 +10680,35 @@ typedef enum _ze_image_copy_ext_version_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hSrcImage` +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == dstptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendImageCopyToMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - void* dstptr, ///< [in] pointer to destination memory to copy to - ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from - const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor - uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being written - uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being written - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Copies to an image from device or shared memory. +/// @brief Retrieves ray tracing acceleration structure builder properties /// /// @details -/// - The application must ensure the memory pointed to by srcptr is -/// accessible by the device on which the command list was created. -/// - The implementation must not access the memory pointed to by srcptr as -/// it is free to be modified by either the Host or device up until -/// execution. -/// - The application must ensure the image and events are accessible by the -/// device on which the command list was created. -/// - The application must ensure the image format descriptor for the -/// destination image is a single-planar format. -/// - The application must ensure that the rowPitch is set to 0 if image is -/// a 1D image. Otherwise the rowPitch must be greater than or equal to -/// the element size in bytes x width. -/// - If rowPitch is set to 0, the appropriate row pitch is calculated based -/// on the size of each element in bytes multiplied by width -/// - The application must ensure that the slicePitch is set to 0 if image -/// is a 1D or 2D image. Otherwise this value must be greater than or -/// equal to rowPitch x height. -/// - If slicePitch is set to 0, the appropriate slice pitch is calculated -/// based on the rowPitch x height. -/// - The application must ensure the command list, image and events were -/// created, and the memory was allocated, on the same context. -/// - The application must **not** call this function from simultaneous -/// threads with the same command list handle. -/// - The implementation of this function should be lock-free. -/// -/// @remarks -/// _Analogues_ -/// - clEnqueueWriteImage +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8080,71 +10716,117 @@ zeCommandListAppendImageCopyToMemoryExt( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hCommandList` -/// + `nullptr == hDstImage` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == srcptr` -/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT -/// - ::ZE_RESULT_ERROR_INVALID_SIZE -/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeCommandListAppendImageCopyFromMemoryExt( - ze_command_list_handle_t hCommandList, ///< [in] handle of command list - ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to - const void* srcptr, ///< [in] pointer to source memory to copy from - const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor - uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D - ///< image or each image of a 1D or 2D image array being read - uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or - ///< each image of a 1D or 2D image array being read - ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion - uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 - ///< if `nullptr == phWaitEvents` - ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait - ///< on before launching +zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for Querying Image Allocation Properties. -#if !defined(__GNUC__) -#pragma region imageQueryAllocProperties -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME -/// @brief Image Query Allocation Properties Extension Name -#define ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME "ZE_extension_image_query_alloc_properties" -#endif // ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME - /////////////////////////////////////////////////////////////////////////////// -/// @brief Image Query Allocation Properties Extension Version(s) -typedef enum _ze_image_query_alloc_properties_ext_version_t -{ - ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_image_query_alloc_properties_ext_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Image allocation properties queried using -/// ::zeImageGetAllocPropertiesExt -typedef struct _ze_image_allocation_ext_properties_t -{ - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint64_t id; ///< [out] identifier for this allocation - -} ze_image_allocation_ext_properties_t; +/// @brief Checks ray tracing acceleration structure format compatibility +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves attributes of an image allocation +/// @brief Build ray tracing acceleration structure /// /// @details -/// - The application may call this function from simultaneous threads. +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. +/// - When using the "expected" size for the acceleration structure buffer, +/// the acceleration structure construction may fail with +/// ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. If this happens, the user may resize +/// their acceleration structure buffer using the returned +/// `*pRtasBufferSizeBytes` value, which will be updated with an improved +/// size estimate that will likely result in a successful build. +/// - The acceleration structure construction is run on the host and is +/// synchronous, thus after the function returns with a successful result, +/// the acceleration structure may be used. +/// - All provided data buffers must be host-accessible. The referenced +/// scene data (index- and vertex- buffers) have to be accessible from the +/// host, and will **not** be referenced by the build acceleration structure. +/// - The acceleration structure buffer is typicall a host allocation that +/// is later manually copied to a device allocation. Alternatively one can +/// also use a shared USM allocation as acceration structure buffer and +/// skip the copy. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - Acceleration structure construction may be parallelized by passing a +/// valid handle to a parallel operation object and joining that parallel +/// operation using ::zeRTASParallelOperationJoinExt with user-provided +/// worker threads. +/// - A successfully constructed acceleration structure is generally +/// non-copyable. It can only get copied from host to device using the +/// special ::zeRTASBuilderCommandListAppendCopyExt function. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8152,78 +10834,147 @@ typedef struct _ze_image_allocation_ext_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` -/// + `nullptr == hImage` +/// + `nullptr == hBuilder` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pImageAllocProperties` +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. ZE_APIEXPORT ze_result_t ZE_APICALL -zeImageGetAllocPropertiesExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - ze_image_handle_t hImage, ///< [in] handle of image object to query - ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties +zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Linkage Inspection -#if !defined(__GNUC__) -#pragma region linkageInspection -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_LINKAGE_INSPECTION_EXT_NAME -/// @brief Linkage Inspection Extension Name -#define ZE_LINKAGE_INSPECTION_EXT_NAME "ZE_extension_linkage_inspection" -#endif // ZE_LINKAGE_INSPECTION_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Linkage Inspection Extension Version(s) -typedef enum _ze_linkage_inspection_ext_version_t -{ - ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_LINKAGE_INSPECTION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_linkage_inspection_ext_version_t; - /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported module linkage inspection flags -typedef uint32_t ze_linkage_inspection_ext_flags_t; -typedef enum _ze_linkage_inspection_ext_flag_t -{ - ZE_LINKAGE_INSPECTION_EXT_FLAG_IMPORTS = ZE_BIT(0), ///< List all imports of modules - ZE_LINKAGE_INSPECTION_EXT_FLAG_UNRESOLVABLE_IMPORTS = ZE_BIT(1), ///< List all imports of modules that do not have a corresponding export - ZE_LINKAGE_INSPECTION_EXT_FLAG_EXPORTS = ZE_BIT(2), ///< List all exports of modules - ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff - -} ze_linkage_inspection_ext_flag_t; +/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device +/// memory. +/// +/// @details +/// - The memory pointed to by srcptr must be host memory containing a valid +/// ray tracing acceleration structure. +/// - The number of bytes to copy must be larger or equal to the size of the +/// ray tracing acceleration structure. +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - The application must ensure the command list and events were created, +/// and the memory was allocated, on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == dstptr` +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Module linkage inspection descriptor +/// @brief Destroys a ray tracing acceleration structure builder object /// /// @details -/// - This structure may be passed to ::zeModuleInspectLinkageExt. -typedef struct _ze_linkage_inspection_ext_desc_t -{ - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_linkage_inspection_ext_flags_t flags; ///< [in] flags specifying module linkage inspection. - ///< must be 0 (default) or a valid combination of ::ze_linkage_inspection_ext_flag_t. - -} ze_linkage_inspection_ext_desc_t; +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. +/// - The application must **not** call this function from simultaneous +/// threads with the same builder handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief List Imports & Exports +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object /// /// @details -/// - List all the import & unresolveable import dependencies & exports of a -/// set of modules -/// -/// @remarks -/// _Analogues_ -/// - None +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_EXT_NAME extension. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8231,150 +10982,305 @@ typedef struct _ze_linkage_inspection_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pInspectDesc` -/// + `nullptr == phModules` -/// + `nullptr == phLog` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7 < pInspectDesc->flags` +/// + `nullptr == phParallelOperation` ZE_APIEXPORT ze_result_t ZE_APICALL -zeModuleInspectLinkageExt( - ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. - uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. - ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be - ///< inspected for import dependencies. - ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will - ///< contain separate lists of imports, un-resolvable imports, and exports. +zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ///< [out] handle of parallel operation object ); -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting memory compression hints. -#if !defined(__GNUC__) -#pragma region memoryCompressionHints -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME -/// @brief Memory Compression Hints Extension Name -#define ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME "ZE_extension_memory_compression_hints" -#endif // ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties +/// +/// @details +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling +/// this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties ///< [in,out] query result for parallel operation properties + ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory Compression Hints Extension Version(s) -typedef enum _ze_memory_compression_hints_ext_version_t -{ - ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff +/// @brief Joins a parallel build operation +/// +/// @details +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ); -} ze_memory_compression_hints_ext_version_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @details +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. +/// - The application must **not** call this function from simultaneous +/// threads with the same parallel operation handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for Device Vector Sizes Query +#if !defined(__GNUC__) +#pragma region deviceVectorSizes +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DEVICE_VECTOR_SIZES_EXT_NAME +/// @brief Device Vector Sizes Query Extension Name +#define ZE_DEVICE_VECTOR_SIZES_EXT_NAME "ZE_extension_device_vector_sizes" +#endif // ZE_DEVICE_VECTOR_SIZES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported memory compression hints flags -typedef uint32_t ze_memory_compression_hints_ext_flags_t; -typedef enum _ze_memory_compression_hints_ext_flag_t +/// @brief Device Vector Sizes Query Extension Version(s) +typedef enum _ze_device_vector_sizes_ext_version_t { - ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_COMPRESSED = ZE_BIT(0), ///< Hint Driver implementation to make allocation compressible - ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_UNCOMPRESSED = ZE_BIT(1), ///< Hint Driver implementation to make allocation not compressible - ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_* ENUMs -} ze_memory_compression_hints_ext_flag_t; +} ze_device_vector_sizes_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Compression hints memory allocation descriptor -/// -/// @details -/// - This structure may be passed to ::zeMemAllocShared or -/// ::zeMemAllocDevice, via the `pNext` member of -/// ::ze_device_mem_alloc_desc_t. -/// - This structure may be passed to ::zeMemAllocHost, via the `pNext` -/// member of ::ze_host_mem_alloc_desc_t. -/// - This structure may be passed to ::zeImageCreate, via the `pNext` -/// member of ::ze_image_desc_t. -typedef struct _ze_memory_compression_hints_ext_desc_t +/// @brief Device Vector Width Properties queried using +/// $DeviceGetVectorWidthPropertiesExt +typedef struct _ze_device_vector_width_properties_ext_t { ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_memory_compression_hints_ext_flags_t flags; ///< [in] flags specifying if allocation should be compressible or not. - ///< Must be set to one of the ::ze_memory_compression_hints_ext_flag_t; - -} ze_memory_compression_hints_ext_desc_t; + uint32_t vector_width_size; ///< [out] The associated vector width size supported by the device. + uint32_t preferred_vector_width_char; ///< [out] The preferred vector width size for char type supported by the device. + uint32_t preferred_vector_width_short; ///< [out] The preferred vector width size for short type supported by the device. + uint32_t preferred_vector_width_int; ///< [out] The preferred vector width size for int type supported by the device. + uint32_t preferred_vector_width_long; ///< [out] The preferred vector width size for long type supported by the device. + uint32_t preferred_vector_width_float; ///< [out] The preferred vector width size for float type supported by the device. + uint32_t preferred_vector_width_double; ///< [out] The preferred vector width size for double type supported by the device. + uint32_t preferred_vector_width_half; ///< [out] The preferred vector width size for half type supported by the device. + uint32_t native_vector_width_char; ///< [out] The native vector width size for char type supported by the device. + uint32_t native_vector_width_short; ///< [out] The native vector width size for short type supported by the device. + uint32_t native_vector_width_int; ///< [out] The native vector width size for int type supported by the device. + uint32_t native_vector_width_long; ///< [out] The native vector width size for long type supported by the device. + uint32_t native_vector_width_float; ///< [out] The native vector width size for float type supported by the device. + uint32_t native_vector_width_double; ///< [out] The native vector width size for double type supported by the device. + uint32_t native_vector_width_half; ///< [out] The native vector width size for half type supported by the device. + +} ze_device_vector_width_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves the vector width properties of the device. +/// +/// @details +/// - Properties are reported for each vector width supported by the device. +/// - Multiple calls to this function will return properties in the same +/// order. +/// - The number of vector width properties is reported thru the pCount +/// parameter which is updated by the driver given pCount == 0. +/// - The application may provide a buffer that is larger than the number of +/// properties, but the application must set pCount to the number of +/// properties to retrieve. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. + ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Memory Free Policies +// Intel 'oneAPI' Level-Zero Extension APIs for Mapping External Memory as part of host llocation #if !defined(__GNUC__) -#pragma region memoryFreePolicies +#pragma region externalMemMap #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MEMORY_FREE_POLICIES_EXT_NAME -/// @brief Memory Free Policies Extension Name -#define ZE_MEMORY_FREE_POLICIES_EXT_NAME "ZE_extension_memory_free_policies" -#endif // ZE_MEMORY_FREE_POLICIES_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Memory Free Policies Extension Version(s) -typedef enum _ze_memory_free_policies_ext_version_t -{ - ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_MEMORY_FREE_POLICIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MEMORY_FREE_POLICIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_memory_free_policies_ext_version_t; +#ifndef ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME +/// @brief External Memory Mapping Extension Name +#define ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME "ZE_extension_external_memmap_sysmem" +#endif // ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Supported memory free policy capability flags -typedef uint32_t ze_driver_memory_free_policy_ext_flags_t; -typedef enum _ze_driver_memory_free_policy_ext_flag_t +/// @brief External Memory Mapping Extension Version(s) +typedef enum _ze_external_memmap_sysmem_ext_version_t { - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE = ZE_BIT(0), ///< blocks until all commands using the memory are complete before freeing - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< schedules the memory to be freed but does not free immediately - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_* ENUMs -} ze_driver_memory_free_policy_ext_flag_t; +} ze_external_memmap_sysmem_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Driver memory free properties queried using ::zeDriverGetProperties +/// @brief Maps external system memory for an allocation /// /// @details -/// - All drivers must support an immediate free policy, which is the -/// default free policy. -/// - This structure may be returned from ::zeDriverGetProperties, via the -/// `pNext` member of ::ze_driver_properties_t. -typedef struct _ze_driver_memory_free_ext_properties_t +/// - This structure may be passed to ::zeMemAllocHost, via the `pNext` +/// member of ::ze_host_mem_alloc_desc_t to map system memory for a host +/// allocation. +/// - The system memory pointer and size being mapped must be page aligned +/// based on the supported page sizes on the device. +typedef struct _ze_external_memmap_sysmem_ext_desc_t { ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_driver_memory_free_policy_ext_flags_t freePolicies; ///< [out] Supported memory free policies. - ///< must be 0 or a combination of ::ze_driver_memory_free_policy_ext_flag_t. + const void* pSystemMemory; ///< [in] system memory pointer to map; must be page-aligned. + uint64_t size; ///< [in] size of the system memory to map; must be page-aligned. -} ze_driver_memory_free_ext_properties_t; +} ze_external_memmap_sysmem_ext_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for retrieving kernel memory allocation properties. +#if !defined(__GNUC__) +#pragma region kernelAllocationProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME +/// @brief Get Kernel Allocation Properties Extension Name +#define ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME "ZE_experimental_kernel_allocation_properties" +#endif // ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory free descriptor with free policy -typedef struct _ze_memory_free_ext_desc_t +/// @brief Get Kernel Allocation Properties Extension Version(s) +typedef enum _ze_kernel_get_allocation_properties_exp_version_t +{ + ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_* ENUMs + +} ze_kernel_get_allocation_properties_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Kernel allocation properties +typedef struct _ze_kernel_allocation_exp_properties_t { ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_driver_memory_free_policy_ext_flags_t freePolicy; ///< [in] flags specifying the memory free policy. - ///< must be 0 (default) or a supported ::ze_driver_memory_free_policy_ext_flag_t; - ///< default behavior is to free immediately. + uint64_t base; ///< [out] base address of the allocation + size_t size; ///< [out] size of allocation + ze_memory_type_t type; ///< [out] type of allocation + uint32_t argIndex; ///< [out] kernel argument index for current allocation, -1 for driver + ///< internal (not kernel argument) allocations -} ze_memory_free_ext_desc_t; +} ze_kernel_allocation_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory using the -/// specified free policy. +/// @brief Retrieves kernel allocation properties. /// /// @details -/// - The memory free policy is specified by the memory free descriptor. -/// - The application must **not** call this function from simultaneous -/// threads with the same pointer. +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns array of kernel allocation properties for kernel handle. +/// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// /// @returns @@ -8383,242 +11289,278 @@ typedef struct _ze_memory_free_ext_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hContext` +/// + `nullptr == hKernel` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pMemFreeDesc` -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < pMemFreeDesc->freePolicy` +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeMemFreeExt( - ze_context_handle_t hContext, ///< [in] handle of the context object - const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor - void* ptr ///< [in][release] pointer to memory to free +zeKernelGetAllocationPropertiesExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + uint32_t* pCount, ///< [in,out] pointer to the number of kernel allocation properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of kernel allocation properties available. + ///< if count is greater than the number of kernel allocation properties + ///< available, then the driver shall update the value with the correct + ///< number of kernel allocation properties. + ze_kernel_allocation_exp_properties_t* pAllocationProperties ///< [in,out][optional][range(0, *pCount)] array of kernel allocation properties. + ///< if count is less than the number of kernel allocation properties + ///< available, then driver shall only retrieve that number of kernel + ///< allocation properties. ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Bandwidth +// Intel 'oneAPI' Level-Zero Extension APIs for Device UsableMem Size Properties Extension #if !defined(__GNUC__) -#pragma region bandwidth +#pragma region deviceusablememproperties #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_BANDWIDTH_PROPERTIES_EXP_NAME -/// @brief Bandwidth Extension Name -#define ZE_BANDWIDTH_PROPERTIES_EXP_NAME "ZE_experimental_bandwidth_properties" -#endif // ZE_BANDWIDTH_PROPERTIES_EXP_NAME +#ifndef ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME +/// @brief Device Usable Memory Size Properties Extension Name +#define ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME "ZE_extension_device_usablemem_size_properties" +#endif // ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief P2P Bandwidth Properties +/// @brief Device Usable Mem Size Extension Version(s) +typedef enum _ze_device_usablemem_size_properties_ext_version_t +{ + ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_device_usablemem_size_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Memory access property to discover current status of usable memory /// /// @details -/// - This structure may be passed to ::zeDeviceGetP2PProperties by having -/// the pNext member of ::ze_device_p2p_properties_t point at this struct. -typedef struct _ze_device_p2p_bandwidth_exp_properties_t +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t +typedef struct _ze_device_usablemem_size_ext_properties_t { ze_structure_type_t stype; ///< [in] type of this structure void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t logicalBandwidth; ///< [out] total logical design bandwidth for all links connecting the two - ///< devices - uint32_t physicalBandwidth; ///< [out] total physical design bandwidth for all links connecting the two - ///< devices - ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit - uint32_t logicalLatency; ///< [out] average logical design latency for all links connecting the two - ///< devices - uint32_t physicalLatency; ///< [out] average physical design latency for all links connecting the two - ///< devices - ze_latency_unit_t latencyUnit; ///< [out] latency unit + uint64_t currUsableMemSize; ///< [out] Returns the available usable memory at the device level. This is + ///< typically less than or equal to the available physical memory on the + ///< device. It important to note that usable memory size reported is + ///< transient in nature and cannot be used to reliably guarentee success + ///< of future allocations. The usable memory includes all the memory that + ///< the clients can allocate for their use and by L0 Core for its internal + ///< allocations. -} ze_device_p2p_bandwidth_exp_properties_t; +} ze_device_usablemem_size_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Image Format Support +#if !defined(__GNUC__) +#pragma region imageFormatSupport +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME +/// @brief Image Format Support Extension Name +#define ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME "ZE_extension_image_format_support" +#endif // ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Copy Bandwidth Properties +/// @brief Image Format Support Extension Version(s) +typedef enum _ze_image_format_support_ext_version_t +{ + ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_* ENUMs + +} ze_image_format_support_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image format support query properties /// /// @details -/// - This structure may be passed to -/// ::zeDeviceGetCommandQueueGroupProperties by having the pNext member of -/// ::ze_command_queue_group_properties_t point at this struct. -typedef struct _ze_copy_bandwidth_exp_properties_t +/// - This structure may be passed to ::zeImageGetProperties via the pNext +/// member of ::ze_image_properties_t. +/// - The implementation shall populate the supported field based on the +/// ::ze_image_desc_t and ::ze_device_handle_t passed to +/// ::zeImageGetProperties. +/// - This provides a mechanism to query format support without requiring +/// image creation. +typedef struct _ze_image_format_support_ext_properties_t { ze_structure_type_t stype; ///< [in] type of this structure void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t copyBandwidth; ///< [out] design bandwidth supported by this engine type for copy - ///< operations - ze_bandwidth_unit_t copyBandwidthUnit; ///< [out] copy bandwidth unit + ze_bool_t supported; ///< [out] boolean flag indicating whether the image format is supported on + ///< the queried device -} ze_copy_bandwidth_exp_properties_t; +} ze_image_format_support_ext_properties_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Device Local Identifier (LUID) +// Intel 'oneAPI' Level-Zero Extension for setting the IPC memory handle type requested at memory allocation time. #if !defined(__GNUC__) -#pragma region deviceLUID +#pragma region ipcMemHandleType #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_LUID_EXT_NAME -/// @brief Device Local Identifier (LUID) Extension Name -#define ZE_DEVICE_LUID_EXT_NAME "ZE_extension_device_luid" -#endif // ZE_DEVICE_LUID_EXT_NAME +#ifndef ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME +/// @brief IPC Memory Handle Type Extension Name +#define ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME "ZE_extension_ipc_mem_handle_type" +#endif // ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Device Local Identifier (LUID) Extension Version(s) -typedef enum _ze_device_luid_ext_version_t +/// @brief IPC Memory Handle Type Extension Version(s) +typedef enum _ze_ipc_mem_handle_type_ext_version_t { - ZE_DEVICE_LUID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_LUID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_device_luid_ext_version_t; + ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MAX_DEVICE_LUID_SIZE_EXT -/// @brief Maximum device local identifier (LUID) size in bytes -#define ZE_MAX_DEVICE_LUID_SIZE_EXT 8 -#endif // ZE_MAX_DEVICE_LUID_SIZE_EXT +} ze_ipc_mem_handle_type_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device local identifier (LUID) -typedef struct _ze_device_luid_ext_t +/// @brief Supported IPC memory handle type flags +typedef uint32_t ze_ipc_mem_handle_type_flags_t; +typedef enum _ze_ipc_mem_handle_type_flag_t { - uint8_t id[ZE_MAX_DEVICE_LUID_SIZE_EXT]; ///< [out] opaque data representing a device LUID + ZE_IPC_MEM_HANDLE_TYPE_FLAG_DEFAULT = ZE_BIT(0), ///< Local IPC memory handle type for use within the same machine. + ZE_IPC_MEM_HANDLE_TYPE_FLAG_FABRIC_ACCESSIBLE = ZE_BIT(1), ///< Fabric accessible IPC memory handle type for use across machines via a + ///< supported fabric. + ZE_IPC_MEM_HANDLE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_MEM_HANDLE_TYPE_FLAG_* ENUMs -} ze_device_luid_ext_t; +} ze_ipc_mem_handle_type_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device LUID properties queried using ::zeDeviceGetProperties -/// -/// @details -/// - This structure may be returned from ::zeDeviceGetProperties, via the -/// `pNext` member of ::ze_device_properties_t. -typedef struct _ze_device_luid_ext_properties_t +/// @brief ['IPC Memory Handle Type Extension Descriptor', 'Used in +/// ::zeMemGetIpcHandleWithProperties, ::zeMemAllocDevice, and +/// ::zeMemAllocHost, ::zePhysicalMemCreate to specify the IPC memory +/// handle type to create for this allocation.'] +typedef struct _ze_ipc_mem_handle_type_ext_desc_t { ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_device_luid_ext_t luid; ///< [out] locally unique identifier (LUID). - ///< The returned LUID can be cast to a LUID object and must be equal to - ///< the locally - ///< unique identifier of an IDXGIAdapter1 object that corresponds to the device. - uint32_t nodeMask; ///< [out] node mask. - ///< The returned node mask must contain exactly one bit. - ///< If the device is running on an operating system that supports the - ///< Direct3D 12 API - ///< and the device corresponds to an individual device in a linked device - ///< adapter, the - ///< returned node mask identifies the Direct3D 12 node corresponding to - ///< the device. - ///< Otherwise, the returned node mask must be 1. + ze_ipc_mem_handle_type_flags_t typeFlags; ///< [in] valid combination of ::ze_ipc_mem_handle_type_flag_t -} ze_device_luid_ext_properties_t; +} ze_ipc_mem_handle_type_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates an IPC memory handle for the specified allocation with +/// properties for the requested handle. +/// +/// @details +/// - Takes a pointer to a device or host memory allocation and creates an +/// IPC memory handle for exporting it for use in another process. +/// - The pointer must be the base pointer of a device or host memory +/// allocation; i.e. the value returned from ::zeMemAllocDevice or from +/// ::zeMemAllocHost, respectively or allocated from +/// ::zePhysicalMemCreate. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// + `nullptr == pIpcHandle` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeMemGetIpcHandleWithProperties( + ze_context_handle_t hContext, ///< [in] handle of the context object + const void* ptr, ///< [in] pointer to the device memory allocation + void* pNext, ///< [in][optional] Pointer to extension-specific structure. + ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle + ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Fabric Topology Discovery +// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation #if !defined(__GNUC__) -#pragma region fabric +#pragma region cacheReservation #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_FABRIC_EXP_NAME -/// @brief Fabric Topology Discovery Extension Name -#define ZE_FABRIC_EXP_NAME "ZE_experimental_fabric" -#endif // ZE_FABRIC_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE -/// @brief Maximum fabric edge model string size -#define ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE 256 -#endif // ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE +#ifndef ZE_CACHE_RESERVATION_EXT_NAME +/// @brief Cache_Reservation Extension Name +#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" +#endif // ZE_CACHE_RESERVATION_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric Vertex types -typedef enum _ze_fabric_vertex_exp_type_t +/// @brief Cache_Reservation Extension Version(s) +typedef enum _ze_cache_reservation_ext_version_t { - ZE_FABRIC_VERTEX_EXP_TYPE_UNKNOWN = 0, ///< Fabric vertex type is unknown - ZE_FABRIC_VERTEX_EXP_TYPE_DEVICE = 1, ///< Fabric vertex represents a device - ZE_FABRIC_VERTEX_EXP_TYPE_SUBDEVICE = 2, ///< Fabric vertex represents a subdevice - ZE_FABRIC_VERTEX_EXP_TYPE_SWITCH = 3, ///< Fabric vertex represents a switch - ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_RESERVATION_EXT_VERSION_* ENUMs -} ze_fabric_vertex_exp_type_t; +} ze_cache_reservation_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric edge duplexity -typedef enum _ze_fabric_edge_exp_duplexity_t +/// @brief Cache Reservation Region +typedef enum _ze_cache_ext_region_t { - ZE_FABRIC_EDGE_EXP_DUPLEXITY_UNKNOWN = 0, ///< Fabric edge duplexity is unknown - ZE_FABRIC_EDGE_EXP_DUPLEXITY_HALF_DUPLEX = 1, ///< Fabric edge is half duplex, i.e. stated bandwidth is obtained in only - ///< one direction at time - ZE_FABRIC_EDGE_EXP_DUPLEXITY_FULL_DUPLEX = 2, ///< Fabric edge is full duplex, i.e. stated bandwidth is supported in both - ///< directions simultaneously - ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff + ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use + ///< ::ZE_CACHE_EXT_REGION_DEFAULT. + ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use + ///< ::ZE_CACHE_EXT_REGION_RESERVED. + ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use + ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. + ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme + ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region + ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region + ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_CACHE_EXT_REGION_* ENUMs -} ze_fabric_edge_exp_duplexity_t; +} ze_cache_ext_region_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief PCI address +/// @brief CacheReservation structure /// /// @details -/// - A PCI BDF address is the bus:device:function address of the device and -/// is useful for locating the device in the PCI switch fabric. -typedef struct _ze_fabric_vertex_pci_exp_address_t -{ - uint32_t domain; ///< [out] PCI domain number - uint32_t bus; ///< [out] PCI BDF bus number - uint32_t device; ///< [out] PCI BDF device number - uint32_t function; ///< [out] PCI BDF function number - -} ze_fabric_vertex_pci_exp_address_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric Vertex properties -typedef struct _ze_fabric_vertex_exp_properties_t -{ - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_uuid_t uuid; ///< [out] universal unique identifier. If the vertex is co-located with a - ///< device/subdevice, then this uuid will match that of the corresponding - ///< device/subdevice - ze_fabric_vertex_exp_type_t type; ///< [out] does the fabric vertex represent a device, subdevice, or switch? - ze_bool_t remote; ///< [out] does the fabric vertex live on the local node or on a remote - ///< node? - ze_fabric_vertex_pci_exp_address_t address; ///< [out] B/D/F address of fabric vertex & associated device/subdevice if - ///< available - -} ze_fabric_vertex_exp_properties_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Fabric Edge properties -typedef struct _ze_fabric_edge_exp_properties_t +/// - This structure must be passed to ::zeDeviceGetCacheProperties via the +/// `pNext` member of ::ze_device_cache_properties_t +/// - Used for determining the max cache reservation allowed on device. Size +/// of zero means no reservation available. +typedef struct _ze_cache_reservation_ext_desc_t { ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_uuid_t uuid; ///< [out] universal unique identifier. - char model[ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE]; ///< [out] Description of fabric edge technology. Will be set to the string - ///< "unkown" if this cannot be determined for this edge - uint32_t bandwidth; ///< [out] design bandwidth - ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit - uint32_t latency; ///< [out] design latency - ze_latency_unit_t latencyUnit; ///< [out] latency unit - ze_fabric_edge_exp_duplexity_t duplexity; ///< [out] Duplexity of the fabric edge + size_t maxCacheReservationSize; ///< [out] max cache reservation size -} ze_fabric_edge_exp_properties_t; +} ze_cache_reservation_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves fabric vertices within a driver +/// @brief Reserve Cache on Device /// /// @details -/// - A fabric vertex represents either a device or a switch connected to -/// other fabric vertices. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The application may call this function but may not be successful as +/// some other application may have reserve prior +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8626,34 +11568,32 @@ typedef struct _ze_fabric_edge_exp_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == hDevice` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetExp( - ze_driver_handle_t hDriver, ///< [in] handle of the driver instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric vertices available. - ///< if count is greater than the number of fabric vertices available, then - ///< the driver shall update the value with the correct number of fabric - ///< vertices available. - ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. - ///< if count is less than the number of fabric vertices available, then - ///< driver shall only retrieve that number of fabric vertices. +zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves a fabric sub-vertex from a fabric vertex +/// @brief Assign VA section to use reserved section /// /// @details -/// - Multiple calls to this function will return identical fabric vertex -/// handles, in the same order. -/// - The number of handles returned from this function is affected by the -/// ::ZE_AFFINITY_MASK environment variable. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The application may call this function to assign VA to particular +/// reservartion region /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8661,30 +11601,70 @@ zeFabricVertexGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetSubVerticesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object - uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-vertices available. - ///< if count is greater than the number of sub-vertices available, then - ///< the driver shall update the value with the correct number of - ///< sub-vertices available. - ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. - ///< if count is less than the number of sub-vertices available, then - ///< driver shall only retrieve that number of sub-vertices. +zeDeviceSetCacheAdviceExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + void* ptr, ///< [in] memory pointer to query + size_t regionSize, ///< [in] region size, in pages + ze_cache_ext_region_t cacheRegion ///< [in] reservation region ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. +#if !defined(__GNUC__) +#pragma region eventquerytimestamps +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves properties of the fabric vertex. +#ifndef ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +/// @brief Event Query Timestamps Extension Name +#define ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME "ZE_experimental_event_query_timestamps" +#endif // ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event Query Timestamps Extension Version(s) +typedef enum _ze_event_query_timestamps_exp_version_t +{ + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_* ENUMs + +} ze_event_query_timestamps_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query event timestamps for a device or sub-device. /// /// @details /// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME +/// extension. +/// - The implementation must return all timestamps for the specified event +/// and device pair. +/// - The implementation must return all timestamps for all sub-devices when +/// device handle is parent device. +/// - The implementation may return all timestamps for sub-devices when +/// device handle is sub-device or may return 0 for count. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8692,22 +11672,81 @@ zeFabricVertexGetSubVerticesExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` +/// + `nullptr == hEvent` +/// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pVertexProperties` +/// + `nullptr == pCount` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetPropertiesExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_fabric_vertex_exp_properties_t* pVertexProperties ///< [in,out] query result for fabric vertex properties +zeEventQueryTimestampsExp( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. + ///< if count is zero, then the driver shall update the value with the + ///< total number of timestamps available. + ///< if count is greater than the number of timestamps available, then the + ///< driver shall update the value with the correct number of timestamps available. + ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. + ///< if count is less than the number of timestamps available, then driver + ///< shall only retrieve that number of timestamps. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting image memory properties. +#if !defined(__GNUC__) +#pragma region imagememoryproperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME +/// @brief Image Memory Properties Extension Name +#define ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME "ZE_experimental_image_memory_properties" +#endif // ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns device handle from fabric vertex handle. +/// @brief Image Memory Properties Extension Version(s) +typedef enum _ze_image_memory_properties_exp_version_t +{ + ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_* ENUMs + +} ze_image_memory_properties_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image memory properties +typedef struct _ze_image_memory_properties_exp_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t size; ///< [out] size of image allocation in bytes. + uint64_t rowPitch; ///< [out] size of image row in bytes. + uint64_t slicePitch; ///< [out] size of image slice in bytes. + +} ze_image_memory_properties_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query image memory properties. /// /// @details /// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME +/// extension. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8715,26 +11754,66 @@ zeFabricVertexGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertex` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phDevice` -/// - ::ZE_RESULT_EXP_ERROR_VERTEX_IS_NOT_DEVICE -/// + Provided fabric vertex handle does not correspond to a device or subdevice. -/// - ::ZE_RESULT_EXP_ERROR_REMOTE_DEVICE -/// + Provided fabric vertex handle corresponds to remote device or subdevice. +/// + `nullptr == pMemoryProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricVertexGetDeviceExp( - ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex - ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex +zeImageGetMemoryPropertiesExp( + ze_image_handle_t hImage, ///< [in] handle of image object + ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting image views. +#if !defined(__GNUC__) +#pragma region imageview +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMAGE_VIEW_EXT_NAME +/// @brief Image View Extension Name +#define ZE_IMAGE_VIEW_EXT_NAME "ZE_extension_image_view" +#endif // ZE_IMAGE_VIEW_EXT_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Returns fabric vertex handle from device handle. +/// @brief Image View Extension Version(s) +typedef enum _ze_image_view_ext_version_t +{ + ZE_IMAGE_VIEW_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_EXT_VERSION_* ENUMs + +} ze_image_view_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create image view on the context. /// /// @details +/// - The application must only use the image view for the device, or its +/// sub-devices, which was provided during creation. /// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_IMAGE_VIEW_EXT_NAME extension. +/// - Image views are treated as images from the API. +/// - Image views provide a mechanism to redescribe how an image is +/// interpreted (e.g. different format). +/// - Image views become disabled when their corresponding image resource is +/// destroyed. +/// - Use ::zeImageDestroy to destroy image view objects. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8742,61 +11821,72 @@ zeFabricVertexGetDeviceExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` /// + `nullptr == hDevice` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phVertex` -/// - ::ZE_RESULT_EXP_ERROR_DEVICE_IS_NOT_VERTEX -/// + Provided device handle does not correspond to a fabric vertex. +/// + `nullptr == desc` +/// + `nullptr == phImageView` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceGetFabricVertexExp( +zeImageViewCreateExt( + ze_context_handle_t hContext, ///< [in] handle of the context object ze_device_handle_t hDevice, ///< [in] handle of the device - ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves all fabric edges between provided pair of fabric vertices -/// -/// @details -/// - A fabric edge represents one or more physical links between two fabric -/// vertices. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST -/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY -/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hVertexA` -/// + `nullptr == hVertexB` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricEdgeGetExp( - ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance - ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance - uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. - ///< if count is zero, then the driver shall update the value with the - ///< total number of fabric edges available. - ///< if count is greater than the number of fabric edges available, then - ///< the driver shall update the value with the correct number of fabric - ///< edges available. - ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. - ///< if count is less than the number of fabric edges available, then - ///< driver shall only retrieve that number of fabric edges. - ); +#ifndef ZE_IMAGE_VIEW_EXP_NAME +/// @brief Image View Extension Name +#define ZE_IMAGE_VIEW_EXP_NAME "ZE_experimental_image_view" +#endif // ZE_IMAGE_VIEW_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves fabric vertices connected by a fabric edge +/// @brief Image View Extension Version(s) +typedef enum _ze_image_view_exp_version_t +{ + ZE_IMAGE_VIEW_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_EXP_VERSION_* ENUMs + +} ze_image_view_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create image view on the context. /// /// @details -/// - A fabric vertex represents either a device or a switch connected to -/// other fabric vertices via a fabric edge. +/// - The application must only use the image view for the device, or its +/// sub-devices, which was provided during creation. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_IMAGE_VIEW_EXP_NAME extension. +/// - Image views are treated as images from the API. +/// - Image views provide a mechanism to redescribe how an image is +/// interpreted (e.g. different format). +/// - Image views become disabled when their corresponding image resource is +/// destroyed. +/// - Use ::zeImageDestroy to destroy image view objects. +/// - Note: This function is deprecated and replaced by +/// ::zeImageViewCreateExt. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -8804,384 +11894,413 @@ zeFabricEdgeGetExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEdge` +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phVertexA` -/// + `nullptr == phVertexB` +/// + `nullptr == desc` +/// + `nullptr == phImageView` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < desc->flags` +/// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricEdgeGetVerticesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance - ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. - ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. +zeImageViewCreateExp( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + const ze_image_desc_t* desc, ///< [in] pointer to image descriptor + ze_image_handle_t hImage, ///< [in] handle of image object to create view from + ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting image views for planar images. +#if !defined(__GNUC__) +#pragma region imageviewplanar +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves properties of the fabric edge. -/// -/// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// -/// @returns -/// - ::ZE_RESULT_SUCCESS -/// - ::ZE_RESULT_ERROR_UNINITIALIZED -/// - ::ZE_RESULT_ERROR_DEVICE_LOST -/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY -/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEdge` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pEdgeProperties` -ZE_APIEXPORT ze_result_t ZE_APICALL -zeFabricEdgeGetPropertiesExp( - ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge - ze_fabric_edge_exp_properties_t* pEdgeProperties ///< [in,out] query result for fabric edge properties - ); +#ifndef ZE_IMAGE_VIEW_PLANAR_EXT_NAME +/// @brief Image View Planar Extension Name +#define ZE_IMAGE_VIEW_PLANAR_EXT_NAME "ZE_extension_image_view_planar" +#endif // ZE_IMAGE_VIEW_PLANAR_EXT_NAME -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Device Memory Properties -#if !defined(__GNUC__) -#pragma region memoryProperties -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME -/// @brief Device Memory Properties Extension Name -#define ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME "ZE_extension_device_memory_properties" -#endif // ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME +/// @brief Image View Planar Extension Version(s) +typedef enum _ze_image_view_planar_ext_version_t +{ + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_* ENUMs + +} ze_image_view_planar_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device Memory Properties Extension Version(s) -typedef enum _ze_device_memory_properties_ext_version_t +/// @brief Image view planar descriptor +typedef struct _ze_image_view_planar_ext_desc_t { - ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) -} ze_device_memory_properties_ext_version_t; +} ze_image_view_planar_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory module types -typedef enum _ze_device_memory_ext_type_t +#ifndef ZE_IMAGE_VIEW_PLANAR_EXP_NAME +/// @brief Image View Planar Extension Name +#define ZE_IMAGE_VIEW_PLANAR_EXP_NAME "ZE_experimental_image_view_planar" +#endif // ZE_IMAGE_VIEW_PLANAR_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Image View Planar Extension Version(s) +typedef enum _ze_image_view_planar_exp_version_t { - ZE_DEVICE_MEMORY_EXT_TYPE_HBM = 0, ///< HBM memory - ZE_DEVICE_MEMORY_EXT_TYPE_HBM2 = 1, ///< HBM2 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR = 2, ///< DDR memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR2 = 3, ///< DDR2 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR3 = 4, ///< DDR3 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR4 = 5, ///< DDR4 memory - ZE_DEVICE_MEMORY_EXT_TYPE_DDR5 = 6, ///< DDR5 memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR = 7, ///< LPDDR memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR3 = 8, ///< LPDDR3 memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR4 = 9, ///< LPDDR4 memory - ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR5 = 10, ///< LPDDR5 memory - ZE_DEVICE_MEMORY_EXT_TYPE_SRAM = 11, ///< SRAM memory - ZE_DEVICE_MEMORY_EXT_TYPE_L1 = 12, ///< L1 cache - ZE_DEVICE_MEMORY_EXT_TYPE_L3 = 13, ///< L3 cache - ZE_DEVICE_MEMORY_EXT_TYPE_GRF = 14, ///< Execution unit register file - ZE_DEVICE_MEMORY_EXT_TYPE_SLM = 15, ///< Execution unit shared local memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR4 = 16, ///< GDDR4 memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5 = 17, ///< GDDR5 memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5X = 18, ///< GDDR5X memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6 = 19, ///< GDDR6 memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6X = 20, ///< GDDR6X memory - ZE_DEVICE_MEMORY_EXT_TYPE_GDDR7 = 21, ///< GDDR7 memory - ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_* ENUMs -} ze_device_memory_ext_type_t; +} ze_image_view_planar_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory properties -/// -/// @details -/// - This structure may be returned from ::zeDeviceGetMemoryProperties via -/// the `pNext` member of ::ze_device_memory_properties_t -typedef struct _ze_device_memory_ext_properties_t +/// @brief Image view planar descriptor +typedef struct _ze_image_view_planar_exp_desc_t { ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_device_memory_ext_type_t type; ///< [out] The memory type - uint64_t physicalSize; ///< [out] Physical memory size in bytes. A value of 0 indicates that this - ///< property is not known. However, a call to $sMemoryGetState() will - ///< correctly return the total size of usable memory. - uint32_t readBandwidth; ///< [out] Design bandwidth for reads - uint32_t writeBandwidth; ///< [out] Design bandwidth for writes - ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit + uint32_t planeIndex; ///< [DEPRECATED] no longer supported, use + ///< ::ze_image_view_planar_ext_desc_t instead -} ze_device_memory_ext_properties_t; +} ze_image_view_planar_exp_desc_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Bfloat16 Conversions +// Intel 'oneAPI' Level-Zero Extension for specifying kernel scheduling hints. #if !defined(__GNUC__) -#pragma region bfloat16conversions +#pragma region kernelSchedulingHints #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_BFLOAT16_CONVERSIONS_EXT_NAME -/// @brief Bfloat16 Conversions Extension Name -#define ZE_BFLOAT16_CONVERSIONS_EXT_NAME "ZE_extension_bfloat16_conversions" -#endif // ZE_BFLOAT16_CONVERSIONS_EXT_NAME +#ifndef ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME +/// @brief Kernel Scheduling Hints Extension Name +#define ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME "ZE_experimental_scheduling_hints" +#endif // ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Bfloat16 Conversions Extension Version(s) -typedef enum _ze_bfloat16_conversions_ext_version_t +/// @brief Kernel Scheduling Hints Extension Version(s) +typedef enum _ze_scheduling_hints_exp_version_t { - ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SCHEDULING_HINTS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SCHEDULING_HINTS_EXP_VERSION_* ENUMs -} ze_bfloat16_conversions_ext_version_t; +} ze_scheduling_hints_exp_version_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension APIs for Device IP Version -#if !defined(__GNUC__) -#pragma region deviceipversion -#endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_DEVICE_IP_VERSION_EXT_NAME -/// @brief Device IP Version Extension Name -#define ZE_DEVICE_IP_VERSION_EXT_NAME "ZE_extension_device_ip_version" -#endif // ZE_DEVICE_IP_VERSION_EXT_NAME +/// @brief Supported kernel scheduling hint flags +typedef uint32_t ze_scheduling_hint_exp_flags_t; +typedef enum _ze_scheduling_hint_exp_flag_t +{ + ZE_SCHEDULING_HINT_EXP_FLAG_OLDEST_FIRST = ZE_BIT(0), ///< Hint that the kernel prefers oldest-first scheduling + ZE_SCHEDULING_HINT_EXP_FLAG_ROUND_ROBIN = ZE_BIT(1), ///< Hint that the kernel prefers round-robin scheduling + ZE_SCHEDULING_HINT_EXP_FLAG_STALL_BASED_ROUND_ROBIN = ZE_BIT(2), ///< Hint that the kernel prefers stall-based round-robin scheduling + ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SCHEDULING_HINT_EXP_FLAG_* ENUMs + +} ze_scheduling_hint_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device IP Version Extension Version(s) -typedef enum _ze_device_ip_version_version_t +/// @brief Device kernel scheduling hint properties queried using +/// ::zeDeviceGetModuleProperties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetModuleProperties, via +/// the `pNext` member of ::ze_device_module_properties_t. +typedef struct _ze_scheduling_hint_exp_properties_t { - ZE_DEVICE_IP_VERSION_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_DEVICE_IP_VERSION_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_scheduling_hint_exp_flags_t schedulingHintFlags; ///< [out] Supported kernel scheduling hints. + ///< May be 0 (none) or a valid combination of ::ze_scheduling_hint_exp_flag_t. -} ze_device_ip_version_version_t; +} ze_scheduling_hint_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Device IP version queried using ::zeDeviceGetProperties +/// @brief Kernel scheduling hint descriptor /// /// @details -/// - This structure may be returned from ::zeDeviceGetProperties via the -/// `pNext` member of ::ze_device_properties_t -typedef struct _ze_device_ip_version_ext_t +/// - This structure may be passed to ::zeKernelSchedulingHintExp. +typedef struct _ze_scheduling_hint_exp_desc_t { ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t ipVersion; ///< [out] Device IP version. The meaning of the device IP version is - ///< implementation-defined, but newer devices should have a higher - ///< version than older devices. + ze_scheduling_hint_exp_flags_t flags; ///< [in] flags specifying kernel scheduling hints. + ///< must be 0 (default) or a valid combination of ::ze_scheduling_hint_exp_flag_t. -} ze_device_ip_version_ext_t; +} ze_scheduling_hint_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Provide kernel scheduling hints that may improve performance +/// +/// @details +/// - The scheduling hints may improve performance only and are not required +/// for correctness. +/// - If a specified scheduling hint is unsupported it will be silently +/// ignored. +/// - If two conflicting scheduling hints are specified there is no defined behavior; +/// the hints may be ignored or one hint may be chosen arbitrarily. +/// - The application must not call this function from simultaneous threads +/// with the same kernel handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pHint` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < pHint->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeKernelSchedulingHintExp( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object + ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor + ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for querying kernel max group size properties. +// Intel 'oneAPI' Level-Zero Extension APIs for One-Definition-Rule Linkage Types #if !defined(__GNUC__) -#pragma region kernelMaxGroupSizeProperties +#pragma region linkonceodr #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME -/// @brief Kernel Max Group Size Properties Extension Name -#define ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME "ZE_extension_kernel_max_group_size_properties" -#endif // ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel Max Group Size Properties Extension Version(s) -typedef enum _ze_kernel_max_group_size_properties_ext_version_t -{ - ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff - -} ze_kernel_max_group_size_properties_ext_version_t; +#ifndef ZE_LINKONCE_ODR_EXT_NAME +/// @brief Linkonce ODR Extension Name +#define ZE_LINKONCE_ODR_EXT_NAME "ZE_extension_linkonce_odr" +#endif // ZE_LINKONCE_ODR_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Additional kernel max group size properties -/// -/// @details -/// - This structure may be passed to ::zeKernelGetProperties, via the -/// `pNext` member of ::ze_kernel_properties_t, to query additional kernel -/// max group size properties. -typedef struct _ze_kernel_max_group_size_properties_ext_t +/// @brief Linkonce ODR Extension Version(s) +typedef enum _ze_linkonce_odr_ext_version_t { - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint32_t maxGroupSize; ///< [out] maximum group size that can be used to execute the kernel. This - ///< value may be less than or equal to the `maxTotalGroupSize` member of - ///< ::ze_device_compute_properties_t. - -} ze_kernel_max_group_size_properties_ext_t; + ZE_LINKONCE_ODR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_LINKONCE_ODR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKONCE_ODR_EXT_VERSION_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -/// @brief compiler-independent type -typedef ze_kernel_max_group_size_properties_ext_t ze_kernel_max_group_size_ext_properties_t; +} ze_linkonce_odr_ext_version_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for querying sub-allocations properties. +// Intel 'oneAPI' Level-Zero Extension for supporting power saving hint. #if !defined(__GNUC__) -#pragma region subAllocationsProperties +#pragma region powersavinghint #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_SUB_ALLOCATIONS_EXP_NAME -/// @brief Sub-Allocations Properties Extension Name -#define ZE_SUB_ALLOCATIONS_EXP_NAME "ZE_experimental_sub_allocations" -#endif // ZE_SUB_ALLOCATIONS_EXP_NAME +#ifndef ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME +/// @brief Power Saving Hint Extension Name +#define ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME "ZE_experimental_power_saving_hint" +#endif // ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Sub-Allocations Properties Extension Version(s) -typedef enum _ze_sub_allocations_exp_version_t +/// @brief Power Saving Hint Extension Version(s) +typedef enum _ze_power_saving_hint_exp_version_t { - ZE_SUB_ALLOCATIONS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_SUB_ALLOCATIONS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_EXP_VERSION_* ENUMs -} ze_sub_allocations_exp_version_t; +} ze_power_saving_hint_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Properties returned for a sub-allocation -typedef struct _ze_sub_allocation_t +/// @brief Supported device types +typedef enum _ze_power_saving_hint_type_t { - void* base; ///< [in,out][optional] base address of the sub-allocation - size_t size; ///< [in,out][optional] size of the allocation + ZE_POWER_SAVING_HINT_TYPE_MIN = 0, ///< Minumum power savings. The device will make no attempt to save power + ///< while executing work submitted to this context. + ZE_POWER_SAVING_HINT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to + ///< a minimum while executing work submitted to this context. + ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_TYPE_* ENUMs -} ze_sub_allocation_t; +} ze_power_saving_hint_type_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Sub-Allocations Properties -/// -/// @details -/// - This structure may be passed to ::zeMemGetAllocProperties, via the -/// `pNext` member of ::ze_memory_allocation_properties_t. -typedef struct _ze_memory_sub_allocations_exp_properties_t +/// @brief Extended context descriptor containing power saving hint. +typedef struct _ze_context_power_saving_hint_exp_desc_t { ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t* pCount; ///< [in,out] pointer to the number of sub-allocations. - ///< if count is zero, then the driver shall update the value with the - ///< total number of sub-allocations on which the allocation has been divided. - ///< if count is greater than the number of sub-allocations, then the - ///< driver shall update the value with the correct number of sub-allocations. - ze_sub_allocation_t* pSubAllocations; ///< [in,out][optional][range(0, *pCount)] array of properties for sub-allocations. - ///< if count is less than the number of sub-allocations available, then - ///< driver shall only retrieve properties for that number of sub-allocations. + uint32_t hint; ///< [in] power saving hint (default value = 0). This is value from [0,100] + ///< and can use pre-defined settings from ::ze_power_saving_hint_type_t. -} ze_memory_sub_allocations_exp_properties_t; +} ze_context_power_saving_hint_exp_desc_t; #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for supporting the querying of synchronized event timestamps. +// Intel 'oneAPI' Level-Zero Extension APIs for Subgroups #if !defined(__GNUC__) -#pragma region eventQueryKernelTimestamps +#pragma region subgroups #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME -/// @brief Event Query Kernel Timestamps Extension Name -#define ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME "ZE_extension_event_query_kernel_timestamps" -#endif // ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME +#ifndef ZE_SUBGROUPS_EXT_NAME +/// @brief Subgroups Extension Name +#define ZE_SUBGROUPS_EXT_NAME "ZE_extension_subgroups" +#endif // ZE_SUBGROUPS_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Event Query Kernel Timestamps Extension Version(s) -typedef enum _ze_event_query_kernel_timestamps_ext_version_t +/// @brief Subgroups Extension Version(s) +typedef enum _ze_subgroup_ext_version_t { - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_SUBGROUP_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SUBGROUP_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SUBGROUP_EXT_VERSION_* ENUMs -} ze_event_query_kernel_timestamps_ext_version_t; +} ze_subgroup_ext_version_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for EU Count +#if !defined(__GNUC__) +#pragma region EUCount +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EU_COUNT_EXT_NAME +/// @brief EU Count Extension Name +#define ZE_EU_COUNT_EXT_NAME "ZE_extension_eu_count" +#endif // ZE_EU_COUNT_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Event query kernel timestamps flags -typedef uint32_t ze_event_query_kernel_timestamps_ext_flags_t; -typedef enum _ze_event_query_kernel_timestamps_ext_flag_t +/// @brief EU Count Extension Version(s) +typedef enum _ze_eu_count_ext_version_t { - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_KERNEL = ZE_BIT(0), ///< Kernel timestamp results - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_SYNCHRONIZED = ZE_BIT(1), ///< Device event timestamps synchronized to the host time domain - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EU_COUNT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EU_COUNT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EU_COUNT_EXT_VERSION_* ENUMs -} ze_event_query_kernel_timestamps_ext_flag_t; +} ze_eu_count_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Event query kernel timestamps properties +/// @brief EU count queried using ::zeDeviceGetProperties /// /// @details -/// - This structure may be returned from ::zeDeviceGetProperties, via the +/// - This structure may be returned from ::zeDeviceGetProperties via the /// `pNext` member of ::ze_device_properties_t. -typedef struct _ze_event_query_kernel_timestamps_ext_properties_t +/// - Used for determining the total number of EUs available on device. +typedef struct _ze_eu_count_ext_t { ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_event_query_kernel_timestamps_ext_flags_t flags; ///< [out] 0 or some combination of - ///< ::ze_event_query_kernel_timestamps_ext_flag_t flags + uint32_t numTotalEUs; ///< [out] Total number of EUs available -} ze_event_query_kernel_timestamps_ext_properties_t; +} ze_eu_count_ext_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for PCI Properties +#if !defined(__GNUC__) +#pragma region PCIProperties +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Kernel timestamp clock data synchronized to the host time domain -typedef struct _ze_synchronized_timestamp_data_ext_t +#ifndef ZE_PCI_PROPERTIES_EXT_NAME +/// @brief PCI Properties Extension Name +#define ZE_PCI_PROPERTIES_EXT_NAME "ZE_extension_pci_properties" +#endif // ZE_PCI_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief PCI Properties Extension Version(s) +typedef enum _ze_pci_properties_ext_version_t { - uint64_t kernelStart; ///< [out] synchronized clock at start of kernel execution - uint64_t kernelEnd; ///< [out] synchronized clock at end of kernel execution + ZE_PCI_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_PCI_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_PCI_PROPERTIES_EXT_VERSION_* ENUMs -} ze_synchronized_timestamp_data_ext_t; +} ze_pci_properties_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Synchronized kernel timestamp result -typedef struct _ze_synchronized_timestamp_result_ext_t +/// @brief Device PCI address +/// +/// @details +/// - This structure may be passed to ::zeDevicePciGetPropertiesExt as an +/// attribute of ::ze_pci_ext_properties_t. +/// - A PCI BDF address is the bus:device:function address of the device and +/// is useful for locating the device in the PCI switch fabric. +typedef struct _ze_pci_address_ext_t { - ze_synchronized_timestamp_data_ext_t global; ///< [out] wall-clock data - ze_synchronized_timestamp_data_ext_t context; ///< [out] context-active data; only includes clocks while device context - ///< was actively executing. + uint32_t domain; ///< [out] PCI domain number + uint32_t bus; ///< [out] PCI BDF bus number + uint32_t device; ///< [out] PCI BDF device number + uint32_t function; ///< [out] PCI BDF function number -} ze_synchronized_timestamp_result_ext_t; +} ze_pci_address_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Event query kernel timestamps results properties -typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_t +/// @brief Device PCI speed +typedef struct _ze_pci_speed_ext_t +{ + int32_t genVersion; ///< [out] The link generation. A value of -1 means that this property is + ///< unknown. + int32_t width; ///< [out] The number of lanes. A value of -1 means that this property is + ///< unknown. + int64_t maxBandwidth; ///< [out] The theoretical maximum bandwidth in bytes/sec (sum of all + ///< lanes). A value of -1 means that this property is unknown. + +} ze_pci_speed_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Static PCI properties +typedef struct _ze_pci_ext_properties_t { ze_structure_type_t stype; ///< [in] type of this structure void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_kernel_timestamp_result_t* pKernelTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of - ///< kernel timestamp results - ze_synchronized_timestamp_result_ext_t* pSynchronizedTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of - ///< synchronized timestamp results + ze_pci_address_ext_t address; ///< [out] The BDF address + ze_pci_speed_ext_t maxSpeed; ///< [out] Fastest port configuration supported by the device (sum of all + ///< lanes) -} ze_event_query_kernel_timestamps_results_ext_properties_t; +} ze_pci_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Query an event's timestamp value on the host, with domain preference. +/// @brief Get PCI properties - address, max speed /// /// @details -/// - For collecting *only* kernel timestamps, the application must ensure -/// the event was created from an event pool that was created using -/// ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. -/// - For collecting synchronized timestamps, the application must ensure -/// the event was created from an event pool that was created using -/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. Kernel timestamps -/// are also available from this type of event pool, but there is a -/// performance cost. -/// - The destination memory will be unmodified if the event has not been -/// signaled. /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support -/// ::ZE_extension_event_query_kernel_timestamps. -/// - The implementation must return all timestamps for the specified event -/// and device pair. -/// - The implementation must return all timestamps for all sub-devices when -/// device handle is parent device. -/// - The implementation may return all timestamps for sub-devices when -/// device handle is sub-device or may return 0 for count. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - None /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9189,622 +12308,2630 @@ typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hEvent` /// + `nullptr == hDevice` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pCount` +/// + `nullptr == pPciProperties` ZE_APIEXPORT ze_result_t ZE_APICALL -zeEventQueryKernelTimestampsExt( - ze_event_handle_t hEvent, ///< [in] handle of the event - ze_device_handle_t hDevice, ///< [in] handle of the device to query - uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. - ///< - This value is implementation specific. - ///< - if `*pCount` is zero, then the driver shall update the value with - ///< the total number of event packets available. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver shall update the value with the correct value. - ///< - Buffer(s) for query results must be sized by the application to - ///< accommodate a minimum of `*pCount` elements. - ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query - ///< properties structure(s). - ///< - This parameter may be null when `*pCount` is zero. - ///< - if `*pCount` is less than the number of event packets available, - ///< the driver may only update `*pCount` elements, starting at element zero. - ///< - if `*pCount` is greater than the number of event packets - ///< available, the driver may only update the valid elements. +zeDevicePciGetPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object. + ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. ); #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure builder. +// Intel 'oneAPI' Level-Zero Extension APIs for sRGB #if !defined(__GNUC__) -#pragma region RTASBuilder +#pragma region SRGB #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_RTAS_BUILDER_EXP_NAME -/// @brief Ray Tracing Acceleration Structure Builder Extension Name -#define ZE_RTAS_BUILDER_EXP_NAME "ZE_experimental_rtas_builder" -#endif // ZE_RTAS_BUILDER_EXP_NAME +#ifndef ZE_SRGB_EXT_NAME +/// @brief sRGB Extension Name +#define ZE_SRGB_EXT_NAME "ZE_extension_srgb" +#endif // ZE_SRGB_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) -typedef enum _ze_rtas_builder_exp_version_t +/// @brief sRGB Extension Version(s) +typedef enum _ze_srgb_ext_version_t { - ZE_RTAS_BUILDER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_RTAS_BUILDER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_SRGB_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SRGB_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SRGB_EXT_VERSION_* ENUMs -} ze_rtas_builder_exp_version_t; +} ze_srgb_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure device flags -typedef uint32_t ze_rtas_device_exp_flags_t; -typedef enum _ze_rtas_device_exp_flag_t -{ - ZE_RTAS_DEVICE_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use - ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff - -} ze_rtas_device_exp_flag_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure format +/// @brief sRGB image descriptor /// /// @details -/// - This is an opaque ray tracing acceleration structure format -/// identifier. -typedef enum _ze_rtas_format_exp_t +/// - This structure may be passed to ::zeImageCreate via the `pNext` member +/// of ::ze_image_desc_t +/// - Used for specifying that the image is in sRGB format. +typedef struct _ze_srgb_ext_desc_t { - ZE_RTAS_FORMAT_EXP_INVALID = 0, ///< Invalid acceleration structure format - ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_bool_t sRGB; ///< [in] Is sRGB. -} ze_rtas_format_exp_t; +} ze_srgb_ext_desc_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Image Copy To/From Memory +#if !defined(__GNUC__) +#pragma region imageCopy +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder flags -typedef uint32_t ze_rtas_builder_exp_flags_t; -typedef enum _ze_rtas_builder_exp_flag_t -{ - ZE_RTAS_BUILDER_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff - -} ze_rtas_builder_exp_flag_t; +#ifndef ZE_IMAGE_COPY_EXT_NAME +/// @brief Image Copy Extension Name +#define ZE_IMAGE_COPY_EXT_NAME "ZE_extension_image_copy" +#endif // ZE_IMAGE_COPY_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder parallel operation flags -typedef uint32_t ze_rtas_parallel_operation_exp_flags_t; -typedef enum _ze_rtas_parallel_operation_exp_flag_t +/// @brief Image Copy Extension Version(s) +typedef enum _ze_image_copy_ext_version_t { - ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_COPY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_COPY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_COPY_EXT_VERSION_* ENUMs -} ze_rtas_parallel_operation_exp_flag_t; +} ze_image_copy_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry flags -typedef uint32_t ze_rtas_builder_geometry_exp_flags_t; -typedef enum _ze_rtas_builder_geometry_exp_flag_t -{ - ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader - ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_FORCE_UINT32 = 0x7fffffff +/// @brief Copies from an image to device or shared memory. +/// +/// @details +/// - The application must ensure the memory pointed to by dstptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the source +/// image is a single-planar format. +/// - The application must ensure that the rowPitch is set to 0 if image is +/// a 1D image. Otherwise the rowPitch must be greater than or equal to +/// the element size in bytes x width. +/// - If rowPitch is set to 0, the appropriate row pitch is calculated based +/// on the size of each element in bytes multiplied by width +/// - The application must ensure that the slicePitch is set to 0 if image +/// is a 1D or 2D image. Otherwise this value must be greater than or +/// equal to rowPitch x height. +/// - If slicePitch is set to 0, the appropriate slice pitch is calculated +/// based on the rowPitch x height. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - clEnqueueReadImage +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hSrcImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == dstptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendImageCopyToMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination memory to copy to + ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from + const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor + uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being written + uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being written + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); -} ze_rtas_builder_geometry_exp_flag_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Copies to an image from device or shared memory. +/// +/// @details +/// - The application must ensure the memory pointed to by srcptr is +/// accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by srcptr as +/// it is free to be modified by either the Host or device up until +/// execution. +/// - The application must ensure the image and events are accessible by the +/// device on which the command list was created. +/// - The application must ensure the image format descriptor for the +/// destination image is a single-planar format. +/// - The application must ensure that the rowPitch is set to 0 if image is +/// a 1D image. Otherwise the rowPitch must be greater than or equal to +/// the element size in bytes x width. +/// - If rowPitch is set to 0, the appropriate row pitch is calculated based +/// on the size of each element in bytes multiplied by width +/// - The application must ensure that the slicePitch is set to 0 if image +/// is a 1D or 2D image. Otherwise this value must be greater than or +/// equal to rowPitch x height. +/// - If slicePitch is set to 0, the appropriate slice pitch is calculated +/// based on the rowPitch x height. +/// - The application must ensure the command list, image and events were +/// created, and the memory was allocated, on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @remarks +/// _Analogues_ +/// - clEnqueueWriteImage +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hDstImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendImageCopyFromMemoryExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to + const void* srcptr, ///< [in] pointer to source memory to copy from + const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor + uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D + ///< image or each image of a 1D or 2D image array being read + uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or + ///< each image of a 1D or 2D image array being read + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for Querying Image Allocation Properties. +#if !defined(__GNUC__) +#pragma region imageQueryAllocProperties +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder geometry flags (see -/// ::ze_rtas_builder_geometry_exp_flags_t) -typedef uint8_t ze_rtas_builder_packed_geometry_exp_flags_t; +#ifndef ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME +/// @brief Image Query Allocation Properties Extension Name +#define ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME "ZE_extension_image_query_alloc_properties" +#endif // ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder instance flags -typedef uint32_t ze_rtas_builder_instance_exp_flags_t; -typedef enum _ze_rtas_builder_instance_exp_flag_t +/// @brief Image Query Allocation Properties Extension Version(s) +typedef enum _ze_image_query_alloc_properties_ext_version_t { - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to - ///< be non-opaque - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it - ///< to be opaque - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff - -} ze_rtas_builder_instance_exp_flag_t; + ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_* ENUMs -/////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder instance flags (see -/// ::ze_rtas_builder_instance_exp_flags_t) -typedef uint8_t ze_rtas_builder_packed_instance_exp_flags_t; +} ze_image_query_alloc_properties_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder build operation flags -/// -/// @details -/// - These flags allow the application to tune the acceleration structure -/// build operation. -/// - The acceleration structure builder implementation might choose to use -/// spatial splitting to split large or long primitives into smaller -/// pieces. This may result in any-hit shaders being invoked multiple -/// times for non-opaque primitives, unless -/// ::ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. -/// - Usage of any of these flags may reduce ray tracing performance. -typedef uint32_t ze_rtas_builder_build_op_exp_flags_t; -typedef enum _ze_rtas_builder_build_op_exp_flag_t +/// @brief Image allocation properties queried using +/// ::zeImageGetAllocPropertiesExt +typedef struct _ze_image_allocation_ext_properties_t { - ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure - ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive - ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t id; ///< [out] identifier for this allocation -} ze_rtas_builder_build_op_exp_flag_t; +} ze_image_allocation_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder build quality hint +/// @brief Retrieves attributes of an image allocation /// /// @details -/// - Depending on use case different quality modes for acceleration -/// structure build are supported. -/// - A low-quality build builds an acceleration structure fast, but at the -/// cost of some reduction in ray tracing performance. This mode is -/// recommended for dynamic content, such as animated characters. -/// - A medium-quality build uses a compromise between build quality and ray -/// tracing performance. This mode should be used by default. -/// - Higher ray tracing performance can be achieved by using a high-quality -/// build, but acceleration structure build performance might be -/// significantly reduced. -typedef enum _ze_rtas_builder_build_quality_hint_exp_t -{ - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW = 0, ///< build low-quality acceleration structure (fast) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH = 2, ///< build high-quality acceleration structure (slow) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_FORCE_UINT32 = 0x7fffffff +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// + `nullptr == hImage` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pImageAllocProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeImageGetAllocPropertiesExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_image_handle_t hImage, ///< [in] handle of image object to query + ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties + ); -} ze_rtas_builder_build_quality_hint_exp_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Linkage Inspection +#if !defined(__GNUC__) +#pragma region linkageInspection +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_LINKAGE_INSPECTION_EXT_NAME +/// @brief Linkage Inspection Extension Name +#define ZE_LINKAGE_INSPECTION_EXT_NAME "ZE_extension_linkage_inspection" +#endif // ZE_LINKAGE_INSPECTION_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry type -typedef enum _ze_rtas_builder_geometry_type_exp_t +/// @brief Linkage Inspection Extension Version(s) +typedef enum _ze_linkage_inspection_ext_version_t { - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES = 0, ///< triangle mesh geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS = 1, ///< quad mesh geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL = 2, ///< procedural geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE = 3, ///< instance geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff + ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_LINKAGE_INSPECTION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_VERSION_* ENUMs -} ze_rtas_builder_geometry_type_exp_t; +} ze_linkage_inspection_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure builder geometry type (see -/// ::ze_rtas_builder_geometry_type_exp_t) -typedef uint8_t ze_rtas_builder_packed_geometry_type_exp_t; +/// @brief Supported module linkage inspection flags +typedef uint32_t ze_linkage_inspection_ext_flags_t; +typedef enum _ze_linkage_inspection_ext_flag_t +{ + ZE_LINKAGE_INSPECTION_EXT_FLAG_IMPORTS = ZE_BIT(0), ///< List all imports of modules + ZE_LINKAGE_INSPECTION_EXT_FLAG_UNRESOLVABLE_IMPORTS = ZE_BIT(1), ///< List all imports of modules that do not have a corresponding export + ZE_LINKAGE_INSPECTION_EXT_FLAG_EXPORTS = ZE_BIT(2), ///< List all exports of modules + ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_FLAG_* ENUMs + +} ze_linkage_inspection_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure data buffer element format +/// @brief Module linkage inspection descriptor /// /// @details -/// - Specifies the format of data buffer elements. -/// - Data buffers may contain instancing transform matrices, triangle/quad -/// vertex indices, etc... -typedef enum _ze_rtas_builder_input_data_format_exp_t +/// - This structure may be passed to ::zeModuleInspectLinkageExt. +typedef struct _ze_linkage_inspection_ext_desc_t { - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see - ///< ::ze_rtas_transform_float3x4_column_major_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see - ///< ::ze_rtas_transform_float3x4_aligned_column_major_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see - ///< ::ze_rtas_transform_float3x4_row_major_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see - ///< ::ze_rtas_triangle_indices_uint32_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_linkage_inspection_ext_flags_t flags; ///< [in] flags specifying module linkage inspection. + ///< must be 0 (default) or a valid combination of ::ze_linkage_inspection_ext_flag_t. -} ze_rtas_builder_input_data_format_exp_t; +} ze_linkage_inspection_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Packed ray tracing acceleration structure data buffer element format -/// (see ::ze_rtas_builder_input_data_format_exp_t) -typedef uint8_t ze_rtas_builder_packed_input_data_format_exp_t; +/// @brief List Imports & Exports +/// +/// @details +/// - List all the import & unresolveable import dependencies & exports of a +/// set of modules +/// +/// @remarks +/// _Analogues_ +/// - None +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pInspectDesc` +/// + `nullptr == phModules` +/// + `nullptr == phLog` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x7 < pInspectDesc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeModuleInspectLinkageExt( + ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. + uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. + ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be + ///< inspected for import dependencies. + ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will + ///< contain separate lists of imports, un-resolvable imports, and exports. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting memory compression hints. +#if !defined(__GNUC__) +#pragma region memoryCompressionHints +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME +/// @brief Memory Compression Hints Extension Name +#define ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME "ZE_extension_memory_compression_hints" +#endif // ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of ray tracing acceleration structure builder object -typedef struct _ze_rtas_builder_exp_handle_t *ze_rtas_builder_exp_handle_t; +/// @brief Memory Compression Hints Extension Version(s) +typedef enum _ze_memory_compression_hints_ext_version_t +{ + ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_* ENUMs + +} ze_memory_compression_hints_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Handle of ray tracing acceleration structure builder parallel -/// operation object -typedef struct _ze_rtas_parallel_operation_exp_handle_t *ze_rtas_parallel_operation_exp_handle_t; +/// @brief Supported memory compression hints flags +typedef uint32_t ze_memory_compression_hints_ext_flags_t; +typedef enum _ze_memory_compression_hints_ext_flag_t +{ + ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_COMPRESSED = ZE_BIT(0), ///< Hint Driver implementation to make allocation compressible + ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_UNCOMPRESSED = ZE_BIT(1), ///< Hint Driver implementation to make allocation not compressible + ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_* ENUMs + +} ze_memory_compression_hints_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder descriptor -typedef struct _ze_rtas_builder_exp_desc_t +/// @brief Compression hints memory allocation descriptor +/// +/// @details +/// - This structure may be passed to ::zeMemAllocShared or +/// ::zeMemAllocDevice, via the `pNext` member of +/// ::ze_device_mem_alloc_desc_t. +/// - This structure may be passed to ::zeMemAllocHost, via the `pNext` +/// member of ::ze_host_mem_alloc_desc_t. +/// - This structure may be passed to ::zeImageCreate, via the `pNext` +/// member of ::ze_image_desc_t. +typedef struct _ze_memory_compression_hints_ext_desc_t { ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_builder_exp_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version + ze_memory_compression_hints_ext_flags_t flags; ///< [in] flags specifying if allocation should be compressible or not. + ///< Must be set to one of the ::ze_memory_compression_hints_ext_flag_t; -} ze_rtas_builder_exp_desc_t; +} ze_memory_compression_hints_ext_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Memory Free Policies +#if !defined(__GNUC__) +#pragma region memoryFreePolicies +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_MEMORY_FREE_POLICIES_EXT_NAME +/// @brief Memory Free Policies Extension Name +#define ZE_MEMORY_FREE_POLICIES_EXT_NAME "ZE_extension_memory_free_policies" +#endif // ZE_MEMORY_FREE_POLICIES_EXT_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder properties -typedef struct _ze_rtas_builder_exp_properties_t +/// @brief Memory Free Policies Extension Version(s) +typedef enum _ze_memory_free_policies_ext_version_t { - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_rtas_builder_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder flags - size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer - ///< - When using an acceleration structure buffer of this size, the - ///< build is expected to succeed; however, it is possible that the build - ///< may fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY - size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer - ///< - When using an acceleration structure buffer of this size, the - ///< build is guaranteed to not run out of memory. - size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration - ///< structure build. + ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_MEMORY_FREE_POLICIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_MEMORY_FREE_POLICIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MEMORY_FREE_POLICIES_EXT_VERSION_* ENUMs -} ze_rtas_builder_exp_properties_t; +} ze_memory_free_policies_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder parallel operation -/// properties -typedef struct _ze_rtas_parallel_operation_exp_properties_t +/// @brief Supported memory free policy capability flags +typedef uint32_t ze_driver_memory_free_policy_ext_flags_t; +typedef enum _ze_driver_memory_free_policy_ext_flag_t { - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - ze_rtas_parallel_operation_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation - ///< flags - uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE = ZE_BIT(0), ///< Blocks until all commands using the memory are complete before + ///< scheduling memory to be freed. Does not guarantee memory is freed upon + ///< return, only that it is safe and is scheduled to be freed. Actual + ///< freeing of memory is specific to user mode driver and kernel mode + ///< driver implementation and may be done asynchronously. + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< Immediately schedules the memory to be freed and returns without + ///< blocking. Memory may be freed after all commands using the memory are + ///< complete. Actual freeing of memory is specific to user mode driver and + ///< kernel mode driver implementation and may be done asynchronously. + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_* ENUMs -} ze_rtas_parallel_operation_exp_properties_t; +} ze_driver_memory_free_policy_ext_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure device properties +/// @brief Driver memory free properties queried using ::zeDriverGetProperties /// /// @details -/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` -/// member of ::ze_device_properties_t. -/// - The implementation shall populate `format` with a value other than -/// ::ZE_RTAS_FORMAT_EXP_INVALID when the device supports ray tracing. -typedef struct _ze_rtas_device_exp_properties_t +/// - All drivers must support an immediate free policy, which is the +/// default free policy. +/// - This structure may be returned from ::zeDriverGetProperties, via the +/// `pNext` member of ::ze_driver_properties_t. +typedef struct _ze_driver_memory_free_ext_properties_t { ze_structure_type_t stype; ///< [in] type of this structure void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_device_exp_flags_t flags; ///< [out] ray tracing acceleration structure device flags - ze_rtas_format_exp_t rtasFormat; ///< [out] ray tracing acceleration structure format - uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer + ze_driver_memory_free_policy_ext_flags_t freePolicies; ///< [out] Supported memory free policies. + ///< must be 0 or a combination of ::ze_driver_memory_free_policy_ext_flag_t. -} ze_rtas_device_exp_properties_t; +} ze_driver_memory_free_ext_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief A 3-component vector type -typedef struct _ze_rtas_float3_exp_t +/// @brief Memory free descriptor with free policy +typedef struct _ze_memory_free_ext_desc_t { - float x; ///< [in] x-coordinate of float3 vector - float y; ///< [in] y-coordinate of float3 vector - float z; ///< [in] z-coordinate of float3 vector + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_driver_memory_free_policy_ext_flags_t freePolicy; ///< [in] flags specifying the memory free policy. + ///< must be 0 (default) or a supported ::ze_driver_memory_free_policy_ext_flag_t; + ///< default behavior is to free immediately. -} ze_rtas_float3_exp_t; +} ze_memory_free_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in column-major layout +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - A 3x4 affine transformation in column major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -typedef struct _ze_rtas_transform_float3x4_column_major_exp_t +/// - Similar to zeMemFree, with added parameter to choose the free policy. +/// - Does not guarantee memory is freed upon return. See free policy +/// descriptions for details. +/// - The application must **not** call this function from simultaneous +/// threads with the same pointer. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pMemFreeDesc` +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x3 < pMemFreeDesc->freePolicy` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeMemFreeExt( + ze_context_handle_t hContext, ///< [in] handle of the context object + const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor + void* ptr ///< [in][release] pointer to memory to free + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Bandwidth +#if !defined(__GNUC__) +#pragma region bandwidth +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_BANDWIDTH_PROPERTIES_EXP_NAME +/// @brief Bandwidth Extension Name +#define ZE_BANDWIDTH_PROPERTIES_EXP_NAME "ZE_experimental_bandwidth_properties" +#endif // ZE_BANDWIDTH_PROPERTIES_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Bandwidth Extension Version(s) +typedef enum _ze_bandwidth_properties_exp_version_t { - float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix - float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix - float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix - float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix - float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix - float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix - float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix - float p_x; ///< [in] element 0 of column 3 of 3x4 matrix - float p_y; ///< [in] element 1 of column 3 of 3x4 matrix - float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_* ENUMs -} ze_rtas_transform_float3x4_column_major_exp_t; +} ze_bandwidth_properties_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in column-major layout with aligned column -/// vectors +/// @brief P2P Bandwidth Properties /// /// @details -/// - A 3x4 affine transformation in column major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -/// - The column vectors are aligned to 16-bytes and pad members are -/// ignored. -typedef struct _ze_rtas_transform_float3x4_aligned_column_major_exp_t +/// - This structure may be passed to ::zeDeviceGetP2PProperties by having +/// the pNext member of ::ze_device_p2p_properties_t point at this struct. +typedef struct _ze_device_p2p_bandwidth_exp_properties_t { - float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix - float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix - float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix - float pad0; ///< [in] ignored padding - float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix - float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix - float pad1; ///< [in] ignored padding - float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix - float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix - float pad2; ///< [in] ignored padding - float p_x; ///< [in] element 0 of column 3 of 3x4 matrix - float p_y; ///< [in] element 1 of column 3 of 3x4 matrix - float p_z; ///< [in] element 2 of column 3 of 3x4 matrix - float pad3; ///< [in] ignored padding + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t logicalBandwidth; ///< [out] total logical design bandwidth for all links connecting the two + ///< devices + uint32_t physicalBandwidth; ///< [out] total physical design bandwidth for all links connecting the two + ///< devices + ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit + uint32_t logicalLatency; ///< [out] average logical design latency for all links connecting the two + ///< devices + uint32_t physicalLatency; ///< [out] average physical design latency for all links connecting the two + ///< devices + ze_latency_unit_t latencyUnit; ///< [out] latency unit -} ze_rtas_transform_float3x4_aligned_column_major_exp_t; +} ze_device_p2p_bandwidth_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief 3x4 affine transformation in row-major layout +/// @brief Copy Bandwidth Properties /// /// @details -/// - A 3x4 affine transformation in row-major layout, consisting of vectors -/// - vx=(vx_x, vx_y, vx_z), -/// - vy=(vy_x, vy_y, vy_z), -/// - vz=(vz_x, vz_y, vz_z), and -/// - p=(p_x, p_y, p_z) -/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + -/// z*vz + p`. -typedef struct _ze_rtas_transform_float3x4_row_major_exp_t +/// - This structure may be passed to +/// ::zeDeviceGetCommandQueueGroupProperties by having the pNext member of +/// ::ze_command_queue_group_properties_t point at this struct. +/// - [DEPRECATED] +typedef struct _ze_copy_bandwidth_exp_properties_t { - float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix - float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix - float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix - float p_x; ///< [in] element 3 of row 0 of 3x4 matrix - float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix - float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix - float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix - float p_y; ///< [in] element 3 of row 1 of 3x4 matrix - float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix - float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix - float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix - float p_z; ///< [in] element 3 of row 2 of 3x4 matrix + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t copyBandwidth; ///< [out] design bandwidth supported by this engine type for copy + ///< operations + ze_bandwidth_unit_t copyBandwidthUnit; ///< [out] copy bandwidth unit -} ze_rtas_transform_float3x4_row_major_exp_t; +} ze_copy_bandwidth_exp_properties_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Device Local Identifier (LUID) +#if !defined(__GNUC__) +#pragma region deviceLUID +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds -/// in each dimension -typedef struct _ze_rtas_aabb_exp_t +#ifndef ZE_DEVICE_LUID_EXT_NAME +/// @brief Device Local Identifier (LUID) Extension Name +#define ZE_DEVICE_LUID_EXT_NAME "ZE_extension_device_luid" +#endif // ZE_DEVICE_LUID_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Local Identifier (LUID) Extension Version(s) +typedef enum _ze_device_luid_ext_version_t { - ze_rtas_float3_exp_t lower; ///< [in] lower bounds of AABB - ze_rtas_float3_exp_t upper; ///< [in] upper bounds of AABB + ZE_DEVICE_LUID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_LUID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_LUID_EXT_VERSION_* ENUMs -} ze_rtas_aabb_exp_t; +} ze_device_luid_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Triangle represented using 3 vertex indices -/// -/// @details -/// - Represents a triangle using 3 vertex indices that index into a vertex -/// array that needs to be provided together with the index array. -/// - The linear barycentric u/v parametrization of the triangle is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, and -/// - (u=0, v=1) at v2 -typedef struct _ze_rtas_triangle_indices_uint32_exp_t +#ifndef ZE_MAX_DEVICE_LUID_SIZE_EXT +/// @brief Maximum device local identifier (LUID) size in bytes +#define ZE_MAX_DEVICE_LUID_SIZE_EXT 8 +#endif // ZE_MAX_DEVICE_LUID_SIZE_EXT + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device local identifier (LUID) +typedef struct _ze_device_luid_ext_t { - uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array - uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex - ///< array - uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array + uint8_t id[ZE_MAX_DEVICE_LUID_SIZE_EXT]; ///< [out] opaque data representing a device LUID -} ze_rtas_triangle_indices_uint32_exp_t; +} ze_device_luid_ext_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Quad represented using 4 vertex indices +/// @brief Device LUID properties queried using ::zeDeviceGetProperties /// /// @details -/// - Represents a quad composed of 4 indices that index into a vertex array -/// that needs to be provided together with the index array. -/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, -/// v2, v3. -/// The first triangle is made out of indices v0, v1, v3 and the second triangle -/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -/// of the quad is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, -/// - (u=0, v=1) at v3, and -/// - (u=1, v=1) at v2 -/// This is achieved by correcting the u'/v' coordinates of the second -/// triangle by -/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -typedef struct _ze_rtas_quad_indices_uint32_exp_t +/// - This structure may be returned from ::zeDeviceGetProperties, via the +/// `pNext` member of ::ze_device_properties_t. +typedef struct _ze_device_luid_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_device_luid_ext_t luid; ///< [out] locally unique identifier (LUID). + ///< The returned LUID can be cast to a LUID object and must be equal to + ///< the locally + ///< unique identifier of an IDXGIAdapter1 object that corresponds to the device. + uint32_t nodeMask; ///< [out] node mask. + ///< The returned node mask must contain exactly one bit. + ///< If the device is running on an operating system that supports the + ///< Direct3D 12 API + ///< and the device corresponds to an individual device in a linked device + ///< adapter, the + ///< returned node mask identifies the Direct3D 12 node corresponding to + ///< the device. + ///< Otherwise, the returned node mask must be 1. + +} ze_device_luid_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Fabric Topology Discovery +#if !defined(__GNUC__) +#pragma region fabric +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_FABRIC_EXP_NAME +/// @brief Fabric Topology Discovery Extension Name +#define ZE_FABRIC_EXP_NAME "ZE_experimental_fabric" +#endif // ZE_FABRIC_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Fabric Topology Discovery Extension Version(s) +typedef enum _ze_fabric_exp_version_t +{ + ZE_FABRIC_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_FABRIC_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_FABRIC_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_EXP_VERSION_* ENUMs + +} ze_fabric_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE +/// @brief Maximum fabric edge model string size +#define ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE 256 +#endif // ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Fabric Vertex types +typedef enum _ze_fabric_vertex_exp_type_t +{ + ZE_FABRIC_VERTEX_EXP_TYPE_UNKNOWN = 0, ///< Fabric vertex type is unknown + ZE_FABRIC_VERTEX_EXP_TYPE_DEVICE = 1, ///< Fabric vertex represents a device + ZE_FABRIC_VERTEX_EXP_TYPE_SUBDEVICE = 2, ///< Fabric vertex represents a subdevice + ZE_FABRIC_VERTEX_EXP_TYPE_SWITCH = 3, ///< Fabric vertex represents a switch + ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_VERTEX_EXP_TYPE_* ENUMs + +} ze_fabric_vertex_exp_type_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Fabric edge duplexity +typedef enum _ze_fabric_edge_exp_duplexity_t +{ + ZE_FABRIC_EDGE_EXP_DUPLEXITY_UNKNOWN = 0, ///< Fabric edge duplexity is unknown + ZE_FABRIC_EDGE_EXP_DUPLEXITY_HALF_DUPLEX = 1, ///< Fabric edge is half duplex, i.e. stated bandwidth is obtained in only + ///< one direction at time + ZE_FABRIC_EDGE_EXP_DUPLEXITY_FULL_DUPLEX = 2, ///< Fabric edge is full duplex, i.e. stated bandwidth is supported in both + ///< directions simultaneously + ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_FABRIC_EDGE_EXP_DUPLEXITY_* ENUMs + +} ze_fabric_edge_exp_duplexity_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief PCI address +/// +/// @details +/// - A PCI BDF address is the bus:device:function address of the device and +/// is useful for locating the device in the PCI switch fabric. +typedef struct _ze_fabric_vertex_pci_exp_address_t +{ + uint32_t domain; ///< [out] PCI domain number + uint32_t bus; ///< [out] PCI BDF bus number + uint32_t device; ///< [out] PCI BDF device number + uint32_t function; ///< [out] PCI BDF function number + +} ze_fabric_vertex_pci_exp_address_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Fabric Vertex properties +typedef struct _ze_fabric_vertex_exp_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_uuid_t uuid; ///< [out] universal unique identifier. If the vertex is co-located with a + ///< device/subdevice, then this uuid will match that of the corresponding + ///< device/subdevice + ze_fabric_vertex_exp_type_t type; ///< [out] does the fabric vertex represent a device, subdevice, or switch? + ze_bool_t remote; ///< [out] does the fabric vertex live on the local node or on a remote + ///< node? + ze_fabric_vertex_pci_exp_address_t address; ///< [out] B/D/F address of fabric vertex & associated device/subdevice if + ///< available + +} ze_fabric_vertex_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Fabric Edge properties +typedef struct _ze_fabric_edge_exp_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_uuid_t uuid; ///< [out] universal unique identifier. + char model[ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE]; ///< [out] Description of fabric edge technology. Will be set to the string + ///< "unkown" if this cannot be determined for this edge + uint32_t bandwidth; ///< [out] design bandwidth + ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit + uint32_t latency; ///< [out] design latency + ze_latency_unit_t latencyUnit; ///< [out] latency unit + ze_fabric_edge_exp_duplexity_t duplexity; ///< [out] Duplexity of the fabric edge + +} ze_fabric_edge_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves fabric vertices within a driver +/// +/// @details +/// - A fabric vertex represents either a device or a switch connected to +/// other fabric vertices. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFabricVertexGetExp( + ze_driver_handle_t hDriver, ///< [in] handle of the driver instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric vertices available. + ///< if count is greater than the number of fabric vertices available, then + ///< the driver shall update the value with the correct number of fabric + ///< vertices available. + ze_fabric_vertex_handle_t* phVertices ///< [in,out][optional][range(0, *pCount)] array of handle of fabric vertices. + ///< if count is less than the number of fabric vertices available, then + ///< driver shall only retrieve that number of fabric vertices. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves a fabric sub-vertex from a fabric vertex +/// +/// @details +/// - Multiple calls to this function will return identical fabric vertex +/// handles, in the same order. +/// - The number of handles returned from this function is affected by the +/// `ZE_AFFINITY_MASK` environment variable. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVertex` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFabricVertexGetSubVerticesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex object + uint32_t* pCount, ///< [in,out] pointer to the number of sub-vertices. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-vertices available. + ///< if count is greater than the number of sub-vertices available, then + ///< the driver shall update the value with the correct number of + ///< sub-vertices available. + ze_fabric_vertex_handle_t* phSubvertices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-vertices. + ///< if count is less than the number of sub-vertices available, then + ///< driver shall only retrieve that number of sub-vertices. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves properties of the fabric vertex. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVertex` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pVertexProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFabricVertexGetPropertiesExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_fabric_vertex_exp_properties_t* pVertexProperties ///< [in,out] query result for fabric vertex properties + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns device handle from fabric vertex handle. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVertex` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phDevice` +/// - ::ZE_RESULT_EXP_ERROR_VERTEX_IS_NOT_DEVICE +/// + Provided fabric vertex handle does not correspond to a device or subdevice. +/// - ::ZE_RESULT_EXP_ERROR_REMOTE_DEVICE +/// + Provided fabric vertex handle corresponds to remote device or subdevice. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFabricVertexGetDeviceExp( + ze_fabric_vertex_handle_t hVertex, ///< [in] handle of the fabric vertex + ze_device_handle_t* phDevice ///< [out] device handle corresponding to fabric vertex + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns fabric vertex handle from device handle. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phVertex` +/// - ::ZE_RESULT_EXP_ERROR_DEVICE_IS_NOT_VERTEX +/// + Provided device handle does not correspond to a fabric vertex. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceGetFabricVertexExp( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_fabric_vertex_handle_t* phVertex ///< [out] fabric vertex handle corresponding to device + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves all fabric edges between provided pair of fabric vertices +/// +/// @details +/// - A fabric edge represents one or more physical links between two fabric +/// vertices. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVertexA` +/// + `nullptr == hVertexB` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFabricEdgeGetExp( + ze_fabric_vertex_handle_t hVertexA, ///< [in] handle of first fabric vertex instance + ze_fabric_vertex_handle_t hVertexB, ///< [in] handle of second fabric vertex instance + uint32_t* pCount, ///< [in,out] pointer to the number of fabric edges. + ///< if count is zero, then the driver shall update the value with the + ///< total number of fabric edges available. + ///< if count is greater than the number of fabric edges available, then + ///< the driver shall update the value with the correct number of fabric + ///< edges available. + ze_fabric_edge_handle_t* phEdges ///< [in,out][optional][range(0, *pCount)] array of handle of fabric edges. + ///< if count is less than the number of fabric edges available, then + ///< driver shall only retrieve that number of fabric edges. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves fabric vertices connected by a fabric edge +/// +/// @details +/// - A fabric vertex represents either a device or a switch connected to +/// other fabric vertices via a fabric edge. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEdge` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phVertexA` +/// + `nullptr == phVertexB` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFabricEdgeGetVerticesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge instance + ze_fabric_vertex_handle_t* phVertexA, ///< [out] fabric vertex connected to one end of the given fabric edge. + ze_fabric_vertex_handle_t* phVertexB ///< [out] fabric vertex connected to other end of the given fabric edge. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves properties of the fabric edge. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEdge` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pEdgeProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeFabricEdgeGetPropertiesExp( + ze_fabric_edge_handle_t hEdge, ///< [in] handle of the fabric edge + ze_fabric_edge_exp_properties_t* pEdgeProperties ///< [in,out] query result for fabric edge properties + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Device Memory Properties +#if !defined(__GNUC__) +#pragma region memoryProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME +/// @brief Device Memory Properties Extension Name +#define ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME "ZE_extension_device_memory_properties" +#endif // ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Memory Properties Extension Version(s) +typedef enum _ze_device_memory_properties_ext_version_t +{ + ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_device_memory_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Memory module types +typedef enum _ze_device_memory_ext_type_t +{ + ZE_DEVICE_MEMORY_EXT_TYPE_HBM = 0, ///< HBM memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM2 = 1, ///< HBM2 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR = 2, ///< DDR memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR2 = 3, ///< DDR2 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR3 = 4, ///< DDR3 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR4 = 5, ///< DDR4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_DDR5 = 6, ///< DDR5 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR = 7, ///< LPDDR memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR3 = 8, ///< LPDDR3 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR4 = 9, ///< LPDDR4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_LPDDR5 = 10, ///< LPDDR5 memory + ZE_DEVICE_MEMORY_EXT_TYPE_SRAM = 11, ///< SRAM memory + ZE_DEVICE_MEMORY_EXT_TYPE_L1 = 12, ///< L1 cache + ZE_DEVICE_MEMORY_EXT_TYPE_L3 = 13, ///< L3 cache + ZE_DEVICE_MEMORY_EXT_TYPE_GRF = 14, ///< Execution unit register file + ZE_DEVICE_MEMORY_EXT_TYPE_SLM = 15, ///< Execution unit shared local memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR4 = 16, ///< GDDR4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5 = 17, ///< GDDR5 memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR5X = 18, ///< GDDR5X memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6 = 19, ///< GDDR6 memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6X = 20, ///< GDDR6X memory + ZE_DEVICE_MEMORY_EXT_TYPE_GDDR7 = 21, ///< GDDR7 memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM2E = 22, ///< HBM2E memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM3 = 23, ///< HBM3 memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM3E = 24, ///< HBM3E memory + ZE_DEVICE_MEMORY_EXT_TYPE_HBM4 = 25, ///< HBM4 memory + ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs + +} ze_device_memory_ext_type_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Memory properties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetMemoryProperties via +/// the `pNext` member of ::ze_device_memory_properties_t +typedef struct _ze_device_memory_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_device_memory_ext_type_t type; ///< [out] The memory type + uint64_t physicalSize; ///< [out] Physical memory size in bytes. A value of 0 indicates that this + ///< property is not known. However, a call to ::zesMemoryGetState() will + ///< correctly return the total size of usable memory. + uint32_t readBandwidth; ///< [out] Design bandwidth for reads + uint32_t writeBandwidth; ///< [out] Design bandwidth for writes + ze_bandwidth_unit_t bandwidthUnit; ///< [out] bandwidth unit + +} ze_device_memory_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Bfloat16 Conversions +#if !defined(__GNUC__) +#pragma region bfloat16conversions +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_BFLOAT16_CONVERSIONS_EXT_NAME +/// @brief Bfloat16 Conversions Extension Name +#define ZE_BFLOAT16_CONVERSIONS_EXT_NAME "ZE_extension_bfloat16_conversions" +#endif // ZE_BFLOAT16_CONVERSIONS_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Bfloat16 Conversions Extension Version(s) +typedef enum _ze_bfloat16_conversions_ext_version_t +{ + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_* ENUMs + +} ze_bfloat16_conversions_ext_version_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Device IP Version +#if !defined(__GNUC__) +#pragma region deviceipversion +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DEVICE_IP_VERSION_EXT_NAME +/// @brief Device IP Version Extension Name +#define ZE_DEVICE_IP_VERSION_EXT_NAME "ZE_extension_device_ip_version" +#endif // ZE_DEVICE_IP_VERSION_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device IP Version Extension Version(s) +typedef enum _ze_device_ip_version_version_t +{ + ZE_DEVICE_IP_VERSION_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_IP_VERSION_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_IP_VERSION_VERSION_* ENUMs + +} ze_device_ip_version_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device IP version queried using ::zeDeviceGetProperties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t +typedef struct _ze_device_ip_version_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t ipVersion; ///< [out] Device IP version. The meaning of the device IP version is + ///< implementation-defined, but newer devices should have a higher + ///< version than older devices. + +} ze_device_ip_version_ext_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for querying kernel max group size properties. +#if !defined(__GNUC__) +#pragma region kernelMaxGroupSizeProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME +/// @brief Kernel Max Group Size Properties Extension Name +#define ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME "ZE_extension_kernel_max_group_size_properties" +#endif // ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Kernel Max Group Size Properties Extension Version(s) +typedef enum _ze_kernel_max_group_size_properties_ext_version_t +{ + ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_kernel_max_group_size_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Additional kernel max group size properties +/// +/// @details +/// - This structure may be passed to ::zeKernelGetProperties, via the +/// `pNext` member of ::ze_kernel_properties_t, to query additional kernel +/// max group size properties. +typedef struct _ze_kernel_max_group_size_properties_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t maxGroupSize; ///< [out] maximum group size that can be used to execute the kernel. This + ///< value may be less than or equal to the `maxTotalGroupSize` member of + ///< ::ze_device_compute_properties_t. + +} ze_kernel_max_group_size_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief compiler-independent type +typedef ze_kernel_max_group_size_properties_ext_t ze_kernel_max_group_size_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for querying sub-allocations properties. +#if !defined(__GNUC__) +#pragma region subAllocationsProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_SUB_ALLOCATIONS_EXP_NAME +/// @brief Sub-Allocations Properties Extension Name +#define ZE_SUB_ALLOCATIONS_EXP_NAME "ZE_experimental_sub_allocations" +#endif // ZE_SUB_ALLOCATIONS_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Sub-Allocations Properties Extension Version(s) +typedef enum _ze_sub_allocations_exp_version_t +{ + ZE_SUB_ALLOCATIONS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_SUB_ALLOCATIONS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_SUB_ALLOCATIONS_EXP_VERSION_* ENUMs + +} ze_sub_allocations_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Properties returned for a sub-allocation +typedef struct _ze_sub_allocation_t +{ + void* base; ///< [in,out][optional] base address of the sub-allocation + size_t size; ///< [in,out][optional] size of the allocation + +} ze_sub_allocation_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Sub-Allocations Properties +/// +/// @details +/// - This structure may be passed to ::zeMemGetAllocProperties, via the +/// `pNext` member of ::ze_memory_allocation_properties_t. +typedef struct _ze_memory_sub_allocations_exp_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t* pCount; ///< [in,out] pointer to the number of sub-allocations. + ///< if count is zero, then the driver shall update the value with the + ///< total number of sub-allocations on which the allocation has been divided. + ///< if count is greater than the number of sub-allocations, then the + ///< driver shall update the value with the correct number of sub-allocations. + ze_sub_allocation_t* pSubAllocations; ///< [in,out][optional][range(0, *pCount)] array of properties for sub-allocations. + ///< if count is less than the number of sub-allocations available, then + ///< driver shall only retrieve properties for that number of sub-allocations. + +} ze_memory_sub_allocations_exp_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting the querying of synchronized event timestamps. +#if !defined(__GNUC__) +#pragma region eventQueryKernelTimestamps +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME +/// @brief Event Query Kernel Timestamps Extension Name +#define ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME "ZE_extension_event_query_kernel_timestamps" +#endif // ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event Query Kernel Timestamps Extension Version(s) +typedef enum _ze_event_query_kernel_timestamps_ext_version_t +{ + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_* ENUMs + +} ze_event_query_kernel_timestamps_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event query kernel timestamps flags +typedef uint32_t ze_event_query_kernel_timestamps_ext_flags_t; +typedef enum _ze_event_query_kernel_timestamps_ext_flag_t +{ + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_KERNEL = ZE_BIT(0), ///< Kernel timestamp results + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_SYNCHRONIZED = ZE_BIT(1), ///< Device event timestamps synchronized to the host time domain + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_* ENUMs + +} ze_event_query_kernel_timestamps_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event query kernel timestamps properties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetProperties, via the +/// `pNext` member of ::ze_device_properties_t. +typedef struct _ze_event_query_kernel_timestamps_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_event_query_kernel_timestamps_ext_flags_t flags; ///< [out] 0 or some combination of + ///< ::ze_event_query_kernel_timestamps_ext_flag_t flags + +} ze_event_query_kernel_timestamps_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Kernel timestamp clock data synchronized to the host time domain +typedef struct _ze_synchronized_timestamp_data_ext_t +{ + uint64_t kernelStart; ///< [out] synchronized clock at start of kernel execution + uint64_t kernelEnd; ///< [out] synchronized clock at end of kernel execution + +} ze_synchronized_timestamp_data_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Synchronized kernel timestamp result +typedef struct _ze_synchronized_timestamp_result_ext_t +{ + ze_synchronized_timestamp_data_ext_t global; ///< [out] wall-clock data + ze_synchronized_timestamp_data_ext_t context; ///< [out] context-active data; only includes clocks while device context + ///< was actively executing. + +} ze_synchronized_timestamp_result_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Event query kernel timestamps results properties +typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_kernel_timestamp_result_t* pKernelTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of + ///< kernel timestamp results + ze_synchronized_timestamp_result_ext_t* pSynchronizedTimestampsBuffer; ///< [in,out][optional][range(0, *pCount)] pointer to destination buffer of + ///< synchronized timestamp results + +} ze_event_query_kernel_timestamps_results_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query an event's timestamp value on the host, with domain preference. +/// +/// @details +/// - For collecting *only* kernel timestamps, the application must ensure +/// the event was created from an event pool that was created using +/// ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. +/// - For collecting synchronized timestamps, the application must ensure +/// the event was created from an event pool that was created using +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flag. Kernel timestamps +/// are also available from this type of event pool, but there is a +/// performance cost. +/// - The destination memory will be unmodified if the event has not been +/// signaled. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support +/// ::ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME extension. +/// - The implementation must return all timestamps for the specified event +/// and device pair. +/// - The implementation must return all timestamps for all sub-devices when +/// device handle is parent device. +/// - The implementation may return all timestamps for sub-devices when +/// device handle is sub-device or may return 0 for count. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hEvent` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeEventQueryKernelTimestampsExt( + ze_event_handle_t hEvent, ///< [in] handle of the event + ze_device_handle_t hDevice, ///< [in] handle of the device to query + uint32_t* pCount, ///< [in,out] pointer to the number of event packets available. + ///< - This value is implementation specific. + ///< - if `*pCount` is zero, then the driver shall update the value with + ///< the total number of event packets available. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver shall update the value with the correct value. + ///< - Buffer(s) for query results must be sized by the application to + ///< accommodate a minimum of `*pCount` elements. + ze_event_query_kernel_timestamps_results_ext_properties_t* pResults ///< [in,out][optional][range(0, *pCount)] pointer to event query + ///< properties structure(s). + ///< - This parameter may be null when `*pCount` is zero. + ///< - if `*pCount` is less than the number of event packets available, + ///< the driver may only update `*pCount` elements, starting at element zero. + ///< - if `*pCount` is greater than the number of event packets + ///< available, the driver may only update the valid elements. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure builder. +#if !defined(__GNUC__) +#pragma region RTASBuilder +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_RTAS_BUILDER_EXP_NAME +/// @brief Ray Tracing Acceleration Structure Builder Extension Name +#define ZE_RTAS_BUILDER_EXP_NAME "ZE_experimental_rtas_builder" +#endif // ZE_RTAS_BUILDER_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) +typedef enum _ze_rtas_builder_exp_version_t +{ + ZE_RTAS_BUILDER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RTAS_BUILDER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXP_VERSION_* ENUMs + +} ze_rtas_builder_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure device flags +typedef uint32_t ze_rtas_device_exp_flags_t; +typedef enum _ze_rtas_device_exp_flag_t +{ + ZE_RTAS_DEVICE_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use + ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_DEVICE_EXP_FLAG_* ENUMs + +} ze_rtas_device_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure format +/// +/// @details +/// - This is an opaque ray tracing acceleration structure format +/// identifier. +typedef enum _ze_rtas_format_exp_t +{ + ZE_RTAS_FORMAT_EXP_INVALID = 0, ///< Invalid acceleration structure format + ZE_RTAS_FORMAT_EXP_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code + ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_FORMAT_EXP_* ENUMs + +} ze_rtas_format_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder flags +typedef uint32_t ze_rtas_builder_exp_flags_t; +typedef enum _ze_rtas_builder_exp_flag_t +{ + ZE_RTAS_BUILDER_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_EXP_FLAG_* ENUMs + +} ze_rtas_builder_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder parallel operation flags +typedef uint32_t ze_rtas_parallel_operation_exp_flags_t; +typedef enum _ze_rtas_parallel_operation_exp_flag_t +{ + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_* ENUMs + +} ze_rtas_parallel_operation_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry flags +typedef uint32_t ze_rtas_builder_geometry_exp_flags_t; +typedef enum _ze_rtas_builder_geometry_exp_flag_t +{ + ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader + ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_* ENUMs + +} ze_rtas_builder_geometry_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder geometry flags (see +/// ::ze_rtas_builder_geometry_exp_flags_t) +typedef uint8_t ze_rtas_builder_packed_geometry_exp_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance flags +typedef uint32_t ze_rtas_builder_instance_exp_flags_t; +typedef enum _ze_rtas_builder_instance_exp_flag_t +{ + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to + ///< be non-opaque + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it + ///< to be opaque + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_* ENUMs + +} ze_rtas_builder_instance_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder instance flags (see +/// ::ze_rtas_builder_instance_exp_flags_t) +typedef uint8_t ze_rtas_builder_packed_instance_exp_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder build operation flags +/// +/// @details +/// - These flags allow the application to tune the acceleration structure +/// build operation. +/// - The acceleration structure builder implementation might choose to use +/// spatial splitting to split large or long primitives into smaller +/// pieces. This may result in any-hit shaders being invoked multiple +/// times for non-opaque primitives, unless +/// ::ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. +/// - Usage of any of these flags may reduce ray tracing performance. +typedef uint32_t ze_rtas_builder_build_op_exp_flags_t; +typedef enum _ze_rtas_builder_build_op_exp_flag_t +{ + ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure + ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive + ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_* ENUMs + +} ze_rtas_builder_build_op_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder build quality hint +/// +/// @details +/// - Depending on use case different quality modes for acceleration +/// structure build are supported. +/// - A low-quality build builds an acceleration structure fast, but at the +/// cost of some reduction in ray tracing performance. This mode is +/// recommended for dynamic content, such as animated characters. +/// - A medium-quality build uses a compromise between build quality and ray +/// tracing performance. This mode should be used by default. +/// - Higher ray tracing performance can be achieved by using a high-quality +/// build, but acceleration structure build performance might be +/// significantly reduced. +typedef enum _ze_rtas_builder_build_quality_hint_exp_t +{ + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW = 0, ///< build low-quality acceleration structure (fast) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH = 2, ///< build high-quality acceleration structure (slow) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_* ENUMs + +} ze_rtas_builder_build_quality_hint_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry type +typedef enum _ze_rtas_builder_geometry_type_exp_t +{ + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES = 0, ///< triangle mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS = 1, ///< quad mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL = 2, ///< procedural geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE = 3, ///< instance geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_* ENUMs + +} ze_rtas_builder_geometry_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder geometry type (see +/// ::ze_rtas_builder_geometry_type_exp_t) +typedef uint8_t ze_rtas_builder_packed_geometry_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure data buffer element format +/// +/// @details +/// - Specifies the format of data buffer elements. +/// - Data buffers may contain instancing transform matrices, triangle/quad +/// vertex indices, etc... +typedef enum _ze_rtas_builder_input_data_format_exp_t +{ + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_column_major_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_aligned_column_major_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see + ///< ::ze_rtas_transform_float3x4_row_major_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see + ///< ::ze_rtas_triangle_indices_uint32_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_exp_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_* ENUMs + +} ze_rtas_builder_input_data_format_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure data buffer element format +/// (see ::ze_rtas_builder_input_data_format_exp_t) +typedef uint8_t ze_rtas_builder_packed_input_data_format_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder object +typedef struct _ze_rtas_builder_exp_handle_t *ze_rtas_builder_exp_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder parallel +/// operation object +typedef struct _ze_rtas_parallel_operation_exp_handle_t *ze_rtas_parallel_operation_exp_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder descriptor +typedef struct _ze_rtas_builder_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_builder_exp_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version + +} ze_rtas_builder_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder properties +typedef struct _ze_rtas_builder_exp_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_builder_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder flags + size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is expected to succeed; however, it is possible that the build + ///< may fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY + size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is guaranteed to not run out of memory. + size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration + ///< structure build. + +} ze_rtas_builder_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder parallel operation +/// properties +typedef struct _ze_rtas_parallel_operation_exp_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_parallel_operation_exp_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation + ///< flags + uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation + +} ze_rtas_parallel_operation_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure device properties +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` +/// member of ::ze_device_properties_t. +/// - The implementation shall populate `format` with a value other than +/// ::ZE_RTAS_FORMAT_EXP_INVALID when the device supports ray tracing. +typedef struct _ze_rtas_device_exp_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_device_exp_flags_t flags; ///< [out] ray tracing acceleration structure device flags + ze_rtas_format_exp_t rtasFormat; ///< [out] ray tracing acceleration structure format + uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer + +} ze_rtas_device_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief A 3-component vector type +typedef struct _ze_rtas_float3_exp_t +{ + float x; ///< [in] x-coordinate of float3 vector + float y; ///< [in] y-coordinate of float3 vector + float z; ///< [in] z-coordinate of float3 vector + +} ze_rtas_float3_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in column-major layout +/// +/// @details +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_column_major_exp_t +{ + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + +} ze_rtas_transform_float3x4_column_major_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in column-major layout with aligned column +/// vectors +/// +/// @details +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +/// - The column vectors are aligned to 16-bytes and pad members are +/// ignored. +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_exp_t +{ + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float pad0; ///< [in] ignored padding + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float pad1; ///< [in] ignored padding + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float pad2; ///< [in] ignored padding + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + float pad3; ///< [in] ignored padding + +} ze_rtas_transform_float3x4_aligned_column_major_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in row-major layout +/// +/// @details +/// - A 3x4 affine transformation in row-major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_row_major_exp_t +{ + float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix + float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix + float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix + float p_x; ///< [in] element 3 of row 0 of 3x4 matrix + float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix + float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix + float p_y; ///< [in] element 3 of row 1 of 3x4 matrix + float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix + float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix + float p_z; ///< [in] element 3 of row 2 of 3x4 matrix + +} ze_rtas_transform_float3x4_row_major_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds +/// in each dimension +typedef struct _ze_rtas_aabb_exp_t +{ + ze_rtas_float3_exp_t lower; ///< [in] lower bounds of AABB + ze_rtas_float3_exp_t upper; ///< [in] upper bounds of AABB + +} ze_rtas_aabb_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Triangle represented using 3 vertex indices +/// +/// @details +/// - Represents a triangle using 3 vertex indices that index into a vertex +/// array that needs to be provided together with the index array. +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_triangle_indices_uint32_exp_t +{ + uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex + ///< array + uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array + +} ze_rtas_triangle_indices_uint32_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Quad represented using 4 vertex indices +/// +/// @details +/// - Represents a quad composed of 4 indices that index into a vertex array +/// that needs to be provided together with the index array. +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_quad_indices_uint32_exp_t +{ + uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array + uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array + uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array + +} ze_rtas_quad_indices_uint32_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry info +typedef struct _ze_rtas_builder_geometry_info_exp_t +{ + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type + +} ze_rtas_builder_geometry_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder triangle mesh geometry info +/// +/// @details +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_builder_triangles_geometry_info_exp_t +{ + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES + ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_exp_t triangleFormat; ///< [in] format of triangle buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + uint32_t triangleCount; ///< [in] number of triangles in triangle buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format + +} ze_rtas_builder_triangles_geometry_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder quad mesh geometry info +/// +/// @details +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_builder_quads_geometry_info_exp_t +{ + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS + ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_exp_t quadFormat; ///< [in] format of quad buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 + uint32_t quadCount; ///< [in] number of quads in quad buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format + +} ze_rtas_builder_quads_geometry_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief AABB callback function parameters +typedef struct _ze_rtas_geometry_aabbs_exp_cb_params_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t primID; ///< [in] first primitive to return bounds for + uint32_t primIDCount; ///< [in] number of primitives to return bounds for + void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor + void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExp function + ze_rtas_aabb_exp_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to + +} ze_rtas_geometry_aabbs_exp_cb_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function pointer type to return AABBs for a range of +/// procedural primitives +typedef void (*ze_rtas_geometry_aabbs_cb_exp_t)( + ze_rtas_geometry_aabbs_exp_cb_params_t* params ///< [in] callback function parameters structure + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder procedural primitives +/// geometry info +/// +/// @details +/// - A host-side bounds callback function is invoked by the acceleration +/// structure builder to query the bounds of procedural primitives on +/// demand. The callback is passed some `pGeomUserPtr` that can point to +/// an application-side representation of the procedural primitives. +/// Further, a second `pBuildUserPtr`, which is set by a parameter to +/// ::zeRTASBuilderBuildExp, is passed to the callback. This allows the +/// build to change the bounds of the procedural geometry, for example, to +/// build a BVH only over a short time range to implement multi-segment +/// motion blur. +typedef struct _ze_rtas_builder_procedural_geometry_info_exp_t +{ + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL + ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + uint8_t reserved; ///< [in] reserved for future use + uint32_t primCount; ///< [in] number of primitives in geometry + ze_rtas_geometry_aabbs_cb_exp_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box + ///< for a range of primitives + void* pGeomUserPtr; ///< [in] user data pointer passed to callback + +} ze_rtas_builder_procedural_geometry_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance geometry info +typedef struct _ze_rtas_builder_instance_geometry_info_exp_t +{ + ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE + ze_rtas_builder_packed_instance_exp_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_exp_t transformFormat; ///< [in] format of the specified transformation + uint32_t instanceUserID; ///< [in] user-specified identifier for the instance + void* pTransform; ///< [in] object-to-world instance transformation in specified format + ze_rtas_aabb_exp_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced + ///< acceleration structure + void* pAccelerationStructure; ///< [in] pointer to acceleration structure to instantiate + +} ze_rtas_builder_instance_geometry_info_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief +typedef struct _ze_rtas_builder_build_op_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_format_exp_t rtasFormat; ///< [in] ray tracing acceleration structure format + ze_rtas_builder_build_quality_hint_exp_t buildQuality; ///< [in] acceleration structure build quality hint + ze_rtas_builder_build_op_exp_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_exp_flag_t + ///< flags + const ze_rtas_builder_geometry_info_exp_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of + ///< pointers to geometry infos + uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when + ///< `ppGeometries` is NULL + +} ze_rtas_builder_build_op_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a ray tracing acceleration structure builder object +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves ray tracing acceleration structure builder properties +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderGetBuildPropertiesExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Checks ray tracing acceleration structure format compatibility +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDriverRTASFormatCompatibilityCheckExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A + ze_rtas_format_exp_t rtasFormatB ///< [in] operand B + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Build ray tracing acceleration structure +/// +/// @details +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - It is the user's responsibility to manage the acceleration structure +/// buffer allocation, de-allocation, and potential prefetching to the +/// device memory. The required size of the acceleration structure buffer +/// can be queried with the ::zeRTASBuilderGetBuildPropertiesExp function. +/// The acceleration structure buffer must be a shared USM allocation and +/// should be present on the host at build time. The referenced scene data +/// (index- and vertex- buffers) can be standard host allocations, and +/// will not be referenced into by the build acceleration structure. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes based on a query for the estimated size properties. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. +/// - When using the "expected" size for the acceleration structure buffer, +/// the acceleration structure construction may fail with +/// ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. If this happens, the user may resize +/// their acceleration structure buffer using the returned +/// `*pRtasBufferSizeBytes` value, which will be updated with an improved +/// size estimate that will likely result in a successful build. +/// - The acceleration structure construction is run on the host and is +/// synchronous, thus after the function returns with a successful result, +/// the acceleration structure may be used. +/// - All provided data buffers must be host-accessible. +/// - The acceleration structure buffer must be a USM allocation. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - Acceleration structure construction may be parallelized by passing a +/// valid handle to a parallel operation object and joining that parallel +/// operation using ::zeRTASParallelOperationJoinExp with user-provided +/// worker threads. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXP_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderBuildExp( + ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a ray tracing acceleration structure builder object +/// +/// @details +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. +/// - The application must **not** call this function from simultaneous +/// threads with the same builder handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderDestroyExp( + ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_RTAS_BUILDER_EXP_NAME extension. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationCreateExp( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_exp_handle_t* phParallelOperation ///< [out] handle of parallel operation object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties +/// +/// @details +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExp with **hParallelOperation** before calling +/// this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationGetPropertiesExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_exp_properties_t* pProperties ///< [in,out] query result for parallel operation properties + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Joins a parallel build operation +/// +/// @details +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationJoinExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @details +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. +/// - The application must **not** call this function from simultaneous +/// threads with the same parallel operation handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationDestroyExp( + ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Counter-based Event Pools. @deprecated since 1.15 +#if !defined(__GNUC__) +#pragma region counterbasedeventpool +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME +/// @brief Counter-based Event Pools Extension Name +#define ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME "ZE_experimental_event_pool_counter_based" +#endif // ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Counter-based Event Pools Extension Version(s) +typedef enum _ze_event_pool_counter_based_exp_version_t { - uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array - uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array - uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array - uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array + ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_* ENUMs -} ze_rtas_quad_indices_uint32_exp_t; +} ze_event_pool_counter_based_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder geometry info -typedef struct _ze_rtas_builder_geometry_info_exp_t +/// @brief Supported event flags for defining counter-based event pools. +typedef uint32_t ze_event_pool_counter_based_exp_flags_t; +typedef enum _ze_event_pool_counter_based_exp_flag_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type + ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_IMMEDIATE = ZE_BIT(0), ///< Counter-based event pool is used for immediate command lists (default) + ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE = ZE_BIT(1), ///< Counter-based event pool is for non-immediate command lists + ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_* ENUMs -} ze_rtas_builder_geometry_info_exp_t; +} ze_event_pool_counter_based_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder triangle mesh geometry info -/// -/// @details -/// - The linear barycentric u/v parametrization of the triangle is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, and -/// - (u=0, v=1) at v2 -typedef struct _ze_rtas_builder_triangles_geometry_info_exp_t +/// @brief Event pool descriptor for counter-based events. This structure may be +/// passed to ::zeEventPoolCreate as pNext member of +/// ::ze_event_pool_desc_t. @deprecated since 1.15 +typedef struct _ze_event_pool_counter_based_exp_desc_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES - ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_exp_t triangleFormat; ///< [in] format of triangle buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 - ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 - uint32_t triangleCount; ///< [in] number of triangles in triangle buffer - uint32_t vertexCount; ///< [in] number of vertices in vertex buffer - uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer - uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer - void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format - void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_event_pool_counter_based_exp_flags_t flags; ///< [in] mode flags. + ///< must be 0 (default) or a valid value of ::ze_event_pool_counter_based_exp_flag_t + ///< default behavior is counter-based event pool is only used for + ///< immediate command lists. -} ze_rtas_builder_triangles_geometry_info_exp_t; +} ze_event_pool_counter_based_exp_desc_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting bindless images. +#if !defined(__GNUC__) +#pragma region bindlessimages +#endif /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder quad mesh geometry info -/// -/// @details -/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, -/// v2, v3. -/// The first triangle is made out of indices v0, v1, v3 and the second triangle -/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization -/// of the quad is defined as: -/// - (u=0, v=0) at v0, -/// - (u=1, v=0) at v1, -/// - (u=0, v=1) at v3, and -/// - (u=1, v=1) at v2 -/// This is achieved by correcting the u'/v' coordinates of the second -/// triangle by -/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. -typedef struct _ze_rtas_builder_quads_geometry_info_exp_t +#ifndef ZE_BINDLESS_IMAGE_EXP_NAME +/// @brief Image Memory Properties Extension Name +#define ZE_BINDLESS_IMAGE_EXP_NAME "ZE_experimental_bindless_image" +#endif // ZE_BINDLESS_IMAGE_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Bindless Image Extension Version(s) +typedef enum _ze_bindless_image_exp_version_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS - ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_exp_t quadFormat; ///< [in] format of quad buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 - ze_rtas_builder_packed_input_data_format_exp_t vertexFormat; ///< [in] format of vertex buffer data, must be - ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 - uint32_t quadCount; ///< [in] number of quads in quad buffer - uint32_t vertexCount; ///< [in] number of vertices in vertex buffer - uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer - uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer - void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format - void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format + ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_BINDLESS_IMAGE_EXP_VERSION_* ENUMs -} ze_rtas_builder_quads_geometry_info_exp_t; +} ze_bindless_image_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief AABB callback function parameters -typedef struct _ze_rtas_geometry_aabbs_exp_cb_params_t +/// @brief Image flags for Bindless images +typedef uint32_t ze_image_bindless_exp_flags_t; +typedef enum _ze_image_bindless_exp_flag_t { - ze_structure_type_t stype; ///< [in] type of this structure - void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint32_t primID; ///< [in] first primitive to return bounds for - uint32_t primIDCount; ///< [in] number of primitives to return bounds for - void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor - void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExp function - ze_rtas_aabb_exp_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to + ZE_IMAGE_BINDLESS_EXP_FLAG_BINDLESS = ZE_BIT(0), ///< Bindless images are created with ::zeImageCreate. The image handle + ///< created with this flag is valid on both host and device. + ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE = ZE_BIT(1), ///< Bindless sampled images are created with ::zeImageCreate by combining + ///< BINDLESS and SAMPLED_IMAGE. + ///< Create sampled image view from bindless unsampled image using SAMPLED_IMAGE. + ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMAGE_BINDLESS_EXP_FLAG_* ENUMs -} ze_rtas_geometry_aabbs_exp_cb_params_t; +} ze_image_bindless_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function pointer type to return AABBs for a range of -/// procedural primitives -typedef void (*ze_rtas_geometry_aabbs_cb_exp_t)( - ze_rtas_geometry_aabbs_exp_cb_params_t* params ///< [in] callback function parameters structure - ); +/// @brief Image descriptor for bindless images. This structure may be passed to +/// ::zeImageCreate via pNext member of ::ze_image_desc_t. +typedef struct _ze_image_bindless_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_image_bindless_exp_flags_t flags; ///< [in] image flags. + ///< must be 0 (default) or a valid value of ::ze_image_bindless_exp_flag_t + ///< default behavior is bindless images are not used when creating handles + ///< via ::zeImageCreate. + ///< When the flag is passed to ::zeImageCreate, then only the memory for + ///< the image is allocated. + ///< Additional image handles can be created with ::zeImageViewCreateExt. + ///< When ::ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE flag is passed, + ///< ::ze_sampler_desc_t must be attached via pNext member of ::ze_image_bindless_exp_desc_t. + +} ze_image_bindless_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder procedural primitives -/// geometry info -/// -/// @details -/// - A host-side bounds callback function is invoked by the acceleration -/// structure builder to query the bounds of procedural primitives on -/// demand. The callback is passed some `pGeomUserPtr` that can point to -/// an application-side representation of the procedural primitives. -/// Further, a second `pBuildUserPtr`, which is set by a parameter to -/// ::zeRTASBuilderBuildExp, is passed to the callback. This allows the -/// build to change the bounds of the procedural geometry, for example, to -/// build a BVH only over a short time range to implement multi-segment -/// motion blur. -typedef struct _ze_rtas_builder_procedural_geometry_info_exp_t +/// @brief Image descriptor for bindless images created from pitched allocations. +/// This structure may be passed to ::zeImageCreate via pNext member of +/// ::ze_image_desc_t. +typedef struct _ze_image_pitched_exp_desc_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL - ze_rtas_builder_packed_geometry_exp_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - uint8_t reserved; ///< [in] reserved for future use - uint32_t primCount; ///< [in] number of primitives in geometry - ze_rtas_geometry_aabbs_cb_exp_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box - ///< for a range of primitives - void* pGeomUserPtr; ///< [in] user data pointer passed to callback + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + void* ptr; ///< [in] pointer to pitched device allocation allocated using ::zeMemAllocDevice -} ze_rtas_builder_procedural_geometry_info_exp_t; +} ze_image_pitched_exp_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Ray tracing acceleration structure builder instance geometry info -typedef struct _ze_rtas_builder_instance_geometry_info_exp_t +/// @brief Device specific properties for pitched allocations +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetImageProperties via the +/// pNext member of ::ze_device_image_properties_t. +typedef struct _ze_device_pitched_alloc_exp_properties_t { - ze_rtas_builder_packed_geometry_type_exp_t geometryType; ///< [in] geometry type, must be - ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE - ze_rtas_builder_packed_instance_exp_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_exp_flag_t - ///< bits representing the geometry flags for all primitives of this - ///< geometry - uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking - ze_rtas_builder_packed_input_data_format_exp_t transformFormat; ///< [in] format of the specified transformation - uint32_t instanceUserID; ///< [in] user-specified identifier for the instance - void* pTransform; ///< [in] object-to-world instance transformation in specified format - ze_rtas_aabb_exp_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced - ///< acceleration structure - void* pAccelerationStructure; ///< [in] pointer to acceleration structure to instantiate + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + size_t maxImageLinearWidth; ///< [out] Maximum image linear width. + size_t maxImageLinearHeight; ///< [out] Maximum image linear height. -} ze_rtas_builder_instance_geometry_info_exp_t; +} ze_device_pitched_alloc_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief -typedef struct _ze_rtas_builder_build_op_exp_desc_t +/// @brief Pitch information for 2-dimensional linear pitched allocations +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetImageProperties in +/// conjunction with the ::ze_device_pitched_alloc_exp_properties_t via +/// its pNext member +typedef struct _ze_pitched_alloc_2dimage_linear_pitch_exp_info_t { ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - ze_rtas_format_exp_t rtasFormat; ///< [in] ray tracing acceleration structure format - ze_rtas_builder_build_quality_hint_exp_t buildQuality; ///< [in] acceleration structure build quality hint - ze_rtas_builder_build_op_exp_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_exp_flag_t - ///< flags - const ze_rtas_builder_geometry_info_exp_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of - ///< pointers to geometry infos - uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when - ///< `ppGeometries` is NULL + size_t pitchAlign; ///< [out] Required pitch Aligment in Bytes. + size_t maxSupportedPitch; ///< [out] Maximum allowed pitch in Bytes. -} ze_rtas_builder_build_op_exp_desc_t; +} ze_pitched_alloc_2dimage_linear_pitch_exp_info_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder object +/// @brief Retrieves pitch information that can be used to allocate USM memory +/// for a given image. /// /// @details -/// - The application may call this function from simultaneous threads. +/// - Retrieves pitch for 2D image given the width, height and size in bytes +/// - The memory is then allocated using ::zeMemAllocDevice by providing +/// input size calculated as the returned pitch value multiplied by image height +/// - The application may call this function from simultaneous threads +/// - The implementation of this function must be thread-safe. +/// - The implementation of this function should be lock-free. +/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME extension. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeMemGetPitchFor2dImage( + ze_context_handle_t hContext, ///< [in] handle of the context object + ze_device_handle_t hDevice, ///< [in] handle of the device + size_t imageWidth, ///< [in] imageWidth + size_t imageHeight, ///< [in] imageHeight + unsigned int elementSizeInBytes, ///< [in] Element size in bytes + size_t * rowPitch ///< [out] rowPitch + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get bindless device offset for image +/// +/// @details +/// - The application may call this function from simultaneous threads /// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_experimental_rtas_builder +/// - The implementation of this function should be lock-free. +/// - The implementation must support ::ZE_BINDLESS_IMAGE_EXP_NAME /// extension. /// /// @returns @@ -9813,24 +14940,80 @@ typedef struct _ze_rtas_builder_build_op_exp_desc_t /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hImage` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pDescriptor` -/// + `nullptr == phBuilder` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_BUILDER_EXP_VERSION_CURRENT < pDescriptor->builderVersion` +/// + `nullptr == pDeviceOffset` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - const ze_rtas_builder_exp_desc_t* pDescriptor, ///< [in] pointer to builder descriptor - ze_rtas_builder_exp_handle_t* phBuilder ///< [out] handle of builder object +zeImageGetDeviceOffsetExp( + ze_image_handle_t hImage, ///< [in] handle of the image + uint64_t* pDeviceOffset ///< [out] bindless device offset for image ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder properties +/// @brief Specify user defined pitch for pitched linear image allocations. This +/// structure may be passed to ::zeImageCreate in conjunction with +/// ::ze_image_pitched_exp_desc_t via its pNext member +typedef struct _ze_custom_pitch_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + size_t rowPitch; ///< [in] user programmed aligned pitch for pitched linear image + ///< allocations. This pitch should satisfy the pitchAlign requirement in + ///< ::ze_pitched_alloc_2dimage_linear_pitch_exp_info_t + size_t slicePitch; ///< [in] user programmed slice pitch , must be multiple of rowPitch. For + ///< 2D image arrary or a slice of a 3D image array - this pitch should be + ///< >= rowPitch * image_height . For 1D iamge array >= rowPitch. + +} ze_custom_pitch_exp_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs. +#if !defined(__GNUC__) +#pragma region commandListClone +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_COMMAND_LIST_CLONE_EXP_NAME +/// @brief Command List Clone Extension Name +#define ZE_COMMAND_LIST_CLONE_EXP_NAME "ZE_experimental_command_list_clone" +#endif // ZE_COMMAND_LIST_CLONE_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Command List Clone Extension Version(s) +typedef enum _ze_command_list_clone_exp_version_t +{ + ZE_COMMAND_LIST_CLONE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_COMMAND_LIST_CLONE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_COMMAND_LIST_CLONE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_LIST_CLONE_EXP_VERSION_* ENUMs + +} ze_command_list_clone_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a command list as the clone of another command list. /// /// @details +/// - The source command list must be created with the +/// ::ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE flag. +/// - The source command list must be closed prior to cloning. +/// - The source command list may be cloned while it is running on the +/// device. +/// - The cloned command list inherits all properties of the source command +/// list. +/// - The cloned command list must be destroyed prior to the source command +/// list. +/// - The application must only use the command list for the device, or its +/// sub-devices, which was provided during creation. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -9840,28 +15023,58 @@ zeRTASBuilderCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pProperties` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// + `nullptr == phClonedCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderGetBuildPropertiesExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - ze_rtas_builder_exp_properties_t* pProperties ///< [in,out] query result for builder properties +zeCommandListCreateCloneExp( + ze_command_list_handle_t hCommandList, ///< [in] handle to source command list (the command list to clone) + ze_command_list_handle_t* phClonedCommandList ///< [out] pointer to handle of the cloned command list ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs. +#if !defined(__GNUC__) +#pragma region immediateCommandListAppend +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME +/// @brief Immediate Command List Append Extension Name +#define ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME "ZE_experimental_immediate_command_list_append" +#endif // ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Immediate Command List Append Extension Version(s) +typedef enum _ze_immediate_command_list_append_exp_version_t +{ + ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_* ENUMs + +} ze_immediate_command_list_append_exp_version_t; + /////////////////////////////////////////////////////////////////////////////// -/// @brief Checks ray tracing acceleration structure format compatibility +/// @brief Appends command lists to dispatch from an immediate command list. /// /// @details +/// - The application must call this function only with command lists +/// created with ::zeCommandListCreateImmediate. +/// - The command lists passed to this function in the `phCommandLists` +/// argument must be regular command lists (i.e. not immediate command +/// lists). /// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9869,71 +15082,212 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` -/// - ::ZE_RESULT_SUCCESS -/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. -/// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE -/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +/// + `nullptr == hCommandListImmediate` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phCommandLists` ZE_APIEXPORT ze_result_t ZE_APICALL -zeDriverRTASFormatCompatibilityCheckExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_format_exp_t rtasFormatA, ///< [in] operand A - ze_rtas_format_exp_t rtasFormatB ///< [in] operand B +zeCommandListImmediateAppendCommandListsExp( + ze_command_list_handle_t hCommandListImmediate, ///< [in] handle of the immediate command list + uint32_t numCommandLists, ///< [in] number of command lists + ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] handles of command lists + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + ///< - if not null, this event is signaled after the completion of all + ///< appended command lists + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing appended + ///< command lists; must be 0 if nullptr == phWaitEvents + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before executing appended command lists. + ///< - if not null, all wait events must be satisfied prior to the start + ///< of any appended command list(s) ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting compute graphs with dynamic properties. +#if !defined(__GNUC__) +#pragma region mutableCommandList +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_MUTABLE_COMMAND_LIST_EXP_NAME +/// @brief Mutable Command List Extension Name +#define ZE_MUTABLE_COMMAND_LIST_EXP_NAME "ZE_experimental_mutable_command_list" +#endif // ZE_MUTABLE_COMMAND_LIST_EXP_NAME + /////////////////////////////////////////////////////////////////////////////// -/// @brief Build ray tracing acceleration structure +/// @brief Mutable Command List Extension Version(s) +typedef enum _ze_mutable_command_list_exp_version_t +{ + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_* ENUMs + +} ze_mutable_command_list_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable command flags +typedef uint32_t ze_mutable_command_exp_flags_t; +typedef enum _ze_mutable_command_exp_flag_t +{ + ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_ARGUMENTS = ZE_BIT(0), ///< kernel arguments + ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_COUNT = ZE_BIT(1), ///< kernel group count + ZE_MUTABLE_COMMAND_EXP_FLAG_GROUP_SIZE = ZE_BIT(2), ///< kernel group size + ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET = ZE_BIT(3), ///< kernel global offset + ZE_MUTABLE_COMMAND_EXP_FLAG_SIGNAL_EVENT = ZE_BIT(4), ///< command signal event + ZE_MUTABLE_COMMAND_EXP_FLAG_WAIT_EVENTS = ZE_BIT(5), ///< command wait events + ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION = ZE_BIT(6), ///< command kernel + ZE_MUTABLE_COMMAND_EXP_FLAG_GRAPH_ARGUMENTS = ZE_BIT(7), ///< graph arguments + ZE_MUTABLE_COMMAND_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_EXP_FLAG_* ENUMs + +} ze_mutable_command_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable command identifier descriptor +typedef struct _ze_mutable_command_id_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_mutable_command_exp_flags_t flags; ///< [in] mutable command flags. + ///< - must be 0 (default, equivalent to setting all flags bar kernel + ///< instruction), or a valid combination of ::ze_mutable_command_exp_flag_t + ///< - in order to include kernel instruction mutation, + ///< ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included + +} ze_mutable_command_id_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable command list flags +typedef uint32_t ze_mutable_command_list_exp_flags_t; +typedef enum _ze_mutable_command_list_exp_flag_t +{ + ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved + ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_* ENUMs + +} ze_mutable_command_list_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable command list properties +typedef struct _ze_mutable_command_list_exp_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_mutable_command_list_exp_flags_t mutableCommandListFlags; ///< [out] mutable command list flags + ze_mutable_command_exp_flags_t mutableCommandFlags; ///< [out] mutable command flags + +} ze_mutable_command_list_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable command list descriptor +typedef struct _ze_mutable_command_list_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_mutable_command_list_exp_flags_t flags; ///< [in] mutable command list flags. + ///< - must be 0 (default) or a valid combination of ::ze_mutable_command_list_exp_flag_t + +} ze_mutable_command_list_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable commands descriptor +typedef struct _ze_mutable_commands_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t flags; ///< [in] must be 0, this field is reserved for future use + +} ze_mutable_commands_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable kernel argument descriptor +typedef struct _ze_mutable_kernel_argument_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t commandId; ///< [in] command identifier + uint32_t argIndex; ///< [in] kernel argument index + size_t argSize; ///< [in] kernel argument size + const void* pArgValue; ///< [in] pointer to kernel argument value + +} ze_mutable_kernel_argument_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable kernel group count descriptor +typedef struct _ze_mutable_group_count_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t commandId; ///< [in] command identifier + const ze_group_count_t* pGroupCount; ///< [in] pointer to group count + +} ze_mutable_group_count_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable kernel group size descriptor +typedef struct _ze_mutable_group_size_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t commandId; ///< [in] command identifier + uint32_t groupSizeX; ///< [in] group size for X dimension to use for the kernel + uint32_t groupSizeY; ///< [in] group size for Y dimension to use for the kernel + uint32_t groupSizeZ; ///< [in] group size for Z dimension to use for the kernel + +} ze_mutable_group_size_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable kernel global offset descriptor +typedef struct _ze_mutable_global_offset_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t commandId; ///< [in] command identifier + uint32_t offsetX; ///< [in] global offset for X dimension to use for this kernel + uint32_t offsetY; ///< [in] global offset for Y dimension to use for this kernel + uint32_t offsetZ; ///< [in] global offset for Z dimension to use for this kernel + +} ze_mutable_global_offset_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable graph argument descriptor +typedef struct _ze_mutable_graph_argument_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t commandId; ///< [in] command identifier + uint32_t argIndex; ///< [in] graph argument index + const void* pArgValue; ///< [in] pointer to graph argument value + +} ze_mutable_graph_argument_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns a unique command identifier for the next command to be +/// appended to a command list. /// /// @details -/// - This function builds an acceleration structure of the scene consisting -/// of the specified geometry information and writes the acceleration -/// structure to the provided destination buffer. All types of geometries -/// can get freely mixed inside a scene. -/// - It is the user's responsibility to manage the acceleration structure -/// buffer allocation, de-allocation, and potential prefetching to the -/// device memory. The required size of the acceleration structure buffer -/// can be queried with the ::zeRTASBuilderGetBuildPropertiesExp function. -/// The acceleration structure buffer must be a shared USM allocation and -/// should be present on the host at build time. The referenced scene data -/// (index- and vertex- buffers) can be standard host allocations, and -/// will not be referenced into by the build acceleration structure. -/// - Before an acceleration structure can be built, the user must allocate -/// the memory for the acceleration structure buffer and scratch buffer -/// using sizes based on a query for the estimated size properties. -/// - When using the "worst-case" size for the acceleration structure -/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. -/// - When using the "expected" size for the acceleration structure buffer, -/// the acceleration structure construction may fail with -/// ::ZE_RESULT_EXP_RTAS_BUILD_RETRY. If this happens, the user may resize -/// their acceleration structure buffer using the returned -/// `*pRtasBufferSizeBytes` value, which will be updated with an improved -/// size estimate that will likely result in a successful build. -/// - The acceleration structure construction is run on the host and is -/// synchronous, thus after the function returns with a successful result, -/// the acceleration structure may be used. -/// - All provided data buffers must be host-accessible. -/// - The acceleration structure buffer must be a USM allocation. -/// - A successfully constructed acceleration structure is entirely -/// self-contained. There is no requirement for input data to persist -/// beyond build completion. -/// - A successfully constructed acceleration structure is non-copyable. -/// - Acceleration structure construction may be parallelized by passing a -/// valid handle to a parallel operation object and joining that parallel -/// operation using ::zeRTASParallelOperationJoinExp with user-provided -/// worker threads. -/// - **Additional Notes** -/// - "The geometry infos array, geometry infos, and scratch buffer must -/// all be standard host memory allocations." -/// - "A pointer to a geometry info can be a null pointer, in which case -/// the geometry is treated as empty." -/// - "If no parallel operation handle is provided, the build is run -/// sequentially on the current thread." -/// - "A parallel operation object may only be associated with a single -/// acceleration structure build at a time." +/// - This function may only be called for a mutable command list. +/// - This function may not be called on a closed command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9941,48 +15295,41 @@ zeDriverRTASFormatCompatibilityCheckExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pBuildOpDescriptor` -/// + `nullptr == pScratchBuffer` -/// + `nullptr == pRtasBuffer` +/// + `nullptr == desc` +/// + `nullptr == pCommandId` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` -/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` -/// + `0x3 < pBuildOpDescriptor->buildFlags` -/// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED -/// + Acceleration structure build completion is deferred to parallel operation join. -/// - ::ZE_RESULT_EXP_RTAS_BUILD_RETRY -/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE -/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +/// + `0xff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderBuildExp( - ze_rtas_builder_exp_handle_t hBuilder, ///< [in] handle of builder object - const ze_rtas_builder_build_op_exp_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor - void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used - ///< during acceleration structure construction - size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes - void* pRtasBuffer, ///< [in] pointer to destination buffer - size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object - void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks - ze_rtas_aabb_exp_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration - ///< structure bounds - size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in - ///< bytes +zeCommandListGetNextCommandIdExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in] pointer to mutable command identifier descriptor + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder object +/// @brief Returns a unique command identifier for the next command to be +/// appended to a command list. Provides possible kernel handles for +/// kernel mutation when ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION +/// flag is present. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this builder. -/// - The application must **not** call this function from simultaneous -/// threads with the same builder handle. -/// - The implementation of this function must be thread-safe. +/// - This function may only be called for a mutable command list. +/// - This function may not be called on a closed command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9990,23 +15337,45 @@ zeRTASBuilderBuildExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hBuilder` -/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == pCommandId` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0xff < desc->flags` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASBuilderDestroyExp( - ze_rtas_builder_exp_handle_t hBuilder ///< [in][release] handle of builder object to destroy +zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Creates a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Updates mutable commands. /// /// @details -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. -/// - The implementation must support ::ZE_experimental_rtas_builder -/// extension. +/// - This function may only be called for a mutable command list. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10014,28 +15383,41 @@ zeRTASBuilderDestroyExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDriver` +/// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == phParallelOperation` +/// + `nullptr == desc` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Invalid kernel argument or not matching update descriptor provided ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationCreateExp( - ze_driver_handle_t hDriver, ///< [in] handle of driver object - ze_rtas_parallel_operation_exp_handle_t* phParallelOperation ///< [out] handle of parallel operation object +zeCommandListUpdateMutableCommandsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_commands_exp_desc_t* desc ///< [in] pointer to mutable commands descriptor; multiple descriptors may + ///< be chained via `pNext` member ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieves ray tracing acceleration structure builder parallel -/// operation properties +/// @brief Updates the signal event for a mutable command in a mutable command +/// list. /// /// @details -/// - The application must first bind the parallel operation object to a -/// build operation before it may query the parallel operation properties. -/// In other words, the application must first call -/// ::zeRTASBuilderBuildExp with **hParallelOperation** before calling -/// this function. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function must be thread-safe. +/// - This function may only be called for a mutable command list. +/// - The type, scope and flags of the signal event must match those of the +/// source command. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10043,22 +15425,43 @@ zeRTASParallelOperationCreateExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pProperties` +/// + `nullptr == hCommandList` ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationGetPropertiesExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ///< [in] handle of parallel operation object - ze_rtas_parallel_operation_exp_properties_t* pProperties ///< [in,out] query result for parallel operation properties +zeCommandListUpdateMutableCommandSignalEventExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + ze_event_handle_t hSignalEvent ///< [in][optional] handle of the event to signal on completion ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Joins a parallel build operation +/// @brief Updates the wait events for a mutable command in a mutable command +/// list. /// /// @details -/// - All worker threads return the same error code for the parallel build -/// operation upon build completion +/// - This function may only be called for a mutable command list. +/// - The number of wait events must match that of the source command. +/// - The type, scope and flags of the wait events must match those of the +/// source command. +/// - Passing `nullptr` as the wait events will update the command to not +/// wait on any events prior to dispatch. +/// - Passing `nullptr` as an event on event wait list will remove event +/// dependency from this wait list slot. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10066,24 +15469,42 @@ zeRTASParallelOperationGetPropertiesExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + The `numWaitEvents` parameter does not match that of the original command. ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationJoinExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in] handle of parallel operation object +zeCommandListUpdateMutableCommandWaitEventsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint64_t commandId, ///< [in] command identifier + uint32_t numWaitEvents, ///< [in][optional] the number of wait events + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroys a ray tracing acceleration structure builder parallel -/// operation object +/// @brief Updates the kernel for a mutable command in a mutable command list. /// /// @details -/// - The implementation of this function may immediately release any -/// internal Host and Device resources associated with this parallel -/// operation. -/// - The application must **not** call this function from simultaneous -/// threads with the same parallel operation handle. -/// - The implementation of this function must be thread-safe. +/// - This function may only be called for a mutable command list. +/// - The kernel handle must be from the provided list for given command id. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - This function must be called before updating kernel arguments and +/// dispatch parameters, when kernel is mutated. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -10091,11 +15512,28 @@ zeRTASParallelOperationJoinExp( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hParallelOperation` +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCommandId` +/// + `nullptr == phKernels` +/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE +/// + Invalid kernel handle provided for the mutation kernel instruction operation. ZE_APIEXPORT ze_result_t ZE_APICALL -zeRTASParallelOperationDestroyExp( - ze_rtas_parallel_operation_exp_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy +zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to ); #if !defined(__GNUC__) @@ -11709,10 +17147,252 @@ typedef void (ZE_APICALL *ze_pfnImageDestroyCb_t)( /// @brief Table of Image callback functions pointers typedef struct _ze_image_callbacks_t { - ze_pfnImageGetPropertiesCb_t pfnGetPropertiesCb; - ze_pfnImageCreateCb_t pfnCreateCb; - ze_pfnImageDestroyCb_t pfnDestroyCb; -} ze_image_callbacks_t; + ze_pfnImageGetPropertiesCb_t pfnGetPropertiesCb; + ze_pfnImageCreateCb_t pfnCreateCb; + ze_pfnImageDestroyCb_t pfnDestroyCb; +} ze_image_callbacks_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemAllocShared +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_alloc_shared_params_t +{ + ze_context_handle_t* phContext; + const ze_device_mem_alloc_desc_t** pdevice_desc; + const ze_host_mem_alloc_desc_t** phost_desc; + size_t* psize; + size_t* palignment; + ze_device_handle_t* phDevice; + void*** ppptr; +} ze_mem_alloc_shared_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemAllocShared +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemAllocSharedCb_t)( + ze_mem_alloc_shared_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemAllocDevice +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_alloc_device_params_t +{ + ze_context_handle_t* phContext; + const ze_device_mem_alloc_desc_t** pdevice_desc; + size_t* psize; + size_t* palignment; + ze_device_handle_t* phDevice; + void*** ppptr; +} ze_mem_alloc_device_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemAllocDevice +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemAllocDeviceCb_t)( + ze_mem_alloc_device_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemAllocHost +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_alloc_host_params_t +{ + ze_context_handle_t* phContext; + const ze_host_mem_alloc_desc_t** phost_desc; + size_t* psize; + size_t* palignment; + void*** ppptr; +} ze_mem_alloc_host_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemAllocHost +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemAllocHostCb_t)( + ze_mem_alloc_host_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemFree +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_free_params_t +{ + ze_context_handle_t* phContext; + void** pptr; +} ze_mem_free_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemFree +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemFreeCb_t)( + ze_mem_free_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemGetAllocProperties +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_get_alloc_properties_params_t +{ + ze_context_handle_t* phContext; + const void** pptr; + ze_memory_allocation_properties_t** ppMemAllocProperties; + ze_device_handle_t** pphDevice; +} ze_mem_get_alloc_properties_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemGetAllocProperties +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemGetAllocPropertiesCb_t)( + ze_mem_get_alloc_properties_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemGetAddressRange +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_get_address_range_params_t +{ + ze_context_handle_t* phContext; + const void** pptr; + void*** ppBase; + size_t** ppSize; +} ze_mem_get_address_range_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemGetAddressRange +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemGetAddressRangeCb_t)( + ze_mem_get_address_range_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemGetIpcHandle +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_get_ipc_handle_params_t +{ + ze_context_handle_t* phContext; + const void** pptr; + ze_ipc_mem_handle_t** ppIpcHandle; +} ze_mem_get_ipc_handle_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemGetIpcHandle +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemGetIpcHandleCb_t)( + ze_mem_get_ipc_handle_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemOpenIpcHandle +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_open_ipc_handle_params_t +{ + ze_context_handle_t* phContext; + ze_device_handle_t* phDevice; + ze_ipc_mem_handle_t* phandle; + ze_ipc_memory_flags_t* pflags; + void*** ppptr; +} ze_mem_open_ipc_handle_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemOpenIpcHandle +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemOpenIpcHandleCb_t)( + ze_mem_open_ipc_handle_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeMemCloseIpcHandle +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct _ze_mem_close_ipc_handle_params_t +{ + ze_context_handle_t* phContext; + const void** pptr; +} ze_mem_close_ipc_handle_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeMemCloseIpcHandle +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data +typedef void (ZE_APICALL *ze_pfnMemCloseIpcHandleCb_t)( + ze_mem_close_ipc_handle_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of Mem callback functions pointers +typedef struct _ze_mem_callbacks_t +{ + ze_pfnMemAllocSharedCb_t pfnAllocSharedCb; + ze_pfnMemAllocDeviceCb_t pfnAllocDeviceCb; + ze_pfnMemAllocHostCb_t pfnAllocHostCb; + ze_pfnMemFreeCb_t pfnFreeCb; + ze_pfnMemGetAllocPropertiesCb_t pfnGetAllocPropertiesCb; + ze_pfnMemGetAddressRangeCb_t pfnGetAddressRangeCb; + ze_pfnMemGetIpcHandleCb_t pfnGetIpcHandleCb; + ze_pfnMemOpenIpcHandleCb_t pfnOpenIpcHandleCb; + ze_pfnMemCloseIpcHandleCb_t pfnCloseIpcHandleCb; +} ze_mem_callbacks_t; /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeFenceCreate @@ -12813,248 +18493,6 @@ typedef struct _ze_physical_mem_callbacks_t ze_pfnPhysicalMemDestroyCb_t pfnDestroyCb; } ze_physical_mem_callbacks_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemAllocShared -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_alloc_shared_params_t -{ - ze_context_handle_t* phContext; - const ze_device_mem_alloc_desc_t** pdevice_desc; - const ze_host_mem_alloc_desc_t** phost_desc; - size_t* psize; - size_t* palignment; - ze_device_handle_t* phDevice; - void*** ppptr; -} ze_mem_alloc_shared_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemAllocShared -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemAllocSharedCb_t)( - ze_mem_alloc_shared_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemAllocDevice -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_alloc_device_params_t -{ - ze_context_handle_t* phContext; - const ze_device_mem_alloc_desc_t** pdevice_desc; - size_t* psize; - size_t* palignment; - ze_device_handle_t* phDevice; - void*** ppptr; -} ze_mem_alloc_device_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemAllocDevice -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemAllocDeviceCb_t)( - ze_mem_alloc_device_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemAllocHost -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_alloc_host_params_t -{ - ze_context_handle_t* phContext; - const ze_host_mem_alloc_desc_t** phost_desc; - size_t* psize; - size_t* palignment; - void*** ppptr; -} ze_mem_alloc_host_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemAllocHost -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemAllocHostCb_t)( - ze_mem_alloc_host_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemFree -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_free_params_t -{ - ze_context_handle_t* phContext; - void** pptr; -} ze_mem_free_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemFree -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemFreeCb_t)( - ze_mem_free_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemGetAllocProperties -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_get_alloc_properties_params_t -{ - ze_context_handle_t* phContext; - const void** pptr; - ze_memory_allocation_properties_t** ppMemAllocProperties; - ze_device_handle_t** pphDevice; -} ze_mem_get_alloc_properties_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemGetAllocProperties -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemGetAllocPropertiesCb_t)( - ze_mem_get_alloc_properties_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemGetAddressRange -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_get_address_range_params_t -{ - ze_context_handle_t* phContext; - const void** pptr; - void*** ppBase; - size_t** ppSize; -} ze_mem_get_address_range_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemGetAddressRange -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemGetAddressRangeCb_t)( - ze_mem_get_address_range_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemGetIpcHandle -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_get_ipc_handle_params_t -{ - ze_context_handle_t* phContext; - const void** pptr; - ze_ipc_mem_handle_t** ppIpcHandle; -} ze_mem_get_ipc_handle_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemGetIpcHandle -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemGetIpcHandleCb_t)( - ze_mem_get_ipc_handle_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemOpenIpcHandle -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_open_ipc_handle_params_t -{ - ze_context_handle_t* phContext; - ze_device_handle_t* phDevice; - ze_ipc_mem_handle_t* phandle; - ze_ipc_memory_flags_t* pflags; - void*** ppptr; -} ze_mem_open_ipc_handle_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemOpenIpcHandle -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemOpenIpcHandleCb_t)( - ze_mem_open_ipc_handle_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function parameters for zeMemCloseIpcHandle -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct _ze_mem_close_ipc_handle_params_t -{ - ze_context_handle_t* phContext; - const void** pptr; -} ze_mem_close_ipc_handle_params_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Callback function-pointer for zeMemCloseIpcHandle -/// @param[in] params Parameters passed to this instance -/// @param[in] result Return value -/// @param[in] pTracerUserData Per-Tracer user data -/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data -typedef void (ZE_APICALL *ze_pfnMemCloseIpcHandleCb_t)( - ze_mem_close_ipc_handle_params_t* params, - ze_result_t result, - void* pTracerUserData, - void** ppTracerInstanceUserData - ); - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Table of Mem callback functions pointers -typedef struct _ze_mem_callbacks_t -{ - ze_pfnMemAllocSharedCb_t pfnAllocSharedCb; - ze_pfnMemAllocDeviceCb_t pfnAllocDeviceCb; - ze_pfnMemAllocHostCb_t pfnAllocHostCb; - ze_pfnMemFreeCb_t pfnFreeCb; - ze_pfnMemGetAllocPropertiesCb_t pfnGetAllocPropertiesCb; - ze_pfnMemGetAddressRangeCb_t pfnGetAddressRangeCb; - ze_pfnMemGetIpcHandleCb_t pfnGetIpcHandleCb; - ze_pfnMemOpenIpcHandleCb_t pfnOpenIpcHandleCb; - ze_pfnMemCloseIpcHandleCb_t pfnCloseIpcHandleCb; -} ze_mem_callbacks_t; - /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeVirtualMemReserve /// @details Each entry is a pointer to the parameter passed to the function; @@ -13274,4 +18712,4 @@ typedef struct _ze_callbacks_t } // extern "C" #endif -#endif // _ZE_API_H \ No newline at end of file +#endif // _ZE_API_H diff --git a/kernels/level_zero/ze_wrapper.cpp b/kernels/level_zero/ze_wrapper.cpp index 540eff7209..fb46a5b578 100644 --- a/kernels/level_zero/ze_wrapper.cpp +++ b/kernels/level_zero/ze_wrapper.cpp @@ -35,16 +35,16 @@ static decltype(zeDriverGetExtensionProperties)* zeDriverGetExtensionPropertiesI static decltype(zeDeviceGetProperties)* zeDeviceGetPropertiesInternal = nullptr; static decltype(zeDeviceGetModuleProperties)* zeDeviceGetModulePropertiesInternal = nullptr; -static decltype(zeRTASBuilderCreateExp)* zeRTASBuilderCreateExpInternal = nullptr; -static decltype(zeRTASBuilderDestroyExp)* zeRTASBuilderDestroyExpInternal = nullptr; -static decltype(zeDriverRTASFormatCompatibilityCheckExp)* zeDriverRTASFormatCompatibilityCheckExpInternal = nullptr; -static decltype(zeRTASBuilderGetBuildPropertiesExp)* zeRTASBuilderGetBuildPropertiesExpInternal = nullptr; -static decltype(zeRTASBuilderBuildExp)* zeRTASBuilderBuildExpInternal = nullptr; +static decltype(zeRTASBuilderCreateExt)* zeRTASBuilderCreateExtInternal = nullptr; +static decltype(zeRTASBuilderDestroyExt)* zeRTASBuilderDestroyExtInternal = nullptr; +static decltype(zeDriverRTASFormatCompatibilityCheckExt)* zeDriverRTASFormatCompatibilityCheckExtInternal = nullptr; +static decltype(zeRTASBuilderGetBuildPropertiesExt)* zeRTASBuilderGetBuildPropertiesExtInternal = nullptr; +static decltype(zeRTASBuilderBuildExt)* zeRTASBuilderBuildExtInternal = nullptr; -static decltype(zeRTASParallelOperationCreateExp)* zeRTASParallelOperationCreateExpInternal = nullptr; -static decltype(zeRTASParallelOperationDestroyExp)* zeRTASParallelOperationDestroyExpInternal = nullptr; -static decltype(zeRTASParallelOperationGetPropertiesExp)* zeRTASParallelOperationGetPropertiesExpInternal = nullptr; -static decltype(zeRTASParallelOperationJoinExp)* zeRTASParallelOperationJoinExpInternal = nullptr; +static decltype(zeRTASParallelOperationCreateExt)* zeRTASParallelOperationCreateExtInternal = nullptr; +static decltype(zeRTASParallelOperationDestroyExt)* zeRTASParallelOperationDestroyExtInternal = nullptr; +static decltype(zeRTASParallelOperationGetPropertiesExt)* zeRTASParallelOperationGetPropertiesExtInternal = nullptr; +static decltype(zeRTASParallelOperationJoinExt)* zeRTASParallelOperationJoinExtInternal = nullptr; template T find_symbol(void* handle, std::string const& symbol) { @@ -94,31 +94,31 @@ ze_result_t selectLevelZeroRTASBuilder(ze_driver_handle_t hDriver) if (ZeWrapper::rtas_builder_selected) return ZE_RESULT_SUCCESS; - auto zeRTASBuilderCreateExpTemp = find_symbol(handle,"zeRTASBuilderCreateExp"); - auto zeRTASBuilderDestroyExpTemp = find_symbol(handle,"zeRTASBuilderDestroyExp"); + auto zeRTASBuilderCreateExtTemp = find_symbol(handle,"zeRTASBuilderCreateExt"); + auto zeRTASBuilderDestroyExtTemp = find_symbol(handle,"zeRTASBuilderDestroyExt"); - ze_rtas_builder_exp_desc_t builderDesc = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXP_DESC }; - ze_rtas_builder_exp_handle_t hBuilder = nullptr; - ze_result_t err = zeRTASBuilderCreateExpTemp(hDriver, &builderDesc, &hBuilder); + ze_rtas_builder_ext_desc_t builderDesc = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC, nullptr, ZE_RTAS_BUILDER_EXT_VERSION_CURRENT }; + ze_rtas_builder_ext_handle_t hBuilder = nullptr; + ze_result_t err = zeRTASBuilderCreateExtTemp(hDriver, &builderDesc, &hBuilder); /* when ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE is reported extension cannot get loaded */ if (err == ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE) return err; if (err == ZE_RESULT_SUCCESS) - zeRTASBuilderDestroyExpTemp(hBuilder); + zeRTASBuilderDestroyExtTemp(hBuilder); - zeRTASBuilderCreateExpInternal = zeRTASBuilderCreateExpTemp; - zeRTASBuilderDestroyExpInternal = zeRTASBuilderDestroyExpTemp; + zeRTASBuilderCreateExtInternal = zeRTASBuilderCreateExtTemp; + zeRTASBuilderDestroyExtInternal = zeRTASBuilderDestroyExtTemp; - zeDriverRTASFormatCompatibilityCheckExpInternal = find_symbol(handle,"zeDriverRTASFormatCompatibilityCheckExp"); - zeRTASBuilderGetBuildPropertiesExpInternal = find_symbol(handle,"zeRTASBuilderGetBuildPropertiesExp"); - zeRTASBuilderBuildExpInternal = find_symbol(handle,"zeRTASBuilderBuildExp"); + zeDriverRTASFormatCompatibilityCheckExtInternal = find_symbol(handle,"zeDriverRTASFormatCompatibilityCheckExt"); + zeRTASBuilderGetBuildPropertiesExtInternal = find_symbol(handle,"zeRTASBuilderGetBuildPropertiesExt"); + zeRTASBuilderBuildExtInternal = find_symbol(handle,"zeRTASBuilderBuildExt"); - zeRTASParallelOperationCreateExpInternal = find_symbol(handle,"zeRTASParallelOperationCreateExp"); - zeRTASParallelOperationDestroyExpInternal = find_symbol(handle,"zeRTASParallelOperationDestroyExp"); - zeRTASParallelOperationGetPropertiesExpInternal = find_symbol(handle,"zeRTASParallelOperationGetPropertiesExp"); - zeRTASParallelOperationJoinExpInternal = find_symbol(handle,"zeRTASParallelOperationJoinExp"); + zeRTASParallelOperationCreateExtInternal = find_symbol(handle,"zeRTASParallelOperationCreateExt"); + zeRTASParallelOperationDestroyExtInternal = find_symbol(handle,"zeRTASParallelOperationDestroyExt"); + zeRTASParallelOperationGetPropertiesExtInternal = find_symbol(handle,"zeRTASParallelOperationGetPropertiesExt"); + zeRTASParallelOperationJoinExtInternal = find_symbol(handle,"zeRTASParallelOperationJoinExt"); ZeWrapper::rtas_builder_selected = true; return ZE_RESULT_SUCCESS; @@ -214,12 +214,12 @@ ze_result_t validate(ze_device_handle_t hDevice) return ZE_RESULT_SUCCESS; } -ze_result_t validate(ze_rtas_device_exp_properties_t* pProperties) -{ +ze_result_t validate(ze_rtas_device_ext_properties_t* pProperties) +{ if (pProperties == nullptr) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (pProperties->stype != ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXP_PROPERTIES) + if (pProperties->stype != ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES) return ZE_RESULT_ERROR_INVALID_ENUMERATION; //if (!checkDescChain((zet_base_desc_t_*)pProperties)) @@ -244,84 +244,84 @@ ze_result_t ZeWrapper::zeDeviceGetModuleProperties(ze_device_handle_t ze_handle, return zeDeviceGetModulePropertiesInternal(ze_handle, props); } -ze_result_t ZeWrapper::zeRTASBuilderCreateExp(ze_driver_handle_t hDriver, const ze_rtas_builder_exp_desc_t *pDescriptor, ze_rtas_builder_exp_handle_t *phBuilder) +ze_result_t ZeWrapper::zeRTASBuilderCreateExt(ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t *pDescriptor, ze_rtas_builder_ext_handle_t *phBuilder) { - if (!handle || !zeRTASBuilderCreateExpInternal) + if (!handle || !zeRTASBuilderCreateExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASBuilderCreateExpInternal(hDriver,pDescriptor,phBuilder); + return zeRTASBuilderCreateExtInternal(hDriver,pDescriptor,phBuilder); } -ze_result_t ZeWrapper::zeRTASBuilderDestroyExp(ze_rtas_builder_exp_handle_t hBuilder) +ze_result_t ZeWrapper::zeRTASBuilderDestroyExt(ze_rtas_builder_ext_handle_t hBuilder) { - if (!handle || !zeRTASBuilderDestroyExpInternal) + if (!handle || !zeRTASBuilderDestroyExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASBuilderDestroyExpInternal(hBuilder); + return zeRTASBuilderDestroyExtInternal(hBuilder); } -ze_result_t ZeWrapper::zeDriverRTASFormatCompatibilityCheckExp( ze_driver_handle_t hDriver, - const ze_rtas_format_exp_t accelFormat, - const ze_rtas_format_exp_t otherAccelFormat) +ze_result_t ZeWrapper::zeDriverRTASFormatCompatibilityCheckExt(ze_driver_handle_t hDriver, + const ze_rtas_format_ext_t accelFormat, + const ze_rtas_format_ext_t otherAccelFormat) { - if (!handle || !zeDriverRTASFormatCompatibilityCheckExpInternal) + if (!handle || !zeDriverRTASFormatCompatibilityCheckExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeDriverRTASFormatCompatibilityCheckExpInternal( hDriver, accelFormat, otherAccelFormat); + return zeDriverRTASFormatCompatibilityCheckExtInternal(hDriver, accelFormat, otherAccelFormat); } -ze_result_t ZeWrapper::zeRTASBuilderGetBuildPropertiesExp(ze_rtas_builder_exp_handle_t hBuilder, - const ze_rtas_builder_build_op_exp_desc_t* args, - ze_rtas_builder_exp_properties_t* pProp) +ze_result_t ZeWrapper::zeRTASBuilderGetBuildPropertiesExt(ze_rtas_builder_ext_handle_t hBuilder, + const ze_rtas_builder_build_op_ext_desc_t* args, + ze_rtas_builder_ext_properties_t* pProp) { - if (!handle || !zeRTASBuilderGetBuildPropertiesExpInternal) + if (!handle || !zeRTASBuilderGetBuildPropertiesExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASBuilderGetBuildPropertiesExpInternal(hBuilder, args, pProp); + return zeRTASBuilderGetBuildPropertiesExtInternal(hBuilder, args, pProp); } -ze_result_t ZeWrapper::zeRTASBuilderBuildExp(ze_rtas_builder_exp_handle_t hBuilder, - const ze_rtas_builder_build_op_exp_desc_t* args, +ze_result_t ZeWrapper::zeRTASBuilderBuildExt(ze_rtas_builder_ext_handle_t hBuilder, + const ze_rtas_builder_build_op_ext_desc_t* args, void *pScratchBuffer, size_t scratchBufferSizeBytes, void *pRtasBuffer, size_t rtasBufferSizeBytes, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, - void *pBuildUserPtr, ze_rtas_aabb_exp_t *pBounds, size_t *pRtasBufferSizeBytes) + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, + void *pBuildUserPtr, ze_rtas_aabb_ext_t *pBounds, size_t *pRtasBufferSizeBytes) { - if (!handle || !zeRTASBuilderBuildExpInternal) + if (!handle || !zeRTASBuilderBuildExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASBuilderBuildExpInternal(hBuilder, args, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, + return zeRTASBuilderBuildExtInternal(hBuilder, args, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes, hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes); } -ze_result_t ZeWrapper::zeRTASParallelOperationCreateExp(ze_driver_handle_t hDriver, ze_rtas_parallel_operation_exp_handle_t* phParallelOperation) +ze_result_t ZeWrapper::zeRTASParallelOperationCreateExt(ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation) { - if (!handle || !zeRTASParallelOperationCreateExpInternal) + if (!handle || !zeRTASParallelOperationCreateExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASParallelOperationCreateExpInternal(hDriver, phParallelOperation); + return zeRTASParallelOperationCreateExtInternal(hDriver, phParallelOperation); } -ze_result_t ZeWrapper::zeRTASParallelOperationDestroyExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ) +ze_result_t ZeWrapper::zeRTASParallelOperationDestroyExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation) { - if (!handle || !zeRTASParallelOperationDestroyExpInternal) + if (!handle || !zeRTASParallelOperationDestroyExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASParallelOperationDestroyExpInternal( hParallelOperation ); + return zeRTASParallelOperationDestroyExtInternal(hParallelOperation); }; -ze_result_t ZeWrapper::zeRTASParallelOperationGetPropertiesExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ze_rtas_parallel_operation_exp_properties_t* pProperties ) +ze_result_t ZeWrapper::zeRTASParallelOperationGetPropertiesExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties) { - if (!handle || !zeRTASParallelOperationGetPropertiesExpInternal) + if (!handle || !zeRTASParallelOperationGetPropertiesExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASParallelOperationGetPropertiesExpInternal( hParallelOperation, pProperties ); + return zeRTASParallelOperationGetPropertiesExtInternal(hParallelOperation, pProperties); } -ze_result_t ZeWrapper::zeRTASParallelOperationJoinExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation) +ze_result_t ZeWrapper::zeRTASParallelOperationJoinExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation) { - if (!handle || !zeRTASParallelOperationJoinExpInternal) + if (!handle || !zeRTASParallelOperationJoinExtInternal) throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first."); - return zeRTASParallelOperationJoinExpInternal(hParallelOperation); + return zeRTASParallelOperationJoinExtInternal(hParallelOperation); } diff --git a/kernels/level_zero/ze_wrapper.h b/kernels/level_zero/ze_wrapper.h index f378eb3163..6669e1a4ae 100644 --- a/kernels/level_zero/ze_wrapper.h +++ b/kernels/level_zero/ze_wrapper.h @@ -5,10 +5,6 @@ #include "ze_api.h" -#if !defined(ZE_RTAS_BUILDER_EXP_NAME) -#include "ze_rtas.h" -#endif - ////////////////////// // Debug extension @@ -40,25 +36,25 @@ struct ZeWrapper static ze_result_t zeDeviceGetProperties(ze_device_handle_t, ze_device_properties_t*); static ze_result_t zeDeviceGetModuleProperties(ze_device_handle_t, ze_device_module_properties_t*); - static ze_result_t zeRTASBuilderCreateExp(ze_driver_handle_t hDriver, const ze_rtas_builder_exp_desc_t *pDescriptor, ze_rtas_builder_exp_handle_t *phBuilder); - static ze_result_t zeRTASBuilderDestroyExp(ze_rtas_builder_exp_handle_t hBuilder); - static ze_result_t zeDriverRTASFormatCompatibilityCheckExp( ze_driver_handle_t hDriver, - const ze_rtas_format_exp_t accelFormat, - const ze_rtas_format_exp_t otherAccelFormat); - static ze_result_t zeRTASBuilderGetBuildPropertiesExp(ze_rtas_builder_exp_handle_t hBuilder, - const ze_rtas_builder_build_op_exp_desc_t* args, - ze_rtas_builder_exp_properties_t* pProp); - static ze_result_t zeRTASBuilderBuildExp(ze_rtas_builder_exp_handle_t hBuilder, - const ze_rtas_builder_build_op_exp_desc_t* args, + static ze_result_t zeRTASBuilderCreateExt(ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t *pDescriptor, ze_rtas_builder_ext_handle_t *phBuilder); + static ze_result_t zeRTASBuilderDestroyExt(ze_rtas_builder_ext_handle_t hBuilder); + static ze_result_t zeDriverRTASFormatCompatibilityCheckExt(ze_driver_handle_t hDriver, + const ze_rtas_format_ext_t accelFormat, + const ze_rtas_format_ext_t otherAccelFormat); + static ze_result_t zeRTASBuilderGetBuildPropertiesExt(ze_rtas_builder_ext_handle_t hBuilder, + const ze_rtas_builder_build_op_ext_desc_t* args, + ze_rtas_builder_ext_properties_t* pProp); + static ze_result_t zeRTASBuilderBuildExt(ze_rtas_builder_ext_handle_t hBuilder, + const ze_rtas_builder_build_op_ext_desc_t* args, void *pScratchBuffer, size_t scratchBufferSizeBytes, void *pRtasBuffer, size_t rtasBufferSizeBytes, - ze_rtas_parallel_operation_exp_handle_t hParallelOperation, - void *pBuildUserPtr, ze_rtas_aabb_exp_t *pBounds, size_t *pRtasBufferSizeBytes); + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, + void *pBuildUserPtr, ze_rtas_aabb_ext_t *pBounds, size_t *pRtasBufferSizeBytes); - static ze_result_t zeRTASParallelOperationCreateExp(ze_driver_handle_t hDriver, ze_rtas_parallel_operation_exp_handle_t* phParallelOperation); - static ze_result_t zeRTASParallelOperationDestroyExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation ); - static ze_result_t zeRTASParallelOperationGetPropertiesExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ze_rtas_parallel_operation_exp_properties_t* pProperties ); - static ze_result_t zeRTASParallelOperationJoinExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation); + static ze_result_t zeRTASParallelOperationCreateExt(ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation); + static ze_result_t zeRTASParallelOperationDestroyExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation); + static ze_result_t zeRTASParallelOperationGetPropertiesExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties); + static ze_result_t zeRTASParallelOperationJoinExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation); static bool rtas_builder_selected; }; diff --git a/kernels/sycl/rthwif_embree_builder.cpp b/kernels/sycl/rthwif_embree_builder.cpp index e570adc8bc..17c95322c6 100644 --- a/kernels/sycl/rthwif_embree_builder.cpp +++ b/kernels/sycl/rthwif_embree_builder.cpp @@ -117,7 +117,7 @@ namespace embree if (strncmp("ZE_extension_raytracing",extensions[i].name,sizeof(extensions[i].name)) == 0) ze_extension_ray_tracing = true; - if (strncmp("ZE_experimental_rtas_builder",extensions[i].name,sizeof(extensions[i].name)) == 0) + if (strncmp("ZE_extension_rtas",extensions[i].name,sizeof(extensions[i].name)) == 0) ze_rtas_builder = true; } if (!ze_extension_ray_tracing) @@ -177,7 +177,7 @@ namespace embree ze_context_handle_t hContext = sycl::get_native(context); ze_device_handle_t hDevice = sycl::get_native(device); - ze_rtas_device_exp_properties_t rtasProp = { ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXP_PROPERTIES }; + ze_rtas_device_ext_properties_t rtasProp = { ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES }; ze_device_properties_t devProp = { ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES, &rtasProp }; ze_result_t err = ZeWrapper::zeDeviceGetProperties(hDevice, &devProp ); if (err != ZE_RESULT_SUCCESS) @@ -251,27 +251,27 @@ namespace embree throw_RTCError(RTC_ERROR_OUT_OF_MEMORY,"rtas memory free failed"); } - struct GEOMETRY_INSTANCE_DESC : ze_rtas_builder_instance_geometry_info_exp_t + struct GEOMETRY_INSTANCE_DESC : ze_rtas_builder_instance_geometry_info_ext_t { - ze_rtas_transform_float3x4_aligned_column_major_exp_t xfmdata; + ze_rtas_transform_float3x4_aligned_column_major_ext_t xfmdata; }; struct GEOMETRY_TYPE { - GEOMETRY_TYPE(ze_rtas_builder_geometry_type_exp_t type, size_t extraBytes = 0) + GEOMETRY_TYPE(ze_rtas_builder_geometry_type_ext_t type, size_t extraBytes = 0) : type(type), extraBytes(extraBytes) {} - ze_rtas_builder_geometry_type_exp_t type; + ze_rtas_builder_geometry_type_ext_t type; size_t extraBytes; }; size_t sizeof_RTHWIF_GEOMETRY(GEOMETRY_TYPE type) { switch (type.type) { - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES : return sizeof(ze_rtas_builder_triangles_geometry_info_exp_t)+type.extraBytes; - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS : return sizeof(ze_rtas_builder_quads_geometry_info_exp_t)+type.extraBytes; - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL: return sizeof(ze_rtas_builder_procedural_geometry_info_exp_t)+type.extraBytes; - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE : return sizeof(ze_rtas_builder_instance_geometry_info_exp_t)+type.extraBytes; + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES : return sizeof(ze_rtas_builder_triangles_geometry_info_ext_t)+type.extraBytes; + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS : return sizeof(ze_rtas_builder_quads_geometry_info_ext_t)+type.extraBytes; + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL: return sizeof(ze_rtas_builder_procedural_geometry_info_ext_t)+type.extraBytes; + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE : return sizeof(ze_rtas_builder_instance_geometry_info_ext_t)+type.extraBytes; default: assert(false); return 0; } } @@ -279,69 +279,69 @@ namespace embree size_t alignof_RTHWIF_GEOMETRY(GEOMETRY_TYPE type) { switch (type.type) { - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES : return alignof(ze_rtas_builder_triangles_geometry_info_exp_t); - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS : return alignof(ze_rtas_builder_quads_geometry_info_exp_t); - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL: return alignof(ze_rtas_builder_procedural_geometry_info_exp_t); - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE : return alignof(ze_rtas_builder_instance_geometry_info_exp_t); + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES : return alignof(ze_rtas_builder_triangles_geometry_info_ext_t); + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS : return alignof(ze_rtas_builder_quads_geometry_info_ext_t); + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL: return alignof(ze_rtas_builder_procedural_geometry_info_ext_t); + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE : return alignof(ze_rtas_builder_instance_geometry_info_ext_t); default: assert(false); return 0; } } - ze_rtas_builder_geometry_exp_flags_t getGeometryFlags(Scene* scene, Geometry* geom) + ze_rtas_builder_geometry_ext_flags_t getGeometryFlags(Scene* scene, Geometry* geom) { /* invoke any hit callback when Embree filter functions are present */ - ze_rtas_builder_geometry_exp_flags_t gflags = 0; + ze_rtas_builder_geometry_ext_flags_t gflags = 0; if (geom->hasArgumentFilterFunctions() || geom->hasGeometryFilterFunctions()) - gflags = ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_NON_OPAQUE; + gflags = ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE; #if defined(EMBREE_RAY_MASK) /* invoke any hit callback when high mask bits are enabled */ if (geom->mask & 0xFFFFFF80) - gflags = ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_NON_OPAQUE; + gflags = ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE; #endif return gflags; } - void createGeometryDesc(ze_rtas_builder_triangles_geometry_info_exp_t* out, Scene* scene, TriangleMesh* geom) + void createGeometryDesc(ze_rtas_builder_triangles_geometry_info_ext_t* out, Scene* scene, TriangleMesh* geom) { - memset(out,0,sizeof(ze_rtas_builder_triangles_geometry_info_exp_t)); - out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES; + memset(out,0,sizeof(ze_rtas_builder_triangles_geometry_info_ext_t)); + out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES; out->geometryFlags = getGeometryFlags(scene,geom); out->geometryMask = mask32_to_mask8(geom->mask); - out->triangleFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32; - out->vertexFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3; - out->pTriangleBuffer = (ze_rtas_triangle_indices_uint32_exp_t*) geom->triangles.getPtr(); + out->triangleFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32; + out->vertexFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3; + out->pTriangleBuffer = (ze_rtas_triangle_indices_uint32_ext_t*) geom->triangles.getPtr(); out->triangleCount = geom->triangles.size(); out->triangleStride = geom->triangles.getStride(); - out->pVertexBuffer = (ze_rtas_float3_exp_t*) geom->vertices0.getPtr(); + out->pVertexBuffer = (ze_rtas_float3_ext_t*) geom->vertices0.getPtr(); out->vertexCount = geom->vertices0.size(); out->vertexStride = geom->vertices0.getStride(); } - void createGeometryDesc(ze_rtas_builder_quads_geometry_info_exp_t* out, Scene* scene, QuadMesh* geom) + void createGeometryDesc(ze_rtas_builder_quads_geometry_info_ext_t* out, Scene* scene, QuadMesh* geom) { - memset(out,0,sizeof(ze_rtas_builder_quads_geometry_info_exp_t)); - out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS; + memset(out,0,sizeof(ze_rtas_builder_quads_geometry_info_ext_t)); + out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS; out->geometryFlags = getGeometryFlags(scene,geom); out->geometryMask = mask32_to_mask8(geom->mask); - out->quadFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32; - out->vertexFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3; - out->pQuadBuffer = (ze_rtas_quad_indices_uint32_exp_t*) geom->quads.getPtr(); + out->quadFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32; + out->vertexFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3; + out->pQuadBuffer = (ze_rtas_quad_indices_uint32_ext_t*) geom->quads.getPtr(); out->quadCount = geom->quads.size(); out->quadStride = geom->quads.getStride(); - out->pVertexBuffer = (ze_rtas_float3_exp_t*) geom->vertices0.getPtr(); + out->pVertexBuffer = (ze_rtas_float3_ext_t*) geom->vertices0.getPtr(); out->vertexCount = geom->vertices0.size(); out->vertexStride = geom->vertices0.getStride(); } - void getProceduralAABB(ze_rtas_geometry_aabbs_exp_cb_params_t* params) + void getProceduralAABB(ze_rtas_geometry_aabbs_ext_cb_params_t* params) { - assert(params->stype == ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXP_CB_PARAMS); + assert(params->stype == ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS); BBox1f time_range = * (BBox1f*) params->pBuildUserPtr; Geometry* geom = (Geometry*) params->pGeomUserPtr; - ze_rtas_aabb_exp_t* boundsOut = params->pBoundsOut; + ze_rtas_aabb_ext_t* boundsOut = params->pBoundsOut; for (uint32_t i=0; iprimIDCount; i++) { @@ -379,14 +379,14 @@ namespace embree } }; - void createGeometryDescProcedural(ze_rtas_builder_procedural_geometry_info_exp_t* out, Scene* scene, Geometry* geom) + void createGeometryDescProcedural(ze_rtas_builder_procedural_geometry_info_ext_t* out, Scene* scene, Geometry* geom) { uint32_t numPrimitives = geom->size(); if (GridMesh* mesh = dynamic_cast(geom)) numPrimitives = mesh->getNumTotalQuads(); // FIXME: slow - memset(out,0,sizeof(ze_rtas_builder_procedural_geometry_info_exp_t)); - out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; + memset(out,0,sizeof(ze_rtas_builder_procedural_geometry_info_ext_t)); + out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; out->geometryFlags = 0; out->geometryMask = mask32_to_mask8(geom->mask); out->primCount = numPrimitives; @@ -398,64 +398,64 @@ namespace embree { assert(geom->gsubtype == AccelSet::GTY_SUBTYPE_INSTANCE_QUATERNION); memset(out,0,sizeof(GEOMETRY_INSTANCE_DESC)); - out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE; + out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE; out->instanceFlags = 0; out->geometryMask = mask32_to_mask8(geom->mask); out->instanceUserID = 0; const AffineSpace3fa local2world = geom->getLocal2World(); - out->transformFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR; + out->transformFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR; out->pTransform = (float*) &out->xfmdata; - out->pBounds = (ze_rtas_aabb_exp_t*) &dynamic_cast(geom->object)->accelBuffer.getBounds(); - out->xfmdata = *(ze_rtas_transform_float3x4_aligned_column_major_exp_t*) &local2world; + out->pBounds = (ze_rtas_aabb_ext_t*) &dynamic_cast(geom->object)->accelBuffer.getBounds(); + out->xfmdata = *(ze_rtas_transform_float3x4_aligned_column_major_ext_t*) &local2world; out->pAccelerationStructure = dynamic_cast(geom->object)->accelBuffer.getAccelBufferDeviceData(0); } - void createGeometryDesc(ze_rtas_builder_instance_geometry_info_exp_t* out, Scene* scene, Instance* geom) + void createGeometryDesc(ze_rtas_builder_instance_geometry_info_ext_t* out, Scene* scene, Instance* geom) { assert(geom->gsubtype == AccelSet::GTY_SUBTYPE_DEFAULT); - memset(out,0,sizeof(ze_rtas_builder_instance_geometry_info_exp_t)); - out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE; + memset(out,0,sizeof(ze_rtas_builder_instance_geometry_info_ext_t)); + out->geometryType = ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE; out->instanceFlags = 0; out->geometryMask = mask32_to_mask8(geom->mask); out->instanceUserID = 0; - out->transformFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3X4_ALIGNED_COLUMN_MAJOR; + out->transformFormat = ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR; out->pTransform = (float*) &geom->local2world[0]; - out->pBounds = (ze_rtas_aabb_exp_t*) &dynamic_cast(geom->object)->accelBuffer.getBounds(); + out->pBounds = (ze_rtas_aabb_ext_t*) &dynamic_cast(geom->object)->accelBuffer.getBounds(); out->pAccelerationStructure = dynamic_cast(geom->object)->accelBuffer.getAccelBufferDeviceData(0); } void createGeometryDesc(char* out, Scene* scene, Geometry* geom, GEOMETRY_TYPE type) { switch (type.type) { - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES : return createGeometryDesc((ze_rtas_builder_triangles_geometry_info_exp_t*)out,scene,dynamic_cast(geom)); - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS : return createGeometryDesc((ze_rtas_builder_quads_geometry_info_exp_t*)out,scene,dynamic_cast(geom)); - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL: return createGeometryDescProcedural((ze_rtas_builder_procedural_geometry_info_exp_t*)out,scene,geom); - case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE: + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES : return createGeometryDesc((ze_rtas_builder_triangles_geometry_info_ext_t*)out,scene,dynamic_cast(geom)); + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS : return createGeometryDesc((ze_rtas_builder_quads_geometry_info_ext_t*)out,scene,dynamic_cast(geom)); + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL: return createGeometryDescProcedural((ze_rtas_builder_procedural_geometry_info_ext_t*)out,scene,geom); + case ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE: if (type.extraBytes) return createGeometryDesc((GEOMETRY_INSTANCE_DESC*)out,scene,dynamic_cast(geom)); - else return createGeometryDesc((ze_rtas_builder_instance_geometry_info_exp_t*)out,scene,dynamic_cast(geom)); + else return createGeometryDesc((ze_rtas_builder_instance_geometry_info_ext_t*)out,scene,dynamic_cast(geom)); default: assert(false); } } - ze_rtas_builder_build_quality_hint_exp_t convertBuildQuality(RTCBuildQuality quality_flags) + ze_rtas_builder_build_quality_hint_ext_t convertBuildQuality(RTCBuildQuality quality_flags) { switch (quality_flags) { - case RTC_BUILD_QUALITY_LOW : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW; - case RTC_BUILD_QUALITY_MEDIUM : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_MEDIUM; - case RTC_BUILD_QUALITY_HIGH : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH; - case RTC_BUILD_QUALITY_REFIT : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW; - default : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_MEDIUM; + case RTC_BUILD_QUALITY_LOW : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW; + case RTC_BUILD_QUALITY_MEDIUM : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM; + case RTC_BUILD_QUALITY_HIGH : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH; + case RTC_BUILD_QUALITY_REFIT : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW; + default : return ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM; } } - ze_rtas_builder_build_op_exp_flags_t convertBuildFlags(RTCSceneFlags scene_flags, RTCBuildQuality quality_flags) + ze_rtas_builder_build_op_ext_flags_t convertBuildFlags(RTCSceneFlags scene_flags, RTCBuildQuality quality_flags) { - ze_rtas_builder_build_op_exp_flags_t result = 0; - if (scene_flags & RTC_SCENE_FLAG_COMPACT) result |= ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_COMPACT; + ze_rtas_builder_build_op_ext_flags_t result = 0; + if (scene_flags & RTC_SCENE_FLAG_COMPACT) result |= ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_COMPACT; /* only in high quality build mode spatial splits are allowed in Embree */ if (quality_flags != RTC_BUILD_QUALITY_HIGH) - result |= ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION; + result |= ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION; return result; } @@ -474,9 +474,9 @@ namespace embree ze_driver_handle_t hDriver = sycl::get_native(platform); /* create L0 builder object */ - ze_rtas_builder_exp_desc_t builderDesc = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXP_DESC }; - ze_rtas_builder_exp_handle_t hBuilder = nullptr; - ze_result_t err = ZeWrapper::zeRTASBuilderCreateExp(hDriver, &builderDesc, &hBuilder); + ze_rtas_builder_ext_desc_t builderDesc = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC, nullptr, ZE_RTAS_BUILDER_EXT_VERSION_CURRENT }; + ze_rtas_builder_ext_handle_t hBuilder = nullptr; + ze_result_t err = ZeWrapper::zeRTASBuilderCreateExt(hDriver, &builderDesc, &hBuilder); if (err != ZE_RESULT_SUCCESS) throw_RTCError(RTC_ERROR_UNKNOWN, "ze_rtas_builder creation failed"); @@ -484,59 +484,59 @@ namespace embree { /* no HW support for MB yet */ if (scene->get(geomID)->numTimeSegments() > 0) - return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; + return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; switch (scene->get(geomID)->getType()) { - case Geometry::GTY_FLAT_LINEAR_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ROUND_LINEAR_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ORIENTED_LINEAR_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_CONE_LINEAR_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_FLAT_LINEAR_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ROUND_LINEAR_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ORIENTED_LINEAR_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_CONE_LINEAR_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; - case Geometry::GTY_FLAT_BEZIER_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ROUND_BEZIER_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ORIENTED_BEZIER_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_FLAT_BEZIER_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ROUND_BEZIER_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ORIENTED_BEZIER_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; - case Geometry::GTY_FLAT_BSPLINE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ROUND_BSPLINE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ORIENTED_BSPLINE_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_FLAT_BSPLINE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ROUND_BSPLINE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ORIENTED_BSPLINE_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; - case Geometry::GTY_FLAT_HERMITE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ROUND_HERMITE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ORIENTED_HERMITE_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_FLAT_HERMITE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ROUND_HERMITE_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ORIENTED_HERMITE_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; - case Geometry::GTY_FLAT_CATMULL_ROM_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ROUND_CATMULL_ROM_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ORIENTED_CATMULL_ROM_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_FLAT_CATMULL_ROM_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ROUND_CATMULL_ROM_CURVE : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ORIENTED_CATMULL_ROM_CURVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; - case Geometry::GTY_TRIANGLE_MESH: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES; break; - case Geometry::GTY_QUAD_MESH : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS; break; - case Geometry::GTY_GRID_MESH : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_SUBDIV_MESH : assert(false); return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_TRIANGLE_MESH: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES; break; + case Geometry::GTY_QUAD_MESH : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS; break; + case Geometry::GTY_GRID_MESH : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_SUBDIV_MESH : assert(false); return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; - case Geometry::GTY_SPHERE_POINT : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_DISC_POINT : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_ORIENTED_DISC_POINT: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_SPHERE_POINT : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_DISC_POINT : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_ORIENTED_DISC_POINT: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; - case Geometry::GTY_USER_GEOMETRY : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_INSTANCE_ARRAY : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_USER_GEOMETRY : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_INSTANCE_ARRAY : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; #if RTC_MAX_INSTANCE_LEVEL_COUNT < 2 case Geometry::GTY_INSTANCE_CHEAP : case Geometry::GTY_INSTANCE_EXPENSIVE: { Instance* instance = scene->get(geomID); Scene* instanced_scene = (Scene*)instance->object; - if (instanced_scene->hasMotionBlur()) return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; // we need to handle instances in procedural mode if instanced scene has motion blur - if (instance->mask & 0xFFFFFF80) return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; // we need to handle instances in procedural mode if high mask bits are set + if (instanced_scene->hasMotionBlur()) return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; // we need to handle instances in procedural mode if instanced scene has motion blur + if (instance->mask & 0xFFFFFF80) return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; // we need to handle instances in procedural mode if high mask bits are set else if (instance->gsubtype == AccelSet::GTY_SUBTYPE_INSTANCE_QUATERNION) - return GEOMETRY_TYPE(ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE,sizeof(GEOMETRY_INSTANCE_DESC)-sizeof(ze_rtas_builder_instance_geometry_info_exp_t)); - else return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE; + return GEOMETRY_TYPE(ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE,sizeof(GEOMETRY_INSTANCE_DESC)-sizeof(ze_rtas_builder_instance_geometry_info_ext_t)); + else return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE; } #else - case Geometry::GTY_INSTANCE_CHEAP : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; - case Geometry::GTY_INSTANCE_EXPENSIVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; break; + case Geometry::GTY_INSTANCE_CHEAP : return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; + case Geometry::GTY_INSTANCE_EXPENSIVE: return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; break; #endif - default: assert(false); return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL; + default: assert(false); return ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL; } }; @@ -560,7 +560,7 @@ namespace embree } /* fill geomdesc buffers */ - mvector geomDescr(scene->device, scene->size()); + mvector geomDescr(scene->device, scene->size()); mvector geomDescrData(scene->device,totalBytes); size_t offset = 0; @@ -573,17 +573,17 @@ namespace embree const GEOMETRY_TYPE type = getType(geomID); align(offset,alignof_RTHWIF_GEOMETRY(type)); createGeometryDesc(&geomDescrData[offset],scene,scene->get(geomID),type); - geomDescr[geomID] = (ze_rtas_builder_geometry_info_exp_t*) &geomDescrData[offset]; + geomDescr[geomID] = (ze_rtas_builder_geometry_info_ext_t*) &geomDescrData[offset]; offset += sizeof_RTHWIF_GEOMETRY(type); assert(offset <= geomDescrData.size()); } - ze_rtas_parallel_operation_exp_handle_t parallelOperation = nullptr; - err = ZeWrapper::zeRTASParallelOperationCreateExp(hDriver, ¶llelOperation); + ze_rtas_parallel_operation_ext_handle_t parallelOperation = nullptr; + err = ZeWrapper::zeRTASParallelOperationCreateExt(hDriver, ¶llelOperation); if (err != ZE_RESULT_SUCCESS) throw_RTCError(RTC_ERROR_UNKNOWN, "parallel operation creation failed"); - ze_rtas_device_exp_properties_t rtasProp = { ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXP_PROPERTIES }; + ze_rtas_device_ext_properties_t rtasProp = { ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES }; ze_device_properties_t devProp = { ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES, &rtasProp }; err = ZeWrapper::zeDeviceGetProperties(hDevice, &devProp ); if (err != ZE_RESULT_SUCCESS) @@ -591,15 +591,15 @@ namespace embree /* estimate static accel size */ BBox1f time_range(0,1); - ze_rtas_aabb_exp_t bounds; - ze_rtas_builder_build_op_exp_desc_t args; + ze_rtas_aabb_ext_t bounds; + ze_rtas_builder_build_op_ext_desc_t args; memset(&args,0,sizeof(args)); - args.stype = ZE_STRUCTURE_TYPE_RTAS_BUILDER_BUILD_OP_EXP_DESC; + args.stype = ZE_STRUCTURE_TYPE_RTAS_BUILDER_BUILD_OP_EXT_DESC; args.pNext = nullptr; args.rtasFormat = rtasProp.rtasFormat; args.buildQuality = convertBuildQuality(scene->quality_flags); args.buildFlags = convertBuildFlags(scene->scene_flags,scene->quality_flags); - args.ppGeometries = (const ze_rtas_builder_geometry_info_exp_t**) geomDescr.data(); + args.ppGeometries = (const ze_rtas_builder_geometry_info_ext_t**) geomDescr.data(); args.numGeometries = geomDescr.size(); /* just for debugging purposes */ @@ -609,8 +609,8 @@ namespace embree args.pNext = &buildOpDebug; #endif - ze_rtas_builder_exp_properties_t sizeTotal = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXP_PROPERTIES }; - err = ZeWrapper::zeRTASBuilderGetBuildPropertiesExp(hBuilder,&args,&sizeTotal); + ze_rtas_builder_ext_properties_t sizeTotal = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_PROPERTIES }; + err = ZeWrapper::zeRTASBuilderGetBuildPropertiesExt(hBuilder,&args,&sizeTotal); if (err != ZE_RESULT_SUCCESS) throw_RTCError(RTC_ERROR_UNKNOWN,"BVH size estimate failed"); @@ -622,7 +622,7 @@ namespace embree while (true) { /* estimate size of all mblur BVHs */ - ze_rtas_builder_exp_properties_t size = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXP_PROPERTIES }; + ze_rtas_builder_ext_properties_t size = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_PROPERTIES }; size.rtasBufferSizeBytesExpected = maxTimeSegments*sizeTotal.rtasBufferSizeBytesExpected; size.rtasBufferSizeBytesMaxRequired = maxTimeSegments*sizeTotal.rtasBufferSizeBytesMaxRequired; size_t bytes = size.rtasBufferSizeBytesExpected; @@ -642,26 +642,26 @@ namespace embree size_t accelBufferBytes = sizeTotal.rtasBufferSizeBytesExpected; bounds = { { INFINITY, INFINITY, INFINITY }, { -INFINITY, -INFINITY, -INFINITY } }; - err = ZeWrapper::zeRTASBuilderBuildExp(hBuilder,&args, + err = ZeWrapper::zeRTASBuilderBuildExt(hBuilder,&args, scratchBuffer.data(),scratchBuffer.size(), accelBuffer, accelBufferBytes, parallelOperation, &time_range, &bounds, nullptr); if (parallelOperation) { - assert(err == ZE_RESULT_EXP_RTAS_BUILD_DEFERRED); + assert(err == ZE_RESULT_EXT_RTAS_BUILD_DEFERRED); - ze_rtas_parallel_operation_exp_properties_t prop = { ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXP_PROPERTIES }; - err = ZeWrapper::zeRTASParallelOperationGetPropertiesExp(parallelOperation,&prop); + ze_rtas_parallel_operation_ext_properties_t prop = { ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXT_PROPERTIES }; + err = ZeWrapper::zeRTASParallelOperationGetPropertiesExt(parallelOperation,&prop); if (err != ZE_RESULT_SUCCESS) throw_RTCError(RTC_ERROR_UNKNOWN, "get max concurrency failed"); - parallel_for(prop.maxConcurrency, [&](uint32_t) { err = ZeWrapper::zeRTASParallelOperationJoinExp(parallelOperation); }); + parallel_for(prop.maxConcurrency, [&](uint32_t) { err = ZeWrapper::zeRTASParallelOperationJoinExt(parallelOperation); }); } fullBounds.extend(*(BBox3f*) &bounds); - if (err == ZE_RESULT_EXP_RTAS_BUILD_RETRY) + if (err == ZE_RESULT_EXT_RTAS_BUILD_RETRY) { if (sizeTotal.rtasBufferSizeBytesExpected == sizeTotal.rtasBufferSizeBytesMaxRequired) throw_RTCError(RTC_ERROR_UNKNOWN,"build error"); @@ -672,19 +672,19 @@ namespace embree if (err != ZE_RESULT_SUCCESS) break; } - if (err != ZE_RESULT_EXP_RTAS_BUILD_RETRY) break; + if (err != ZE_RESULT_EXT_RTAS_BUILD_RETRY) break; } if (err != ZE_RESULT_SUCCESS) throw_RTCError(RTC_ERROR_UNKNOWN,"build error"); /* destroy parallel operation */ - err = ZeWrapper::zeRTASParallelOperationDestroyExp(parallelOperation); + err = ZeWrapper::zeRTASParallelOperationDestroyExt(parallelOperation); if (err != ZE_RESULT_SUCCESS) throw_RTCError(RTC_ERROR_UNKNOWN, "parallel operation destruction failed"); /* destroy rtas builder again */ - err = ZeWrapper::zeRTASBuilderDestroyExp(hBuilder); + err = ZeWrapper::zeRTASBuilderDestroyExt(hBuilder); if (err != ZE_RESULT_SUCCESS) throw_RTCError(RTC_ERROR_UNKNOWN, "ze_rtas_builder destruction failed");