diff --git a/include/ur.py b/include/ur.py index f70649998b..ba756f07e9 100644 --- a/include/ur.py +++ b/include/ur.py @@ -590,31 +590,29 @@ class ur_device_info_v(IntEnum): ## bindless images backed by USM BINDLESS_IMAGES_2D_USM_SUPPORT_EXP = 0x2002 ## [::ur_bool_t] returns true if the device supports the creation of 2D ## bindless images backed by USM - BINDLESS_IMAGES_3D_USM_SUPPORT_EXP = 0x2003 ## [::ur_bool_t] returns true if the device supports the creation of 3D - ## bindless images backed by USM - IMAGE_PITCH_ALIGN_EXP = 0x2004 ## [uint32_t] returns the required alignment of the pitch between two + IMAGE_PITCH_ALIGN_EXP = 0x2003 ## [uint32_t] returns the required alignment of the pitch between two ## rows of an image in bytes - MAX_IMAGE_LINEAR_WIDTH_EXP = 0x2005 ## [size_t] returns the maximum linear width allowed for images allocated + MAX_IMAGE_LINEAR_WIDTH_EXP = 0x2004 ## [size_t] returns the maximum linear width allowed for images allocated ## using USM - MAX_IMAGE_LINEAR_HEIGHT_EXP = 0x2006 ## [size_t] returns the maximum linear height allowed for images + MAX_IMAGE_LINEAR_HEIGHT_EXP = 0x2005 ## [size_t] returns the maximum linear height allowed for images ## allocated using USM - MAX_IMAGE_LINEAR_PITCH_EXP = 0x2007 ## [size_t] returns the maximum linear pitch allowed for images allocated + MAX_IMAGE_LINEAR_PITCH_EXP = 0x2006 ## [size_t] returns the maximum linear pitch allowed for images allocated ## using USM - MIPMAP_SUPPORT_EXP = 0x2008 ## [::ur_bool_t] returns true if the device supports allocating mipmap + MIPMAP_SUPPORT_EXP = 0x2007 ## [::ur_bool_t] returns true if the device supports allocating mipmap ## resources - MIPMAP_ANISOTROPY_SUPPORT_EXP = 0x2009 ## [::ur_bool_t] returns true if the device supports sampling mipmap + MIPMAP_ANISOTROPY_SUPPORT_EXP = 0x2008 ## [::ur_bool_t] returns true if the device supports sampling mipmap ## images with anisotropic filtering - MIPMAP_MAX_ANISOTROPY_EXP = 0x200A ## [uint32_t] returns the maximum anisotropic ratio supported by the + MIPMAP_MAX_ANISOTROPY_EXP = 0x2009 ## [uint32_t] returns the maximum anisotropic ratio supported by the ## device - MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP = 0x200B ## [::ur_bool_t] returns true if the device supports using images created + MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP = 0x200A ## [::ur_bool_t] returns true if the device supports using images created ## from individual mipmap levels - INTEROP_MEMORY_IMPORT_SUPPORT_EXP = 0x200C ## [::ur_bool_t] returns true if the device supports importing external + INTEROP_MEMORY_IMPORT_SUPPORT_EXP = 0x200B ## [::ur_bool_t] returns true if the device supports importing external ## memory resources - INTEROP_MEMORY_EXPORT_SUPPORT_EXP = 0x200D ## [::ur_bool_t] returns true if the device supports exporting internal + INTEROP_MEMORY_EXPORT_SUPPORT_EXP = 0x200C ## [::ur_bool_t] returns true if the device supports exporting internal ## memory resources - INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP = 0x200E ## [::ur_bool_t] returns true if the device supports importing external + INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP = 0x200D ## [::ur_bool_t] returns true if the device supports importing external ## semaphore resources - INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP = 0x200F ## [::ur_bool_t] returns true if the device supports exporting internal + INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP = 0x200E ## [::ur_bool_t] returns true if the device supports exporting internal ## event resources class ur_device_info_t(c_int): @@ -2086,7 +2084,7 @@ class ur_exp_interop_semaphore_handle_t(c_void_p): ############################################################################### ## @brief Dictates the type of memory copy. class ur_exp_image_copy_flags_v(IntEnum): - HOST_TO_DEVICE = UR_BIT(0) ## Host to device. + HOST_TO_DEVICE = UR_BIT(0) ## Host to device DEVICE_TO_HOST = UR_BIT(1) ## Device to host DEVICE_TO_DEVICE = UR_BIT(2) ## Device to device @@ -2110,8 +2108,9 @@ class ur_exp_sampler_mip_properties_t(Structure): ## being 0 ("maxMipmapLevelClamp", c_float), ## [in] maximum mipmap level from which we can sample, maximum value ## being the number of levels - ("maxAnistropy", c_float) ## [in] anisotropic ratio used when samplling the mipmap with anisotropic + ("maxAnisotropy", c_float), ## [in] anisotropic ratio used when samplling the mipmap with anisotropic ## filtering + ("mipFilterMode", ur_sampler_filter_mode_t) ## [in] mipmap filter mode used for filtering between mipmap levels ] ############################################################################### @@ -3044,51 +3043,51 @@ class ur_queue_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urBindlessImagesUnsampledImageHandleDestroyExp if __use_win_types: - _urBindlessImagesUnsampledImageHandleDestroyExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_handle_t ) + _urBindlessImagesUnsampledImageHandleDestroyExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_handle_t ) else: - _urBindlessImagesUnsampledImageHandleDestroyExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_handle_t ) + _urBindlessImagesUnsampledImageHandleDestroyExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_handle_t ) ############################################################################### ## @brief Function-pointer for urBindlessImagesSampledImageHandleDestroyExp if __use_win_types: - _urBindlessImagesSampledImageHandleDestroyExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_handle_t ) + _urBindlessImagesSampledImageHandleDestroyExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_handle_t ) else: - _urBindlessImagesSampledImageHandleDestroyExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_handle_t ) + _urBindlessImagesSampledImageHandleDestroyExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_handle_t ) ############################################################################### ## @brief Function-pointer for urBindlessImagesImageAllocateExp if __use_win_types: - _urBindlessImagesImageAllocateExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_exp_image_mem_handle_t) ) + _urBindlessImagesImageAllocateExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_exp_image_mem_handle_t) ) else: - _urBindlessImagesImageAllocateExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_exp_image_mem_handle_t) ) + _urBindlessImagesImageAllocateExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_exp_image_mem_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesImageFreeExp if __use_win_types: - _urBindlessImagesImageFreeExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t ) + _urBindlessImagesImageFreeExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t ) else: - _urBindlessImagesImageFreeExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t ) + _urBindlessImagesImageFreeExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t ) ############################################################################### ## @brief Function-pointer for urBindlessImagesUnsampledImageCreateExp if __use_win_types: - _urBindlessImagesUnsampledImageCreateExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) + _urBindlessImagesUnsampledImageCreateExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) else: - _urBindlessImagesUnsampledImageCreateExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) + _urBindlessImagesUnsampledImageCreateExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesSampledImageCreateExp if __use_win_types: - _urBindlessImagesSampledImageCreateExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_sampler_handle_t, POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) + _urBindlessImagesSampledImageCreateExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_sampler_handle_t, POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) else: - _urBindlessImagesSampledImageCreateExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_sampler_handle_t, POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) + _urBindlessImagesSampledImageCreateExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_sampler_handle_t, POINTER(ur_mem_handle_t), POINTER(ur_exp_image_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesImageCopyExp if __use_win_types: - _urBindlessImagesImageCopyExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, c_void_p, c_void_p, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_image_copy_flags_t, c_ulong, POINTER(ur_event_handle_t), POINTER(ur_event_handle_t) ) + _urBindlessImagesImageCopyExp_t = WINFUNCTYPE( ur_result_t, ur_queue_handle_t, c_void_p, c_void_p, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_image_copy_flags_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, ur_rect_region_t, c_ulong, POINTER(ur_event_handle_t), POINTER(ur_event_handle_t) ) else: - _urBindlessImagesImageCopyExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, c_void_p, c_void_p, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_image_copy_flags_t, c_ulong, POINTER(ur_event_handle_t), POINTER(ur_event_handle_t) ) + _urBindlessImagesImageCopyExp_t = CFUNCTYPE( ur_result_t, ur_queue_handle_t, c_void_p, c_void_p, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_image_copy_flags_t, ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, ur_rect_region_t, c_ulong, POINTER(ur_event_handle_t), POINTER(ur_event_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesImageGetInfoExp @@ -3100,51 +3099,51 @@ class ur_queue_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urBindlessImagesMipmapGetLevelExp if __use_win_types: - _urBindlessImagesMipmapGetLevelExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t, c_ulong, POINTER(ur_exp_image_mem_handle_t) ) + _urBindlessImagesMipmapGetLevelExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t, c_ulong, POINTER(ur_exp_image_mem_handle_t) ) else: - _urBindlessImagesMipmapGetLevelExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t, c_ulong, POINTER(ur_exp_image_mem_handle_t) ) + _urBindlessImagesMipmapGetLevelExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t, c_ulong, POINTER(ur_exp_image_mem_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesMipmapFreeExp if __use_win_types: - _urBindlessImagesMipmapFreeExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t ) + _urBindlessImagesMipmapFreeExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t ) else: - _urBindlessImagesMipmapFreeExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_image_mem_handle_t ) + _urBindlessImagesMipmapFreeExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_image_mem_handle_t ) ############################################################################### ## @brief Function-pointer for urBindlessImagesImportOpaqueFDExp if __use_win_types: - _urBindlessImagesImportOpaqueFDExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, c_size_t, c_ulong, POINTER(ur_exp_interop_mem_handle_t) ) + _urBindlessImagesImportOpaqueFDExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_size_t, c_ulong, POINTER(ur_exp_interop_mem_handle_t) ) else: - _urBindlessImagesImportOpaqueFDExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, c_size_t, c_ulong, POINTER(ur_exp_interop_mem_handle_t) ) + _urBindlessImagesImportOpaqueFDExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_size_t, c_ulong, POINTER(ur_exp_interop_mem_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesMapExternalArrayExp if __use_win_types: - _urBindlessImagesMapExternalArrayExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_interop_mem_handle_t, POINTER(ur_exp_image_handle_t) ) + _urBindlessImagesMapExternalArrayExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_interop_mem_handle_t, POINTER(ur_exp_image_mem_handle_t) ) else: - _urBindlessImagesMapExternalArrayExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_interop_mem_handle_t, POINTER(ur_exp_image_handle_t) ) + _urBindlessImagesMapExternalArrayExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, POINTER(ur_image_format_t), POINTER(ur_image_desc_t), ur_exp_interop_mem_handle_t, POINTER(ur_exp_image_mem_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesReleaseInteropExp if __use_win_types: - _urBindlessImagesReleaseInteropExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_interop_mem_handle_t ) + _urBindlessImagesReleaseInteropExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_interop_mem_handle_t ) else: - _urBindlessImagesReleaseInteropExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_interop_mem_handle_t ) + _urBindlessImagesReleaseInteropExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_interop_mem_handle_t ) ############################################################################### ## @brief Function-pointer for urBindlessImagesImportExternalSemaphoreOpaqueFDExp if __use_win_types: - _urBindlessImagesImportExternalSemaphoreOpaqueFDExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, c_ulong, POINTER(ur_exp_interop_semaphore_handle_t) ) + _urBindlessImagesImportExternalSemaphoreOpaqueFDExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_ulong, POINTER(ur_exp_interop_semaphore_handle_t) ) else: - _urBindlessImagesImportExternalSemaphoreOpaqueFDExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, c_ulong, POINTER(ur_exp_interop_semaphore_handle_t) ) + _urBindlessImagesImportExternalSemaphoreOpaqueFDExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, c_ulong, POINTER(ur_exp_interop_semaphore_handle_t) ) ############################################################################### ## @brief Function-pointer for urBindlessImagesDestroyExternalSemaphoreExp if __use_win_types: - _urBindlessImagesDestroyExternalSemaphoreExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_interop_semaphore_handle_t ) + _urBindlessImagesDestroyExternalSemaphoreExp_t = WINFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_interop_semaphore_handle_t ) else: - _urBindlessImagesDestroyExternalSemaphoreExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_exp_interop_semaphore_handle_t ) + _urBindlessImagesDestroyExternalSemaphoreExp_t = CFUNCTYPE( ur_result_t, ur_context_handle_t, ur_device_handle_t, ur_exp_interop_semaphore_handle_t ) ############################################################################### ## @brief Function-pointer for urBindlessImagesWaitExternalSemaphoreExp diff --git a/include/ur_api.h b/include/ur_api.h index 2f15f4e1d1..cd0d72740a 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -977,31 +977,29 @@ typedef enum ur_device_info_t { ///< bindless images backed by USM UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP = 0x2002, ///< [::ur_bool_t] returns true if the device supports the creation of 2D ///< bindless images backed by USM - UR_DEVICE_INFO_BINDLESS_IMAGES_3D_USM_SUPPORT_EXP = 0x2003, ///< [::ur_bool_t] returns true if the device supports the creation of 3D - ///< bindless images backed by USM - UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP = 0x2004, ///< [uint32_t] returns the required alignment of the pitch between two + UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP = 0x2003, ///< [uint32_t] returns the required alignment of the pitch between two ///< rows of an image in bytes - UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP = 0x2005, ///< [size_t] returns the maximum linear width allowed for images allocated + UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP = 0x2004, ///< [size_t] returns the maximum linear width allowed for images allocated ///< using USM - UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP = 0x2006, ///< [size_t] returns the maximum linear height allowed for images + UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP = 0x2005, ///< [size_t] returns the maximum linear height allowed for images ///< allocated using USM - UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP = 0x2007, ///< [size_t] returns the maximum linear pitch allowed for images allocated + UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP = 0x2006, ///< [size_t] returns the maximum linear pitch allowed for images allocated ///< using USM - UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP = 0x2008, ///< [::ur_bool_t] returns true if the device supports allocating mipmap + UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP = 0x2007, ///< [::ur_bool_t] returns true if the device supports allocating mipmap ///< resources - UR_DEVICE_INFO_MIPMAP_ANISOTROPY_SUPPORT_EXP = 0x2009, ///< [::ur_bool_t] returns true if the device supports sampling mipmap + UR_DEVICE_INFO_MIPMAP_ANISOTROPY_SUPPORT_EXP = 0x2008, ///< [::ur_bool_t] returns true if the device supports sampling mipmap ///< images with anisotropic filtering - UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP = 0x200A, ///< [uint32_t] returns the maximum anisotropic ratio supported by the + UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP = 0x2009, ///< [uint32_t] returns the maximum anisotropic ratio supported by the ///< device - UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP = 0x200B, ///< [::ur_bool_t] returns true if the device supports using images created + UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP = 0x200A, ///< [::ur_bool_t] returns true if the device supports using images created ///< from individual mipmap levels - UR_DEVICE_INFO_INTEROP_MEMORY_IMPORT_SUPPORT_EXP = 0x200C, ///< [::ur_bool_t] returns true if the device supports importing external + UR_DEVICE_INFO_INTEROP_MEMORY_IMPORT_SUPPORT_EXP = 0x200B, ///< [::ur_bool_t] returns true if the device supports importing external ///< memory resources - UR_DEVICE_INFO_INTEROP_MEMORY_EXPORT_SUPPORT_EXP = 0x200D, ///< [::ur_bool_t] returns true if the device supports exporting internal + UR_DEVICE_INFO_INTEROP_MEMORY_EXPORT_SUPPORT_EXP = 0x200C, ///< [::ur_bool_t] returns true if the device supports exporting internal ///< memory resources - UR_DEVICE_INFO_INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP = 0x200E, ///< [::ur_bool_t] returns true if the device supports importing external + UR_DEVICE_INFO_INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP = 0x200D, ///< [::ur_bool_t] returns true if the device supports importing external ///< semaphore resources - UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP = 0x200F, ///< [::ur_bool_t] returns true if the device supports exporting internal + UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP = 0x200E, ///< [::ur_bool_t] returns true if the device supports exporting internal ///< event resources /// @cond UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff @@ -6578,7 +6576,7 @@ typedef struct ur_exp_interop_semaphore_handle_t_ *ur_exp_interop_semaphore_hand /// @brief Dictates the type of memory copy. typedef uint32_t ur_exp_image_copy_flags_t; typedef enum ur_exp_image_copy_flag_t { - UR_EXP_IMAGE_COPY_FLAG_HOST_TO_DEVICE = UR_BIT(0), ///< Host to device. + UR_EXP_IMAGE_COPY_FLAG_HOST_TO_DEVICE = UR_BIT(0), ///< Host to device UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_HOST = UR_BIT(1), ///< Device to host UR_EXP_IMAGE_COPY_FLAG_DEVICE_TO_DEVICE = UR_BIT(2), ///< Device to device /// @cond @@ -6596,15 +6594,16 @@ typedef enum ur_exp_image_copy_flag_t { /// - Specify these properties in ::urSamplerCreate via ::ur_sampler_desc_t /// as part of a `pNext` chain. typedef struct ur_exp_sampler_mip_properties_t { - ur_structure_type_t stype; ///< [in] type of this structure, must be - ///< ::UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES - void *pNext; ///< [in,out][optional] pointer to extension-specific structure - float minMipmapLevelClamp; ///< [in] minimum mipmap level from which we can sample, minimum value - ///< being 0 - float maxMipmapLevelClamp; ///< [in] maximum mipmap level from which we can sample, maximum value - ///< being the number of levels - float maxAnistropy; ///< [in] anisotropic ratio used when samplling the mipmap with anisotropic - ///< filtering + ur_structure_type_t stype; ///< [in] type of this structure, must be + ///< ::UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES + void *pNext; ///< [in,out][optional] pointer to extension-specific structure + float minMipmapLevelClamp; ///< [in] minimum mipmap level from which we can sample, minimum value + ///< being 0 + float maxMipmapLevelClamp; ///< [in] maximum mipmap level from which we can sample, maximum value + ///< being the number of levels + float maxAnisotropy; ///< [in] anisotropic ratio used when samplling the mipmap with anisotropic + ///< filtering + ur_sampler_filter_mode_t mipFilterMode; ///< [in] mipmap filter mode used for filtering between mipmap levels } ur_exp_sampler_mip_properties_t; @@ -6676,12 +6675,14 @@ urUSMPitchedAllocExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImage` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ); @@ -6699,12 +6700,14 @@ urBindlessImagesUnsampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImage` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ); @@ -6723,6 +6726,7 @@ urBindlessImagesSampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` /// + `NULL == pImageDesc` @@ -6736,6 +6740,7 @@ urBindlessImagesSampledImageHandleDestroyExp( UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_mem_handle_t *phImageMem ///< [out] pointer to handle of image memory allocated @@ -6755,12 +6760,14 @@ urBindlessImagesImageAllocateExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed ); @@ -6778,6 +6785,7 @@ urBindlessImagesImageFreeExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` @@ -6793,6 +6801,7 @@ urBindlessImagesImageFreeExp( UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -6814,6 +6823,7 @@ urBindlessImagesUnsampledImageCreateExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// + `NULL == hSampler` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER @@ -6831,6 +6841,7 @@ urBindlessImagesUnsampledImageCreateExp( UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -6855,7 +6866,7 @@ urBindlessImagesSampledImageCreateExp( /// - ::UR_RESULT_ERROR_DEVICE_LOST /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hContext` +/// + `NULL == hQueue` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pDst` /// + `NULL == pSrc` @@ -6863,7 +6874,7 @@ urBindlessImagesSampledImageCreateExp( /// + `NULL == pImageDesc` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION /// + `::UR_EXP_IMAGE_COPY_FLAGS_MASK & imageCopyFlags` -/// - ::UR_RESULT_ERROR_INVALID_CONTEXT +/// - ::UR_RESULT_ERROR_INVALID_QUEUE /// - ::UR_RESULT_ERROR_INVALID_VALUE /// - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR /// + `pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type` @@ -6871,12 +6882,20 @@ urBindlessImagesSampledImageCreateExp( /// - ::UR_RESULT_ERROR_INVALID_OPERATION UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - ur_context_handle_t hContext, ///< [in] handle of the context object + ur_queue_handle_t hQueue, ///< [in] handle of the queue object void *pDst, ///< [in] location the data will be copied to void *pSrc, ///< [in] location the data will be copied from const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_copy_flags_t imageCopyFlags, ///< [in] flags describing copy direction e.g. H2D or D2H + ur_rect_offset_t srcOffset, ///< [in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D + ///< image + ur_rect_offset_t dstOffset, ///< [in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, + ///< or 3D image + ur_rect_region_t copyExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region to copy + ur_rect_region_t hostExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region on the host uint32_t numEventsInWaitList, ///< [in] size of the event wait list const ur_event_handle_t *phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of ///< events that must be complete before this command can be executed. @@ -6930,6 +6949,7 @@ urBindlessImagesImageGetInfoExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phImageMem` @@ -6938,6 +6958,7 @@ urBindlessImagesImageGetInfoExp( UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] memory handle to the mipmap image uint32_t mipmapLevel, ///< [in] requested level of the mipmap ur_exp_image_mem_handle_t *phImageMem ///< [out] returning memory handle to the individual image @@ -6957,12 +6978,14 @@ urBindlessImagesMipmapGetLevelExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed ); @@ -6980,6 +7003,7 @@ urBindlessImagesMipmapFreeExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phInteropMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT @@ -6988,6 +7012,7 @@ urBindlessImagesMipmapFreeExp( UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object size_t size, ///< [in] size of the external memory uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_mem_handle_t *phInteropMem ///< [out] interop memory handle to the external memory @@ -7003,6 +7028,7 @@ urBindlessImagesImportOpaqueFDExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` @@ -7018,10 +7044,11 @@ urBindlessImagesImportOpaqueFDExp( UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_interop_mem_handle_t hInteropMem, ///< [in] interop memory handle to the external memory - ur_exp_image_handle_t *phImageMem ///< [out] image memory handle to the externally allocated memory + ur_exp_image_mem_handle_t *phImageMem ///< [out] image memory handle to the externally allocated memory ); /////////////////////////////////////////////////////////////////////////////// @@ -7038,12 +7065,14 @@ urBindlessImagesMapExternalArrayExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed ); @@ -7061,6 +7090,7 @@ urBindlessImagesReleaseInteropExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phInteropSemaphoreHandle` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT @@ -7068,6 +7098,7 @@ urBindlessImagesReleaseInteropExp( UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_semaphore_handle_t *phInteropSemaphoreHandle ///< [out] interop semaphore handle to the external semaphore ); @@ -7086,12 +7117,14 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropSemaphore` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed ); @@ -9011,6 +9044,7 @@ typedef struct ur_queue_flush_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_unsampled_image_handle_destroy_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_image_handle_t *phImage; } ur_bindless_images_unsampled_image_handle_destroy_exp_params_t; @@ -9020,6 +9054,7 @@ typedef struct ur_bindless_images_unsampled_image_handle_destroy_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_sampled_image_handle_destroy_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_image_handle_t *phImage; } ur_bindless_images_sampled_image_handle_destroy_exp_params_t; @@ -9029,6 +9064,7 @@ typedef struct ur_bindless_images_sampled_image_handle_destroy_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_image_allocate_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; const ur_image_format_t **ppImageFormat; const ur_image_desc_t **ppImageDesc; ur_exp_image_mem_handle_t **pphImageMem; @@ -9040,6 +9076,7 @@ typedef struct ur_bindless_images_image_allocate_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_image_free_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_image_mem_handle_t *phImageMem; } ur_bindless_images_image_free_exp_params_t; @@ -9049,6 +9086,7 @@ typedef struct ur_bindless_images_image_free_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_unsampled_image_create_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_image_mem_handle_t *phImageMem; const ur_image_format_t **ppImageFormat; const ur_image_desc_t **ppImageDesc; @@ -9062,6 +9100,7 @@ typedef struct ur_bindless_images_unsampled_image_create_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_sampled_image_create_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_image_mem_handle_t *phImageMem; const ur_image_format_t **ppImageFormat; const ur_image_desc_t **ppImageDesc; @@ -9075,12 +9114,16 @@ typedef struct ur_bindless_images_sampled_image_create_exp_params_t { /// @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 ur_bindless_images_image_copy_exp_params_t { - ur_context_handle_t *phContext; + ur_queue_handle_t *phQueue; void **ppDst; void **ppSrc; const ur_image_format_t **ppImageFormat; const ur_image_desc_t **ppImageDesc; ur_exp_image_copy_flags_t *pimageCopyFlags; + ur_rect_offset_t *psrcOffset; + ur_rect_offset_t *pdstOffset; + ur_rect_region_t *pcopyExtent; + ur_rect_region_t *phostExtent; uint32_t *pnumEventsInWaitList; const ur_event_handle_t **pphEventWaitList; ur_event_handle_t **pphEvent; @@ -9103,6 +9146,7 @@ typedef struct ur_bindless_images_image_get_info_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_mipmap_get_level_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_image_mem_handle_t *phImageMem; uint32_t *pmipmapLevel; ur_exp_image_mem_handle_t **pphImageMem; @@ -9114,6 +9158,7 @@ typedef struct ur_bindless_images_mipmap_get_level_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_mipmap_free_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_image_mem_handle_t *phMem; } ur_bindless_images_mipmap_free_exp_params_t; @@ -9123,6 +9168,7 @@ typedef struct ur_bindless_images_mipmap_free_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_import_opaque_fd_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; size_t *psize; uint32_t *pfileDescriptor; ur_exp_interop_mem_handle_t **pphInteropMem; @@ -9134,10 +9180,11 @@ typedef struct ur_bindless_images_import_opaque_fd_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_map_external_array_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; const ur_image_format_t **ppImageFormat; const ur_image_desc_t **ppImageDesc; ur_exp_interop_mem_handle_t *phInteropMem; - ur_exp_image_handle_t **pphImageMem; + ur_exp_image_mem_handle_t **pphImageMem; } ur_bindless_images_map_external_array_exp_params_t; /////////////////////////////////////////////////////////////////////////////// @@ -9146,6 +9193,7 @@ typedef struct ur_bindless_images_map_external_array_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_release_interop_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_interop_mem_handle_t *phInteropMem; } ur_bindless_images_release_interop_exp_params_t; @@ -9155,6 +9203,7 @@ typedef struct ur_bindless_images_release_interop_exp_params_t { /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_import_external_semaphore_opaque_fd_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; uint32_t *pfileDescriptor; ur_exp_interop_semaphore_handle_t **pphInteropSemaphoreHandle; } ur_bindless_images_import_external_semaphore_opaque_fd_exp_params_t; @@ -9165,6 +9214,7 @@ typedef struct ur_bindless_images_import_external_semaphore_opaque_fd_exp_params /// allowing the callback the ability to modify the parameter's value typedef struct ur_bindless_images_destroy_external_semaphore_exp_params_t { ur_context_handle_t *phContext; + ur_device_handle_t *phDevice; ur_exp_interop_semaphore_handle_t *phInteropSemaphore; } ur_bindless_images_destroy_external_semaphore_exp_params_t; diff --git a/include/ur_ddi.h b/include/ur_ddi.h index d99302ea94..3729208835 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -1279,18 +1279,21 @@ typedef ur_result_t(UR_APICALL *ur_pfnGetQueueProcAddrTable_t)( /// @brief Function-pointer for urBindlessImagesUnsampledImageHandleDestroyExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesUnsampledImageHandleDestroyExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_image_handle_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urBindlessImagesSampledImageHandleDestroyExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesSampledImageHandleDestroyExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_image_handle_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urBindlessImagesImageAllocateExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageAllocateExp_t)( ur_context_handle_t, + ur_device_handle_t, const ur_image_format_t *, const ur_image_desc_t *, ur_exp_image_mem_handle_t *); @@ -1299,12 +1302,14 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageAllocateExp_t)( /// @brief Function-pointer for urBindlessImagesImageFreeExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageFreeExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_image_mem_handle_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urBindlessImagesUnsampledImageCreateExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesUnsampledImageCreateExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_image_mem_handle_t, const ur_image_format_t *, const ur_image_desc_t *, @@ -1315,6 +1320,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesUnsampledImageCreateExp_t)( /// @brief Function-pointer for urBindlessImagesSampledImageCreateExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesSampledImageCreateExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_image_mem_handle_t, const ur_image_format_t *, const ur_image_desc_t *, @@ -1325,12 +1331,16 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesSampledImageCreateExp_t)( /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urBindlessImagesImageCopyExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageCopyExp_t)( - ur_context_handle_t, + ur_queue_handle_t, void *, void *, const ur_image_format_t *, const ur_image_desc_t *, ur_exp_image_copy_flags_t, + ur_rect_offset_t, + ur_rect_offset_t, + ur_rect_region_t, + ur_rect_region_t, uint32_t, const ur_event_handle_t *, ur_event_handle_t *); @@ -1347,6 +1357,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageGetInfoExp_t)( /// @brief Function-pointer for urBindlessImagesMipmapGetLevelExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesMipmapGetLevelExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_image_mem_handle_t, uint32_t, ur_exp_image_mem_handle_t *); @@ -1355,12 +1366,14 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesMipmapGetLevelExp_t)( /// @brief Function-pointer for urBindlessImagesMipmapFreeExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesMipmapFreeExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_image_mem_handle_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urBindlessImagesImportOpaqueFDExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImportOpaqueFDExp_t)( ur_context_handle_t, + ur_device_handle_t, size_t, uint32_t, ur_exp_interop_mem_handle_t *); @@ -1369,21 +1382,24 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImportOpaqueFDExp_t)( /// @brief Function-pointer for urBindlessImagesMapExternalArrayExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesMapExternalArrayExp_t)( ur_context_handle_t, + ur_device_handle_t, const ur_image_format_t *, const ur_image_desc_t *, ur_exp_interop_mem_handle_t, - ur_exp_image_handle_t *); + ur_exp_image_mem_handle_t *); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urBindlessImagesReleaseInteropExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesReleaseInteropExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_interop_mem_handle_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urBindlessImagesImportExternalSemaphoreOpaqueFDExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImportExternalSemaphoreOpaqueFDExp_t)( ur_context_handle_t, + ur_device_handle_t, uint32_t, ur_exp_interop_semaphore_handle_t *); @@ -1391,6 +1407,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImportExternalSemaphoreOpaqu /// @brief Function-pointer for urBindlessImagesDestroyExternalSemaphoreExp typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesDestroyExternalSemaphoreExp_t)( ur_context_handle_t, + ur_device_handle_t, ur_exp_interop_semaphore_handle_t); /////////////////////////////////////////////////////////////////////////////// diff --git a/scripts/core/EXP-BINDLESS-IMAGES.rst b/scripts/core/EXP-BINDLESS-IMAGES.rst index c6ecbb7c69..f1b4d94309 100644 --- a/scripts/core/EXP-BINDLESS-IMAGES.rst +++ b/scripts/core/EXP-BINDLESS-IMAGES.rst @@ -69,7 +69,6 @@ Enums * ${X}_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP * ${X}_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP * ${X}_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP - * ${X}_DEVICE_INFO_BINDLESS_IMAGES_3D_USM_SUPPORT_EXP * ${X}_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP * ${X}_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP * ${X}_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP @@ -149,11 +148,16 @@ Functions Changelog -------------------------------------------------------------------------------- -+-----------+------------------------+ -| Revision | Changes | -+===========+========================+ -| 1.0 | Initial Draft | -+-----------+------------------------+ ++----------+---------------------------------------------------------+ +| Revision | Changes | ++==========+=========================================================+ +| 1.0 | Initial Draft | ++----------+---------------------------------------------------------+ +| 2.0 || Added device parameters to UR functions. | +| || Added sub-region copy paramters to image copy function.| +| || Removed 3D USM capabilities. | +| || Added mip filter mode. | ++----------+---------------------------------------------------------+ Contributors -------------------------------------------------------------------------------- diff --git a/scripts/core/exp-bindless-images.yml b/scripts/core/exp-bindless-images.yml index 1b4d408379..b499d8d8c3 100644 --- a/scripts/core/exp-bindless-images.yml +++ b/scripts/core/exp-bindless-images.yml @@ -38,44 +38,41 @@ etors: - name: BINDLESS_IMAGES_2D_USM_SUPPORT_EXP value: "0x2002" desc: "[$x_bool_t] returns true if the device supports the creation of 2D bindless images backed by USM" - - name: BINDLESS_IMAGES_3D_USM_SUPPORT_EXP - value: "0x2003" - desc: "[$x_bool_t] returns true if the device supports the creation of 3D bindless images backed by USM" - name: IMAGE_PITCH_ALIGN_EXP - value: "0x2004" + value: "0x2003" desc: "[uint32_t] returns the required alignment of the pitch between two rows of an image in bytes" - name: MAX_IMAGE_LINEAR_WIDTH_EXP - value: "0x2005" + value: "0x2004" desc: "[size_t] returns the maximum linear width allowed for images allocated using USM" - name: MAX_IMAGE_LINEAR_HEIGHT_EXP - value: "0x2006" + value: "0x2005" desc: "[size_t] returns the maximum linear height allowed for images allocated using USM" - name: MAX_IMAGE_LINEAR_PITCH_EXP - value: "0x2007" + value: "0x2006" desc: "[size_t] returns the maximum linear pitch allowed for images allocated using USM" - name: MIPMAP_SUPPORT_EXP - value: "0x2008" + value: "0x2007" desc: "[$x_bool_t] returns true if the device supports allocating mipmap resources" - name: MIPMAP_ANISOTROPY_SUPPORT_EXP - value: "0x2009" + value: "0x2008" desc: "[$x_bool_t] returns true if the device supports sampling mipmap images with anisotropic filtering" - name: MIPMAP_MAX_ANISOTROPY_EXP - value: "0x200A" + value: "0x2009" desc: "[uint32_t] returns the maximum anisotropic ratio supported by the device" - name: MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP - value: "0x200B" + value: "0x200A" desc: "[$x_bool_t] returns true if the device supports using images created from individual mipmap levels" - name: INTEROP_MEMORY_IMPORT_SUPPORT_EXP - value: "0x200C" + value: "0x200B" desc: "[$x_bool_t] returns true if the device supports importing external memory resources" - name: INTEROP_MEMORY_EXPORT_SUPPORT_EXP - value: "0x200D" + value: "0x200C" desc: "[$x_bool_t] returns true if the device supports exporting internal memory resources" - name: INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP - value: "0x200E" + value: "0x200D" desc: "[$x_bool_t] returns true if the device supports importing external semaphore resources" - name: INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP - value: "0x200F" + value: "0x200E" desc: "[$x_bool_t] returns true if the device supports exporting internal event resources" --- #-------------------------------------------------------------------------- type: enum @@ -105,7 +102,7 @@ class: $xBindlessImages name: $x_exp_image_copy_flags_t etors: - name: HOST_TO_DEVICE - desc: "Host to device." + desc: "Host to device" - name: DEVICE_TO_HOST desc: "Device to host" - name: DEVICE_TO_DEVICE @@ -127,8 +124,11 @@ members: name: maxMipmapLevelClamp desc: "[in] maximum mipmap level from which we can sample, maximum value being the number of levels" - type: float - name: maxAnistropy + name: maxAnisotropy desc: "[in] anisotropic ratio used when samplling the mipmap with anisotropic filtering" + - type: $x_sampler_filter_mode_t + name: mipFilterMode + desc: "[in] mipmap filter mode used for filtering between mipmap levels" --- #-------------------------------------------------------------------------- type: function desc: "USM allocate pitched memory" @@ -197,6 +197,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_image_handle_t name: hImage desc: "[in] pointer to handle of image object to destroy" @@ -215,6 +218,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_image_handle_t name: hImage desc: "[in] pointer to handle of image object to destroy" @@ -234,6 +240,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: "const $x_image_format_t*" name: pImageFormat desc: "[in] pointer to image format specification" @@ -262,6 +271,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_image_mem_handle_t name: hImageMem desc: "[in] handle of image memory to be freed" @@ -280,6 +292,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_image_mem_handle_t name: hImageMem desc: "[in] handle to memory from which to create the image" @@ -314,6 +329,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_image_mem_handle_t name: hImageMem desc: "[in] handle to memory from which to create the image" @@ -352,9 +370,9 @@ analogue: - "**cuMemcpy2DAsync**" - "**cuMemcpy3DAsync**" params: - - type: $x_context_handle_t - name: hContext - desc: "[in] handle of the context object" + - type: $x_queue_handle_t + name: hQueue + desc: "[in] handle of the queue object" - type: void* name: pDst desc: "[in] location the data will be copied to" @@ -370,6 +388,18 @@ params: - type: $x_exp_image_copy_flags_t name: imageCopyFlags desc: "[in] flags describing copy direction e.g. H2D or D2H" + - type: $x_rect_offset_t + name: srcOffset + desc: "[in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D image" + - type: $x_rect_offset_t + name: dstOffset + desc: "[in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, or 3D image" + - type: $x_rect_region_t + name: copyExtent + desc: "[in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D region to copy" + - type: $x_rect_region_t + name: hostExtent + desc: "[in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D region on the host" - type: uint32_t name: numEventsInWaitList desc: "[in] size of the event wait list" @@ -384,7 +414,7 @@ params: desc: | [out][optional] return an event object that identifies this particular command instance. returns: - - $X_RESULT_ERROR_INVALID_CONTEXT + - $X_RESULT_ERROR_INVALID_QUEUE - $X_RESULT_ERROR_INVALID_VALUE - $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR: - "`pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`" @@ -431,6 +461,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_image_mem_handle_t name: hImageMem desc: "[in] memory handle to the mipmap image" @@ -455,6 +488,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_image_mem_handle_t name: hMem desc: "[in] handle of image memory to be freed" @@ -473,6 +509,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: size_t name: size desc: "[in] size of the external memory" @@ -496,6 +535,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: "const $x_image_format_t*" name: pImageFormat desc: "[in] pointer to image format specification" @@ -505,7 +547,7 @@ params: - type: $x_exp_interop_mem_handle_t name: hInteropMem desc: "[in] interop memory handle to the external memory" - - type: $x_exp_image_handle_t* + - type: $x_exp_image_mem_handle_t* name: phImageMem desc: "[out] image memory handle to the externally allocated memory" returns: @@ -528,6 +570,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_interop_mem_handle_t name: hInteropMem desc: "[in] handle of interop memory to be freed" @@ -546,6 +591,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: uint32_t name: fileDescriptor desc: "[in] the file descriptor" @@ -567,6 +615,9 @@ params: - type: $x_context_handle_t name: hContext desc: "[in] handle of the context object" + - type: $x_device_handle_t + name: hDevice + desc: "[in] handle of the device object" - type: $x_exp_interop_semaphore_handle_t name: hInteropSemaphore desc: "[in] handle of interop semaphore to be destroyed" diff --git a/source/adapters/null/ur_nullddi.cpp b/source/adapters/null/ur_nullddi.cpp index 2e19884b23..95b62afb0d 100644 --- a/source/adapters/null/ur_nullddi.cpp +++ b/source/adapters/null/ur_nullddi.cpp @@ -3817,6 +3817,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) try { @@ -3827,7 +3828,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( d_context.urDdiTable.BindlessImagesExp .pfnUnsampledImageHandleDestroyExp; if (nullptr != pfnUnsampledImageHandleDestroyExp) { - result = pfnUnsampledImageHandleDestroyExp(hContext, hImage); + result = pfnUnsampledImageHandleDestroyExp(hContext, hDevice, hImage); } else { // generic implementation } @@ -3842,6 +3843,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) try { @@ -3851,7 +3853,7 @@ urBindlessImagesSampledImageHandleDestroyExp( auto pfnSampledImageHandleDestroyExp = d_context.urDdiTable.BindlessImagesExp.pfnSampledImageHandleDestroyExp; if (nullptr != pfnSampledImageHandleDestroyExp) { - result = pfnSampledImageHandleDestroyExp(hContext, hImage); + result = pfnSampledImageHandleDestroyExp(hContext, hDevice, hImage); } else { // generic implementation } @@ -3865,6 +3867,7 @@ urBindlessImagesSampledImageHandleDestroyExp( /// @brief Intercept function for urBindlessImagesImageAllocateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -3877,8 +3880,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( auto pfnImageAllocateExp = d_context.urDdiTable.BindlessImagesExp.pfnImageAllocateExp; if (nullptr != pfnImageAllocateExp) { - result = - pfnImageAllocateExp(hContext, pImageFormat, pImageDesc, phImageMem); + result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, + pImageDesc, phImageMem); } else { // generic implementation *phImageMem = @@ -3894,6 +3897,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( /// @brief Intercept function for urBindlessImagesImageFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed ) try { @@ -3903,7 +3907,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( auto pfnImageFreeExp = d_context.urDdiTable.BindlessImagesExp.pfnImageFreeExp; if (nullptr != pfnImageFreeExp) { - result = pfnImageFreeExp(hContext, hImageMem); + result = pfnImageFreeExp(hContext, hDevice, hImageMem); } else { // generic implementation } @@ -3917,6 +3921,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// @brief Intercept function for urBindlessImagesUnsampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -3932,8 +3937,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( auto pfnUnsampledImageCreateExp = d_context.urDdiTable.BindlessImagesExp.pfnUnsampledImageCreateExp; if (nullptr != pfnUnsampledImageCreateExp) { - result = pfnUnsampledImageCreateExp(hContext, hImageMem, pImageFormat, - pImageDesc, phMem, phImage); + result = pfnUnsampledImageCreateExp(hContext, hDevice, hImageMem, + pImageFormat, pImageDesc, phMem, + phImage); } else { // generic implementation *phMem = reinterpret_cast(d_context.get()); @@ -3950,6 +3956,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// @brief Intercept function for urBindlessImagesSampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -3966,8 +3973,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( auto pfnSampledImageCreateExp = d_context.urDdiTable.BindlessImagesExp.pfnSampledImageCreateExp; if (nullptr != pfnSampledImageCreateExp) { - result = pfnSampledImageCreateExp(hContext, hImageMem, pImageFormat, - pImageDesc, hSampler, phMem, phImage); + result = + pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, + pImageDesc, hSampler, phMem, phImage); } else { // generic implementation *phMem = reinterpret_cast(d_context.get()); @@ -3983,14 +3991,26 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urBindlessImagesImageCopyExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pDst, ///< [in] location the data will be copied to - void *pSrc, ///< [in] location the data will be copied from + ur_queue_handle_t hQueue, ///< [in] handle of the queue object + void *pDst, ///< [in] location the data will be copied to + void *pSrc, ///< [in] location the data will be copied from const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_copy_flags_t imageCopyFlags, ///< [in] flags describing copy direction e.g. H2D or D2H + ur_rect_offset_t + srcOffset, ///< [in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D + ///< image + ur_rect_offset_t + dstOffset, ///< [in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, + ///< or 3D image + ur_rect_region_t + copyExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region to copy + ur_rect_region_t + hostExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region on the host uint32_t numEventsInWaitList, ///< [in] size of the event wait list const ur_event_handle_t * phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of @@ -4008,8 +4028,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( auto pfnImageCopyExp = d_context.urDdiTable.BindlessImagesExp.pfnImageCopyExp; if (nullptr != pfnImageCopyExp) { - result = pfnImageCopyExp(hContext, pDst, pSrc, pImageFormat, pImageDesc, - imageCopyFlags, numEventsInWaitList, + result = pfnImageCopyExp(hQueue, pDst, pSrc, pImageFormat, pImageDesc, + imageCopyFlags, srcOffset, dstOffset, + copyExtent, hostExtent, numEventsInWaitList, phEventWaitList, phEvent); } else { // generic implementation @@ -4052,6 +4073,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// @brief Intercept function for urBindlessImagesMipmapGetLevelExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] memory handle to the mipmap image uint32_t mipmapLevel, ///< [in] requested level of the mipmap @@ -4064,8 +4086,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( auto pfnMipmapGetLevelExp = d_context.urDdiTable.BindlessImagesExp.pfnMipmapGetLevelExp; if (nullptr != pfnMipmapGetLevelExp) { - result = - pfnMipmapGetLevelExp(hContext, hImageMem, mipmapLevel, phImageMem); + result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, mipmapLevel, + phImageMem); } else { // generic implementation *phImageMem = @@ -4081,6 +4103,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( /// @brief Intercept function for urBindlessImagesMipmapFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed ) try { ur_result_t result = UR_RESULT_SUCCESS; @@ -4089,7 +4112,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( auto pfnMipmapFreeExp = d_context.urDdiTable.BindlessImagesExp.pfnMipmapFreeExp; if (nullptr != pfnMipmapFreeExp) { - result = pfnMipmapFreeExp(hContext, hMem); + result = pfnMipmapFreeExp(hContext, hDevice, hMem); } else { // generic implementation } @@ -4103,6 +4126,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// @brief Intercept function for urBindlessImagesImportOpaqueFDExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object size_t size, ///< [in] size of the external memory uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_mem_handle_t @@ -4114,8 +4138,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( auto pfnImportOpaqueFDExp = d_context.urDdiTable.BindlessImagesExp.pfnImportOpaqueFDExp; if (nullptr != pfnImportOpaqueFDExp) { - result = - pfnImportOpaqueFDExp(hContext, size, fileDescriptor, phInteropMem); + result = pfnImportOpaqueFDExp(hContext, hDevice, size, fileDescriptor, + phInteropMem); } else { // generic implementation *phInteropMem = @@ -4131,12 +4155,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// @brief Intercept function for urBindlessImagesMapExternalArrayExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_interop_mem_handle_t hInteropMem, ///< [in] interop memory handle to the external memory - ur_exp_image_handle_t * + ur_exp_image_mem_handle_t * phImageMem ///< [out] image memory handle to the externally allocated memory ) try { ur_result_t result = UR_RESULT_SUCCESS; @@ -4145,11 +4170,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( auto pfnMapExternalArrayExp = d_context.urDdiTable.BindlessImagesExp.pfnMapExternalArrayExp; if (nullptr != pfnMapExternalArrayExp) { - result = pfnMapExternalArrayExp(hContext, pImageFormat, pImageDesc, - hInteropMem, phImageMem); + result = pfnMapExternalArrayExp(hContext, hDevice, pImageFormat, + pImageDesc, hInteropMem, phImageMem); } else { // generic implementation - *phImageMem = reinterpret_cast(d_context.get()); + *phImageMem = + reinterpret_cast(d_context.get()); } return result; @@ -4161,6 +4187,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( /// @brief Intercept function for urBindlessImagesReleaseInteropExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed ) try { @@ -4170,7 +4197,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( auto pfnReleaseInteropExp = d_context.urDdiTable.BindlessImagesExp.pfnReleaseInteropExp; if (nullptr != pfnReleaseInteropExp) { - result = pfnReleaseInteropExp(hContext, hInteropMem); + result = pfnReleaseInteropExp(hContext, hDevice, hInteropMem); } else { // generic implementation } @@ -4185,6 +4212,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_semaphore_handle_t * phInteropSemaphoreHandle ///< [out] interop semaphore handle to the external semaphore @@ -4197,7 +4225,7 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( .pfnImportExternalSemaphoreOpaqueFDExp; if (nullptr != pfnImportExternalSemaphoreOpaqueFDExp) { result = pfnImportExternalSemaphoreOpaqueFDExp( - hContext, fileDescriptor, phInteropSemaphoreHandle); + hContext, hDevice, fileDescriptor, phInteropSemaphoreHandle); } else { // generic implementation *phInteropSemaphoreHandle = @@ -4214,6 +4242,7 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( /// @brief Intercept function for urBindlessImagesDestroyExternalSemaphoreExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed ) try { @@ -4223,7 +4252,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( auto pfnDestroyExternalSemaphoreExp = d_context.urDdiTable.BindlessImagesExp.pfnDestroyExternalSemaphoreExp; if (nullptr != pfnDestroyExternalSemaphoreExp) { - result = pfnDestroyExternalSemaphoreExp(hContext, hInteropSemaphore); + result = pfnDestroyExternalSemaphoreExp(hContext, hDevice, + hInteropSemaphore); } else { // generic implementation } diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index deab11b7af..15014813a1 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -1913,10 +1913,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { os << "UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP"; break; - case UR_DEVICE_INFO_BINDLESS_IMAGES_3D_USM_SUPPORT_EXP: - os << "UR_DEVICE_INFO_BINDLESS_IMAGES_3D_USM_SUPPORT_EXP"; - break; - case UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP: os << "UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP"; break; @@ -3567,20 +3563,6 @@ inline void serializeTagged(std::ostream &os, const void *ptr, os << ")"; } break; - case UR_DEVICE_INFO_BINDLESS_IMAGES_3D_USM_SUPPORT_EXP: { - const ur_bool_t *tptr = (const ur_bool_t *)ptr; - if (sizeof(ur_bool_t) > size) { - os << "invalid size (is: " << size - << ", expected: >=" << sizeof(ur_bool_t) << ")"; - return; - } - os << (void *)(tptr) << " ("; - - os << *tptr; - - os << ")"; - } break; - case UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP: { const uint32_t *tptr = (const uint32_t *)ptr; if (sizeof(uint32_t) > size) { @@ -9451,9 +9433,14 @@ operator<<(std::ostream &os, os << (params.maxMipmapLevelClamp); os << ", "; - os << ".maxAnistropy = "; + os << ".maxAnisotropy = "; - os << (params.maxAnistropy); + os << (params.maxAnisotropy); + + os << ", "; + os << ".mipFilterMode = "; + + os << (params.mipFilterMode); os << "}"; return os; @@ -9566,6 +9553,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hImage = "; @@ -9583,6 +9575,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hImage = "; @@ -9599,6 +9596,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".pImageFormat = "; @@ -9625,6 +9627,11 @@ operator<<(std::ostream &os, ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hImageMem = "; @@ -9642,6 +9649,11 @@ operator<<(std::ostream &os, ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hImageMem = "; @@ -9678,6 +9690,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hImageMem = "; @@ -9715,9 +9732,9 @@ inline std::ostream & operator<<(std::ostream &os, const struct ur_bindless_images_image_copy_exp_params_t *params) { - os << ".hContext = "; + os << ".hQueue = "; - ur_params::serializePtr(os, *(params->phContext)); + ur_params::serializePtr(os, *(params->phQueue)); os << ", "; os << ".pDst = "; @@ -9745,6 +9762,26 @@ operator<<(std::ostream &os, ur_params::serializeFlag( os, *(params->pimageCopyFlags)); + os << ", "; + os << ".srcOffset = "; + + os << *(params->psrcOffset); + + os << ", "; + os << ".dstOffset = "; + + os << *(params->pdstOffset); + + os << ", "; + os << ".copyExtent = "; + + os << *(params->pcopyExtent); + + os << ", "; + os << ".hostExtent = "; + + os << *(params->phostExtent); + os << ", "; os << ".numEventsInWaitList = "; @@ -9805,6 +9842,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hImageMem = "; @@ -9831,6 +9873,11 @@ operator<<(std::ostream &os, ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hMem = "; @@ -9847,6 +9894,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".size = "; @@ -9873,6 +9925,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".pImageFormat = "; @@ -9904,6 +9961,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hInteropMem = "; @@ -9921,6 +9983,11 @@ operator<<(std::ostream &os, const struct ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".fileDescriptor = "; @@ -9943,6 +10010,11 @@ inline std::ostream &operator<<( ur_params::serializePtr(os, *(params->phContext)); + os << ", "; + os << ".hDevice = "; + + ur_params::serializePtr(os, *(params->phDevice)); + os << ", "; os << ".hInteropSemaphore = "; diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index dabbdbe485..9b6d6b34dc 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -4329,6 +4329,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -4340,12 +4341,13 @@ urBindlessImagesUnsampledImageHandleDestroyExp( } ur_bindless_images_unsampled_image_handle_destroy_exp_params_t params = { - &hContext, &hImage}; + &hContext, &hDevice, &hImage}; uint64_t instance = context.notify_begin( UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_HANDLE_DESTROY_EXP, "urBindlessImagesUnsampledImageHandleDestroyExp", ¶ms); - ur_result_t result = pfnUnsampledImageHandleDestroyExp(hContext, hImage); + ur_result_t result = + pfnUnsampledImageHandleDestroyExp(hContext, hDevice, hImage); context.notify_end( UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_HANDLE_DESTROY_EXP, @@ -4360,6 +4362,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -4371,12 +4374,13 @@ urBindlessImagesSampledImageHandleDestroyExp( } ur_bindless_images_sampled_image_handle_destroy_exp_params_t params = { - &hContext, &hImage}; + &hContext, &hDevice, &hImage}; uint64_t instance = context.notify_begin( UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_HANDLE_DESTROY_EXP, "urBindlessImagesSampledImageHandleDestroyExp", ¶ms); - ur_result_t result = pfnSampledImageHandleDestroyExp(hContext, hImage); + ur_result_t result = + pfnSampledImageHandleDestroyExp(hContext, hDevice, hImage); context.notify_end( UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_HANDLE_DESTROY_EXP, @@ -4390,6 +4394,7 @@ urBindlessImagesSampledImageHandleDestroyExp( /// @brief Intercept function for urBindlessImagesImageAllocateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -4404,13 +4409,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( } ur_bindless_images_image_allocate_exp_params_t params = { - &hContext, &pImageFormat, &pImageDesc, &phImageMem}; + &hContext, &hDevice, &pImageFormat, &pImageDesc, &phImageMem}; uint64_t instance = context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_IMAGE_ALLOCATE_EXP, "urBindlessImagesImageAllocateExp", ¶ms); - ur_result_t result = - pfnImageAllocateExp(hContext, pImageFormat, pImageDesc, phImageMem); + ur_result_t result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, + pImageDesc, phImageMem); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_IMAGE_ALLOCATE_EXP, "urBindlessImagesImageAllocateExp", ¶ms, &result, @@ -4423,6 +4428,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( /// @brief Intercept function for urBindlessImagesImageFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed ) { @@ -4432,12 +4438,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - ur_bindless_images_image_free_exp_params_t params = {&hContext, &hImageMem}; + ur_bindless_images_image_free_exp_params_t params = {&hContext, &hDevice, + &hImageMem}; uint64_t instance = context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_IMAGE_FREE_EXP, "urBindlessImagesImageFreeExp", ¶ms); - ur_result_t result = pfnImageFreeExp(hContext, hImageMem); + ur_result_t result = pfnImageFreeExp(hContext, hDevice, hImageMem); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_IMAGE_FREE_EXP, "urBindlessImagesImageFreeExp", ¶ms, &result, @@ -4450,6 +4457,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// @brief Intercept function for urBindlessImagesUnsampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -4467,13 +4475,14 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( } ur_bindless_images_unsampled_image_create_exp_params_t params = { - &hContext, &hImageMem, &pImageFormat, &pImageDesc, &phMem, &phImage}; + &hContext, &hDevice, &hImageMem, &pImageFormat, + &pImageDesc, &phMem, &phImage}; uint64_t instance = context.notify_begin( UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_CREATE_EXP, "urBindlessImagesUnsampledImageCreateExp", ¶ms); ur_result_t result = pfnUnsampledImageCreateExp( - hContext, hImageMem, pImageFormat, pImageDesc, phMem, phImage); + hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phMem, phImage); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_CREATE_EXP, "urBindlessImagesUnsampledImageCreateExp", ¶ms, @@ -4486,6 +4495,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// @brief Intercept function for urBindlessImagesSampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -4504,15 +4514,15 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( } ur_bindless_images_sampled_image_create_exp_params_t params = { - &hContext, &hImageMem, &pImageFormat, &pImageDesc, - &hSampler, &phMem, &phImage}; + &hContext, &hDevice, &hImageMem, &pImageFormat, + &pImageDesc, &hSampler, &phMem, &phImage}; uint64_t instance = context.notify_begin( UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_CREATE_EXP, "urBindlessImagesSampledImageCreateExp", ¶ms); ur_result_t result = - pfnSampledImageCreateExp(hContext, hImageMem, pImageFormat, pImageDesc, - hSampler, phMem, phImage); + pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, + pImageDesc, hSampler, phMem, phImage); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_CREATE_EXP, "urBindlessImagesSampledImageCreateExp", ¶ms, @@ -4524,14 +4534,26 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urBindlessImagesImageCopyExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pDst, ///< [in] location the data will be copied to - void *pSrc, ///< [in] location the data will be copied from + ur_queue_handle_t hQueue, ///< [in] handle of the queue object + void *pDst, ///< [in] location the data will be copied to + void *pSrc, ///< [in] location the data will be copied from const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_copy_flags_t imageCopyFlags, ///< [in] flags describing copy direction e.g. H2D or D2H + ur_rect_offset_t + srcOffset, ///< [in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D + ///< image + ur_rect_offset_t + dstOffset, ///< [in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, + ///< or 3D image + ur_rect_region_t + copyExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region to copy + ur_rect_region_t + hostExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region on the host uint32_t numEventsInWaitList, ///< [in] size of the event wait list const ur_event_handle_t * phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of @@ -4549,12 +4571,16 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - ur_bindless_images_image_copy_exp_params_t params = {&hContext, + ur_bindless_images_image_copy_exp_params_t params = {&hQueue, &pDst, &pSrc, &pImageFormat, &pImageDesc, &imageCopyFlags, + &srcOffset, + &dstOffset, + ©Extent, + &hostExtent, &numEventsInWaitList, &phEventWaitList, &phEvent}; @@ -4563,8 +4589,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( "urBindlessImagesImageCopyExp", ¶ms); ur_result_t result = pfnImageCopyExp( - hContext, pDst, pSrc, pImageFormat, pImageDesc, imageCopyFlags, - numEventsInWaitList, phEventWaitList, phEvent); + hQueue, pDst, pSrc, pImageFormat, pImageDesc, imageCopyFlags, srcOffset, + dstOffset, copyExtent, hostExtent, numEventsInWaitList, phEventWaitList, + phEvent); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_IMAGE_COPY_EXP, "urBindlessImagesImageCopyExp", ¶ms, &result, @@ -4608,6 +4635,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// @brief Intercept function for urBindlessImagesMipmapGetLevelExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] memory handle to the mipmap image uint32_t mipmapLevel, ///< [in] requested level of the mipmap @@ -4622,13 +4650,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( } ur_bindless_images_mipmap_get_level_exp_params_t params = { - &hContext, &hImageMem, &mipmapLevel, &phImageMem}; + &hContext, &hDevice, &hImageMem, &mipmapLevel, &phImageMem}; uint64_t instance = context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_GET_LEVEL_EXP, "urBindlessImagesMipmapGetLevelExp", ¶ms); - ur_result_t result = - pfnMipmapGetLevelExp(hContext, hImageMem, mipmapLevel, phImageMem); + ur_result_t result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, + mipmapLevel, phImageMem); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_GET_LEVEL_EXP, "urBindlessImagesMipmapGetLevelExp", ¶ms, &result, @@ -4641,6 +4669,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( /// @brief Intercept function for urBindlessImagesMipmapFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed ) { auto pfnMipmapFreeExp = @@ -4650,12 +4679,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - ur_bindless_images_mipmap_free_exp_params_t params = {&hContext, &hMem}; + ur_bindless_images_mipmap_free_exp_params_t params = {&hContext, &hDevice, + &hMem}; uint64_t instance = context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_FREE_EXP, "urBindlessImagesMipmapFreeExp", ¶ms); - ur_result_t result = pfnMipmapFreeExp(hContext, hMem); + ur_result_t result = pfnMipmapFreeExp(hContext, hDevice, hMem); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_FREE_EXP, "urBindlessImagesMipmapFreeExp", ¶ms, &result, @@ -4668,6 +4698,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// @brief Intercept function for urBindlessImagesImportOpaqueFDExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object size_t size, ///< [in] size of the external memory uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_mem_handle_t @@ -4681,13 +4712,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( } ur_bindless_images_import_opaque_fd_exp_params_t params = { - &hContext, &size, &fileDescriptor, &phInteropMem}; + &hContext, &hDevice, &size, &fileDescriptor, &phInteropMem}; uint64_t instance = context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_IMPORT_OPAQUE_FD_EXP, "urBindlessImagesImportOpaqueFDExp", ¶ms); - ur_result_t result = - pfnImportOpaqueFDExp(hContext, size, fileDescriptor, phInteropMem); + ur_result_t result = pfnImportOpaqueFDExp(hContext, hDevice, size, + fileDescriptor, phInteropMem); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_IMPORT_OPAQUE_FD_EXP, "urBindlessImagesImportOpaqueFDExp", ¶ms, &result, @@ -4700,12 +4731,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// @brief Intercept function for urBindlessImagesMapExternalArrayExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_interop_mem_handle_t hInteropMem, ///< [in] interop memory handle to the external memory - ur_exp_image_handle_t * + ur_exp_image_mem_handle_t * phImageMem ///< [out] image memory handle to the externally allocated memory ) { auto pfnMapExternalArrayExp = @@ -4716,13 +4748,14 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( } ur_bindless_images_map_external_array_exp_params_t params = { - &hContext, &pImageFormat, &pImageDesc, &hInteropMem, &phImageMem}; + &hContext, &hDevice, &pImageFormat, + &pImageDesc, &hInteropMem, &phImageMem}; uint64_t instance = context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_ARRAY_EXP, "urBindlessImagesMapExternalArrayExp", ¶ms); ur_result_t result = pfnMapExternalArrayExp( - hContext, pImageFormat, pImageDesc, hInteropMem, phImageMem); + hContext, hDevice, pImageFormat, pImageDesc, hInteropMem, phImageMem); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_ARRAY_EXP, "urBindlessImagesMapExternalArrayExp", ¶ms, &result, @@ -4735,6 +4768,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( /// @brief Intercept function for urBindlessImagesReleaseInteropExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed ) { @@ -4745,13 +4779,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - ur_bindless_images_release_interop_exp_params_t params = {&hContext, - &hInteropMem}; + ur_bindless_images_release_interop_exp_params_t params = { + &hContext, &hDevice, &hInteropMem}; uint64_t instance = context.notify_begin(UR_FUNCTION_BINDLESS_IMAGES_RELEASE_INTEROP_EXP, "urBindlessImagesReleaseInteropExp", ¶ms); - ur_result_t result = pfnReleaseInteropExp(hContext, hInteropMem); + ur_result_t result = pfnReleaseInteropExp(hContext, hDevice, hInteropMem); context.notify_end(UR_FUNCTION_BINDLESS_IMAGES_RELEASE_INTEROP_EXP, "urBindlessImagesReleaseInteropExp", ¶ms, &result, @@ -4765,6 +4799,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_semaphore_handle_t * phInteropSemaphoreHandle ///< [out] interop semaphore handle to the external semaphore @@ -4778,13 +4813,13 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( } ur_bindless_images_import_external_semaphore_opaque_fd_exp_params_t params = - {&hContext, &fileDescriptor, &phInteropSemaphoreHandle}; + {&hContext, &hDevice, &fileDescriptor, &phInteropSemaphoreHandle}; uint64_t instance = context.notify_begin( UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_OPAQUE_FD_EXP, "urBindlessImagesImportExternalSemaphoreOpaqueFDExp", ¶ms); ur_result_t result = pfnImportExternalSemaphoreOpaqueFDExp( - hContext, fileDescriptor, phInteropSemaphoreHandle); + hContext, hDevice, fileDescriptor, phInteropSemaphoreHandle); context.notify_end( UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_OPAQUE_FD_EXP, @@ -4798,6 +4833,7 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( /// @brief Intercept function for urBindlessImagesDestroyExternalSemaphoreExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed ) { @@ -4809,13 +4845,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( } ur_bindless_images_destroy_external_semaphore_exp_params_t params = { - &hContext, &hInteropSemaphore}; + &hContext, &hDevice, &hInteropSemaphore}; uint64_t instance = context.notify_begin( UR_FUNCTION_BINDLESS_IMAGES_DESTROY_EXTERNAL_SEMAPHORE_EXP, "urBindlessImagesDestroyExternalSemaphoreExp", ¶ms); ur_result_t result = - pfnDestroyExternalSemaphoreExp(hContext, hInteropSemaphore); + pfnDestroyExternalSemaphoreExp(hContext, hDevice, hInteropSemaphore); context.notify_end( UR_FUNCTION_BINDLESS_IMAGES_DESTROY_EXTERNAL_SEMAPHORE_EXP, diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 6a2c2f38c9..a2192d67e2 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -5459,6 +5459,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -5474,12 +5475,17 @@ urBindlessImagesUnsampledImageHandleDestroyExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hImage) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } } - ur_result_t result = pfnUnsampledImageHandleDestroyExp(hContext, hImage); + ur_result_t result = + pfnUnsampledImageHandleDestroyExp(hContext, hDevice, hImage); return result; } @@ -5489,6 +5495,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -5504,12 +5511,17 @@ urBindlessImagesSampledImageHandleDestroyExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hImage) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } } - ur_result_t result = pfnSampledImageHandleDestroyExp(hContext, hImage); + ur_result_t result = + pfnSampledImageHandleDestroyExp(hContext, hDevice, hImage); return result; } @@ -5518,6 +5530,7 @@ urBindlessImagesSampledImageHandleDestroyExp( /// @brief Intercept function for urBindlessImagesImageAllocateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -5536,6 +5549,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == pImageFormat) { return UR_RESULT_ERROR_INVALID_NULL_POINTER; } @@ -5553,8 +5570,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( } } - ur_result_t result = - pfnImageAllocateExp(hContext, pImageFormat, pImageDesc, phImageMem); + ur_result_t result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, + pImageDesc, phImageMem); return result; } @@ -5563,6 +5580,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( /// @brief Intercept function for urBindlessImagesImageFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed ) { @@ -5577,12 +5595,16 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hImageMem) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } } - ur_result_t result = pfnImageFreeExp(hContext, hImageMem); + ur_result_t result = pfnImageFreeExp(hContext, hDevice, hImageMem); return result; } @@ -5591,6 +5613,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// @brief Intercept function for urBindlessImagesUnsampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -5612,6 +5635,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hImageMem) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } @@ -5638,7 +5665,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( } ur_result_t result = pfnUnsampledImageCreateExp( - hContext, hImageMem, pImageFormat, pImageDesc, phMem, phImage); + hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phMem, phImage); return result; } @@ -5647,6 +5674,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// @brief Intercept function for urBindlessImagesSampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -5669,6 +5697,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hImageMem) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } @@ -5699,8 +5731,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( } ur_result_t result = - pfnSampledImageCreateExp(hContext, hImageMem, pImageFormat, pImageDesc, - hSampler, phMem, phImage); + pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, + pImageDesc, hSampler, phMem, phImage); return result; } @@ -5708,14 +5740,26 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urBindlessImagesImageCopyExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pDst, ///< [in] location the data will be copied to - void *pSrc, ///< [in] location the data will be copied from + ur_queue_handle_t hQueue, ///< [in] handle of the queue object + void *pDst, ///< [in] location the data will be copied to + void *pSrc, ///< [in] location the data will be copied from const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_copy_flags_t imageCopyFlags, ///< [in] flags describing copy direction e.g. H2D or D2H + ur_rect_offset_t + srcOffset, ///< [in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D + ///< image + ur_rect_offset_t + dstOffset, ///< [in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, + ///< or 3D image + ur_rect_region_t + copyExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region to copy + ur_rect_region_t + hostExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region on the host uint32_t numEventsInWaitList, ///< [in] size of the event wait list const ur_event_handle_t * phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of @@ -5734,7 +5778,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( } if (context.enableParameterValidation) { - if (NULL == hContext) { + if (NULL == hQueue) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } @@ -5764,8 +5808,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( } ur_result_t result = pfnImageCopyExp( - hContext, pDst, pSrc, pImageFormat, pImageDesc, imageCopyFlags, - numEventsInWaitList, phEventWaitList, phEvent); + hQueue, pDst, pSrc, pImageFormat, pImageDesc, imageCopyFlags, srcOffset, + dstOffset, copyExtent, hostExtent, numEventsInWaitList, phEventWaitList, + phEvent); return result; } @@ -5809,6 +5854,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// @brief Intercept function for urBindlessImagesMipmapGetLevelExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] memory handle to the mipmap image uint32_t mipmapLevel, ///< [in] requested level of the mipmap @@ -5827,6 +5873,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hImageMem) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } @@ -5836,8 +5886,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( } } - ur_result_t result = - pfnMipmapGetLevelExp(hContext, hImageMem, mipmapLevel, phImageMem); + ur_result_t result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, + mipmapLevel, phImageMem); return result; } @@ -5846,6 +5896,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( /// @brief Intercept function for urBindlessImagesMipmapFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed ) { auto pfnMipmapFreeExp = @@ -5860,12 +5911,16 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hMem) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } } - ur_result_t result = pfnMipmapFreeExp(hContext, hMem); + ur_result_t result = pfnMipmapFreeExp(hContext, hDevice, hMem); return result; } @@ -5874,6 +5929,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// @brief Intercept function for urBindlessImagesImportOpaqueFDExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object size_t size, ///< [in] size of the external memory uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_mem_handle_t @@ -5891,13 +5947,17 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == phInteropMem) { return UR_RESULT_ERROR_INVALID_NULL_POINTER; } } - ur_result_t result = - pfnImportOpaqueFDExp(hContext, size, fileDescriptor, phInteropMem); + ur_result_t result = pfnImportOpaqueFDExp(hContext, hDevice, size, + fileDescriptor, phInteropMem); return result; } @@ -5906,12 +5966,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// @brief Intercept function for urBindlessImagesMapExternalArrayExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_interop_mem_handle_t hInteropMem, ///< [in] interop memory handle to the external memory - ur_exp_image_handle_t * + ur_exp_image_mem_handle_t * phImageMem ///< [out] image memory handle to the externally allocated memory ) { auto pfnMapExternalArrayExp = @@ -5926,6 +5987,10 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hInteropMem) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } @@ -5948,7 +6013,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( } ur_result_t result = pfnMapExternalArrayExp( - hContext, pImageFormat, pImageDesc, hInteropMem, phImageMem); + hContext, hDevice, pImageFormat, pImageDesc, hInteropMem, phImageMem); return result; } @@ -5957,6 +6022,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( /// @brief Intercept function for urBindlessImagesReleaseInteropExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed ) { @@ -5972,12 +6038,16 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hInteropMem) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } } - ur_result_t result = pfnReleaseInteropExp(hContext, hInteropMem); + ur_result_t result = pfnReleaseInteropExp(hContext, hDevice, hInteropMem); if (context.enableLeakChecking && result == UR_RESULT_SUCCESS) { refCountContext.decrementRefCount(hInteropMem); @@ -5991,6 +6061,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_semaphore_handle_t * phInteropSemaphoreHandle ///< [out] interop semaphore handle to the external semaphore @@ -6008,13 +6079,17 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == phInteropSemaphoreHandle) { return UR_RESULT_ERROR_INVALID_NULL_POINTER; } } ur_result_t result = pfnImportExternalSemaphoreOpaqueFDExp( - hContext, fileDescriptor, phInteropSemaphoreHandle); + hContext, hDevice, fileDescriptor, phInteropSemaphoreHandle); return result; } @@ -6023,6 +6098,7 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( /// @brief Intercept function for urBindlessImagesDestroyExternalSemaphoreExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed ) { @@ -6038,13 +6114,17 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } + if (NULL == hDevice) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (NULL == hInteropSemaphore) { return UR_RESULT_ERROR_INVALID_NULL_HANDLE; } } ur_result_t result = - pfnDestroyExternalSemaphoreExp(hContext, hInteropSemaphore); + pfnDestroyExternalSemaphoreExp(hContext, hDevice, hInteropSemaphore); return result; } diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index ded860ff5b..b7176acac2 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -5264,6 +5264,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -5280,11 +5281,14 @@ urBindlessImagesUnsampledImageHandleDestroyExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hImage = reinterpret_cast(hImage)->handle; // forward to device-platform - result = pfnUnsampledImageHandleDestroyExp(hContext, hImage); + result = pfnUnsampledImageHandleDestroyExp(hContext, hDevice, hImage); return result; } @@ -5294,6 +5298,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -5310,11 +5315,14 @@ urBindlessImagesSampledImageHandleDestroyExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hImage = reinterpret_cast(hImage)->handle; // forward to device-platform - result = pfnSampledImageHandleDestroyExp(hContext, hImage); + result = pfnSampledImageHandleDestroyExp(hContext, hDevice, hImage); return result; } @@ -5323,6 +5331,7 @@ urBindlessImagesSampledImageHandleDestroyExp( /// @brief Intercept function for urBindlessImagesImageAllocateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -5342,9 +5351,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // forward to device-platform - result = - pfnImageAllocateExp(hContext, pImageFormat, pImageDesc, phImageMem); + result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, pImageDesc, + phImageMem); if (UR_RESULT_SUCCESS != result) { return result; @@ -5365,6 +5377,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( /// @brief Intercept function for urBindlessImagesImageFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed ) { @@ -5380,12 +5393,15 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hImageMem = reinterpret_cast(hImageMem)->handle; // forward to device-platform - result = pfnImageFreeExp(hContext, hImageMem); + result = pfnImageFreeExp(hContext, hDevice, hImageMem); return result; } @@ -5394,6 +5410,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// @brief Intercept function for urBindlessImagesUnsampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -5416,13 +5433,16 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hImageMem = reinterpret_cast(hImageMem)->handle; // forward to device-platform - result = pfnUnsampledImageCreateExp(hContext, hImageMem, pImageFormat, - pImageDesc, phMem, phImage); + result = pfnUnsampledImageCreateExp( + hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phMem, phImage); if (UR_RESULT_SUCCESS != result) { return result; @@ -5451,6 +5471,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// @brief Intercept function for urBindlessImagesSampledImageCreateExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -5474,6 +5495,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hImageMem = reinterpret_cast(hImageMem)->handle; @@ -5482,8 +5506,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( hSampler = reinterpret_cast(hSampler)->handle; // forward to device-platform - result = pfnSampledImageCreateExp(hContext, hImageMem, pImageFormat, - pImageDesc, hSampler, phMem, phImage); + result = + pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, + pImageDesc, hSampler, phMem, phImage); if (UR_RESULT_SUCCESS != result) { return result; @@ -5511,14 +5536,26 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urBindlessImagesImageCopyExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pDst, ///< [in] location the data will be copied to - void *pSrc, ///< [in] location the data will be copied from + ur_queue_handle_t hQueue, ///< [in] handle of the queue object + void *pDst, ///< [in] location the data will be copied to + void *pSrc, ///< [in] location the data will be copied from const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_copy_flags_t imageCopyFlags, ///< [in] flags describing copy direction e.g. H2D or D2H + ur_rect_offset_t + srcOffset, ///< [in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D + ///< image + ur_rect_offset_t + dstOffset, ///< [in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, + ///< or 3D image + ur_rect_region_t + copyExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region to copy + ur_rect_region_t + hostExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region on the host uint32_t numEventsInWaitList, ///< [in] size of the event wait list const ur_event_handle_t * phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of @@ -5533,14 +5570,14 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( ur_result_t result = UR_RESULT_SUCCESS; // extract platform's function pointer table - auto dditable = reinterpret_cast(hContext)->dditable; + auto dditable = reinterpret_cast(hQueue)->dditable; auto pfnImageCopyExp = dditable->ur.BindlessImagesExp.pfnImageCopyExp; if (nullptr == pfnImageCopyExp) { return UR_RESULT_ERROR_UNINITIALIZED; } // convert loader handle to platform handle - hContext = reinterpret_cast(hContext)->handle; + hQueue = reinterpret_cast(hQueue)->handle; // convert loader handles to platform handles auto phEventWaitListLocal = @@ -5551,8 +5588,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( } // forward to device-platform - result = pfnImageCopyExp(hContext, pDst, pSrc, pImageFormat, pImageDesc, - imageCopyFlags, numEventsInWaitList, + result = pfnImageCopyExp(hQueue, pDst, pSrc, pImageFormat, pImageDesc, + imageCopyFlags, srcOffset, dstOffset, copyExtent, + hostExtent, numEventsInWaitList, phEventWaitListLocal.data(), phEvent); if (UR_RESULT_SUCCESS != result) { @@ -5604,6 +5642,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// @brief Intercept function for urBindlessImagesMipmapGetLevelExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] memory handle to the mipmap image uint32_t mipmapLevel, ///< [in] requested level of the mipmap @@ -5623,12 +5662,16 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hImageMem = reinterpret_cast(hImageMem)->handle; // forward to device-platform - result = pfnMipmapGetLevelExp(hContext, hImageMem, mipmapLevel, phImageMem); + result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, mipmapLevel, + phImageMem); if (UR_RESULT_SUCCESS != result) { return result; @@ -5649,6 +5692,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( /// @brief Intercept function for urBindlessImagesMipmapFreeExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -5663,11 +5707,14 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hMem = reinterpret_cast(hMem)->handle; // forward to device-platform - result = pfnMipmapFreeExp(hContext, hMem); + result = pfnMipmapFreeExp(hContext, hDevice, hMem); return result; } @@ -5676,6 +5723,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// @brief Intercept function for urBindlessImagesImportOpaqueFDExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object size_t size, ///< [in] size of the external memory uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_mem_handle_t @@ -5694,8 +5742,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // forward to device-platform - result = pfnImportOpaqueFDExp(hContext, size, fileDescriptor, phInteropMem); + result = pfnImportOpaqueFDExp(hContext, hDevice, size, fileDescriptor, + phInteropMem); if (UR_RESULT_SUCCESS != result) { return result; @@ -5716,12 +5768,13 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// @brief Intercept function for urBindlessImagesMapExternalArrayExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_interop_mem_handle_t hInteropMem, ///< [in] interop memory handle to the external memory - ur_exp_image_handle_t * + ur_exp_image_mem_handle_t * phImageMem ///< [out] image memory handle to the externally allocated memory ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -5737,12 +5790,15 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hInteropMem = reinterpret_cast(hInteropMem)->handle; // forward to device-platform - result = pfnMapExternalArrayExp(hContext, pImageFormat, pImageDesc, + result = pfnMapExternalArrayExp(hContext, hDevice, pImageFormat, pImageDesc, hInteropMem, phImageMem); if (UR_RESULT_SUCCESS != result) { @@ -5751,8 +5807,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( try { // convert platform handle to loader handle - *phImageMem = reinterpret_cast( - ur_exp_image_factory.getInstance(*phImageMem, dditable)); + *phImageMem = reinterpret_cast( + ur_exp_image_mem_factory.getInstance(*phImageMem, dditable)); } catch (std::bad_alloc &) { result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY; } @@ -5764,6 +5820,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( /// @brief Intercept function for urBindlessImagesReleaseInteropExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed ) { @@ -5780,12 +5837,15 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hInteropMem = reinterpret_cast(hInteropMem)->handle; // forward to device-platform - result = pfnReleaseInteropExp(hContext, hInteropMem); + result = pfnReleaseInteropExp(hContext, hDevice, hInteropMem); return result; } @@ -5795,6 +5855,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_semaphore_handle_t * phInteropSemaphoreHandle ///< [out] interop semaphore handle to the external semaphore @@ -5812,9 +5873,12 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // forward to device-platform - result = pfnImportExternalSemaphoreOpaqueFDExp(hContext, fileDescriptor, - phInteropSemaphoreHandle); + result = pfnImportExternalSemaphoreOpaqueFDExp( + hContext, hDevice, fileDescriptor, phInteropSemaphoreHandle); if (UR_RESULT_SUCCESS != result) { return result; @@ -5837,6 +5901,7 @@ urBindlessImagesImportExternalSemaphoreOpaqueFDExp( /// @brief Intercept function for urBindlessImagesDestroyExternalSemaphoreExp __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed ) { @@ -5853,13 +5918,17 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( // convert loader handle to platform handle hContext = reinterpret_cast(hContext)->handle; + // convert loader handle to platform handle + hDevice = reinterpret_cast(hDevice)->handle; + // convert loader handle to platform handle hInteropSemaphore = reinterpret_cast(hInteropSemaphore) ->handle; // forward to device-platform - result = pfnDestroyExternalSemaphoreExp(hContext, hInteropSemaphore); + result = + pfnDestroyExternalSemaphoreExp(hContext, hDevice, hInteropSemaphore); return result; } diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 3c2fef794a..aef555b1fa 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -5828,11 +5828,13 @@ ur_result_t UR_APICALL urUSMPitchedAllocExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImage` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) try { @@ -5843,7 +5845,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnUnsampledImageHandleDestroyExp(hContext, hImage); + return pfnUnsampledImageHandleDestroyExp(hContext, hDevice, hImage); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -5862,11 +5864,13 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImage` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) try { @@ -5877,7 +5881,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnSampledImageHandleDestroyExp(hContext, hImage); + return pfnSampledImageHandleDestroyExp(hContext, hDevice, hImage); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -5897,6 +5901,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` /// + `NULL == pImageDesc` @@ -5909,6 +5914,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -5921,7 +5927,8 @@ ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnImageAllocateExp(hContext, pImageFormat, pImageDesc, phImageMem); + return pfnImageAllocateExp(hContext, hDevice, pImageFormat, pImageDesc, + phImageMem); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -5940,11 +5947,13 @@ ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed ) try { @@ -5954,7 +5963,7 @@ ur_result_t UR_APICALL urBindlessImagesImageFreeExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnImageFreeExp(hContext, hImageMem); + return pfnImageFreeExp(hContext, hDevice, hImageMem); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -5973,6 +5982,7 @@ ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` @@ -5987,6 +5997,7 @@ ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -6003,8 +6014,8 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnUnsampledImageCreateExp(hContext, hImageMem, pImageFormat, - pImageDesc, phMem, phImage); + return pfnUnsampledImageCreateExp(hContext, hDevice, hImageMem, + pImageFormat, pImageDesc, phMem, phImage); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -6023,6 +6034,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// + `NULL == hSampler` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER @@ -6039,6 +6051,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -6055,7 +6068,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnSampledImageCreateExp(hContext, hImageMem, pImageFormat, + return pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, pImageDesc, hSampler, phMem, phImage); } catch (...) { return exceptionToResult(std::current_exception()); @@ -6077,7 +6090,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /// - ::UR_RESULT_ERROR_DEVICE_LOST /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hContext` +/// + `NULL == hQueue` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pDst` /// + `NULL == pSrc` @@ -6085,21 +6098,33 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /// + `NULL == pImageDesc` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION /// + `::UR_EXP_IMAGE_COPY_FLAGS_MASK & imageCopyFlags` -/// - ::UR_RESULT_ERROR_INVALID_CONTEXT +/// - ::UR_RESULT_ERROR_INVALID_QUEUE /// - ::UR_RESULT_ERROR_INVALID_VALUE /// - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR /// + `pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type` /// - ::UR_RESULT_ERROR_INVALID_IMAGE_SIZE /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pDst, ///< [in] location the data will be copied to - void *pSrc, ///< [in] location the data will be copied from + ur_queue_handle_t hQueue, ///< [in] handle of the queue object + void *pDst, ///< [in] location the data will be copied to + void *pSrc, ///< [in] location the data will be copied from const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_copy_flags_t imageCopyFlags, ///< [in] flags describing copy direction e.g. H2D or D2H + ur_rect_offset_t + srcOffset, ///< [in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D + ///< image + ur_rect_offset_t + dstOffset, ///< [in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, + ///< or 3D image + ur_rect_region_t + copyExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region to copy + ur_rect_region_t + hostExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region on the host uint32_t numEventsInWaitList, ///< [in] size of the event wait list const ur_event_handle_t * phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of @@ -6117,8 +6142,9 @@ ur_result_t UR_APICALL urBindlessImagesImageCopyExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnImageCopyExp(hContext, pDst, pSrc, pImageFormat, pImageDesc, - imageCopyFlags, numEventsInWaitList, phEventWaitList, + return pfnImageCopyExp(hQueue, pDst, pSrc, pImageFormat, pImageDesc, + imageCopyFlags, srcOffset, dstOffset, copyExtent, + hostExtent, numEventsInWaitList, phEventWaitList, phEvent); } catch (...) { return exceptionToResult(std::current_exception()); @@ -6176,6 +6202,7 @@ ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phImageMem` @@ -6183,6 +6210,7 @@ ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] memory handle to the mipmap image uint32_t mipmapLevel, ///< [in] requested level of the mipmap @@ -6195,7 +6223,8 @@ ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnMipmapGetLevelExp(hContext, hImageMem, mipmapLevel, phImageMem); + return pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, mipmapLevel, + phImageMem); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -6214,11 +6243,13 @@ ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed ) try { auto pfnMipmapFreeExp = @@ -6227,7 +6258,7 @@ ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnMipmapFreeExp(hContext, hMem); + return pfnMipmapFreeExp(hContext, hDevice, hMem); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -6246,6 +6277,7 @@ ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phInteropMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT @@ -6253,6 +6285,7 @@ ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// - ::UR_RESULT_ERROR_INVALID_MEM_OBJECT ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object size_t size, ///< [in] size of the external memory uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_mem_handle_t @@ -6264,7 +6297,8 @@ ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnImportOpaqueFDExp(hContext, size, fileDescriptor, phInteropMem); + return pfnImportOpaqueFDExp(hContext, hDevice, size, fileDescriptor, + phInteropMem); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -6279,6 +6313,7 @@ ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` @@ -6293,12 +6328,13 @@ ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_interop_mem_handle_t hInteropMem, ///< [in] interop memory handle to the external memory - ur_exp_image_handle_t * + ur_exp_image_mem_handle_t * phImageMem ///< [out] image memory handle to the externally allocated memory ) try { auto pfnMapExternalArrayExp = @@ -6307,7 +6343,7 @@ ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnMapExternalArrayExp(hContext, pImageFormat, pImageDesc, + return pfnMapExternalArrayExp(hContext, hDevice, pImageFormat, pImageDesc, hInteropMem, phImageMem); } catch (...) { return exceptionToResult(std::current_exception()); @@ -6327,11 +6363,13 @@ ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed ) try { @@ -6341,7 +6379,7 @@ ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnReleaseInteropExp(hContext, hInteropMem); + return pfnReleaseInteropExp(hContext, hDevice, hInteropMem); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -6360,12 +6398,14 @@ ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phInteropSemaphoreHandle` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_semaphore_handle_t * phInteropSemaphoreHandle ///< [out] interop semaphore handle to the external semaphore @@ -6377,8 +6417,8 @@ ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnImportExternalSemaphoreOpaqueFDExp(hContext, fileDescriptor, - phInteropSemaphoreHandle); + return pfnImportExternalSemaphoreOpaqueFDExp( + hContext, hDevice, fileDescriptor, phInteropSemaphoreHandle); } catch (...) { return exceptionToResult(std::current_exception()); } @@ -6397,11 +6437,13 @@ ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropSemaphore` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed ) try { @@ -6412,7 +6454,7 @@ ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( return UR_RESULT_ERROR_UNINITIALIZED; } - return pfnDestroyExternalSemaphoreExp(hContext, hInteropSemaphore); + return pfnDestroyExternalSemaphoreExp(hContext, hDevice, hInteropSemaphore); } catch (...) { return exceptionToResult(std::current_exception()); } diff --git a/source/ur_api.cpp b/source/ur_api.cpp index b13dfdb44c..e367cb7e8c 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -4930,11 +4930,13 @@ ur_result_t UR_APICALL urUSMPitchedAllocExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImage` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -4956,11 +4958,13 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImage` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_handle_t hImage ///< [in] pointer to handle of image object to destroy ) { @@ -4983,6 +4987,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` /// + `NULL == pImageDesc` @@ -4995,6 +5000,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageHandleDestroyExp( /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description @@ -5019,11 +5025,13 @@ ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesImageFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem ///< [in] handle of image memory to be freed ) { @@ -5045,6 +5053,7 @@ ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` @@ -5059,6 +5068,7 @@ ur_result_t UR_APICALL urBindlessImagesImageFreeExp( /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -5086,6 +5096,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// + `NULL == hSampler` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER @@ -5102,6 +5113,7 @@ ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] handle to memory from which to create the image const ur_image_format_t @@ -5132,7 +5144,7 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /// - ::UR_RESULT_ERROR_DEVICE_LOST /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hContext` +/// + `NULL == hQueue` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pDst` /// + `NULL == pSrc` @@ -5140,21 +5152,33 @@ ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( /// + `NULL == pImageDesc` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION /// + `::UR_EXP_IMAGE_COPY_FLAGS_MASK & imageCopyFlags` -/// - ::UR_RESULT_ERROR_INVALID_CONTEXT +/// - ::UR_RESULT_ERROR_INVALID_QUEUE /// - ::UR_RESULT_ERROR_INVALID_VALUE /// - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR /// + `pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type` /// - ::UR_RESULT_ERROR_INVALID_IMAGE_SIZE /// - ::UR_RESULT_ERROR_INVALID_OPERATION ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pDst, ///< [in] location the data will be copied to - void *pSrc, ///< [in] location the data will be copied from + ur_queue_handle_t hQueue, ///< [in] handle of the queue object + void *pDst, ///< [in] location the data will be copied to + void *pSrc, ///< [in] location the data will be copied from const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_image_copy_flags_t imageCopyFlags, ///< [in] flags describing copy direction e.g. H2D or D2H + ur_rect_offset_t + srcOffset, ///< [in] defines the (x,y,z) source offset in pixels in the 1D, 2D, or 3D + ///< image + ur_rect_offset_t + dstOffset, ///< [in] defines the (x,y,z) destination offset in pixels in the 1D, 2D, + ///< or 3D image + ur_rect_region_t + copyExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region to copy + ur_rect_region_t + hostExtent, ///< [in] defines the (width, height, depth) in pixels of the 1D, 2D, or 3D + ///< region on the host uint32_t numEventsInWaitList, ///< [in] size of the event wait list const ur_event_handle_t * phEventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] pointer to a list of @@ -5215,6 +5239,7 @@ ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hImageMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phImageMem` @@ -5222,6 +5247,7 @@ ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hImageMem, ///< [in] memory handle to the mipmap image uint32_t mipmapLevel, ///< [in] requested level of the mipmap @@ -5246,11 +5272,13 @@ ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_image_mem_handle_t hMem ///< [in] handle of image memory to be freed ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -5271,6 +5299,7 @@ ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phInteropMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT @@ -5278,6 +5307,7 @@ ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( /// - ::UR_RESULT_ERROR_INVALID_MEM_OBJECT ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object size_t size, ///< [in] size of the external memory uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_mem_handle_t @@ -5297,6 +5327,7 @@ ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropMem` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == pImageFormat` @@ -5311,12 +5342,13 @@ ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_image_format_t *pImageFormat, ///< [in] pointer to image format specification const ur_image_desc_t *pImageDesc, ///< [in] pointer to image description ur_exp_interop_mem_handle_t hInteropMem, ///< [in] interop memory handle to the external memory - ur_exp_image_handle_t * + ur_exp_image_mem_handle_t * phImageMem ///< [out] image memory handle to the externally allocated memory ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -5337,11 +5369,13 @@ ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed ) { @@ -5363,12 +5397,14 @@ ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `NULL == phInteropSemaphoreHandle` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object uint32_t fileDescriptor, ///< [in] the file descriptor ur_exp_interop_semaphore_handle_t * phInteropSemaphoreHandle ///< [out] interop semaphore handle to the external semaphore @@ -5391,11 +5427,13 @@ ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreOpaqueFDExp( /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` +/// + `NULL == hDevice` /// + `NULL == hInteropSemaphore` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_VALUE ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( ur_context_handle_t hContext, ///< [in] handle of the context object + ur_device_handle_t hDevice, ///< [in] handle of the device object ur_exp_interop_semaphore_handle_t hInteropSemaphore ///< [in] handle of interop semaphore to be destroyed ) {