Skip to content

Commit be6d44d

Browse files
committed
Treat bindless images handle types as native handles
1 parent 9d3bce6 commit be6d44d

File tree

20 files changed

+390
-481
lines changed

20 files changed

+390
-481
lines changed

include/ur_api.h

+68-73
Large diffs are not rendered by default.

include/ur_ddi.h

+14-13
Original file line numberDiff line numberDiff line change
@@ -1531,14 +1531,14 @@ typedef ur_result_t(UR_APICALL *ur_pfnGetEnqueueExpProcAddrTable_t)(
15311531
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesUnsampledImageHandleDestroyExp_t)(
15321532
ur_context_handle_t,
15331533
ur_device_handle_t,
1534-
ur_exp_image_handle_t);
1534+
ur_exp_image_native_handle_t);
15351535

15361536
///////////////////////////////////////////////////////////////////////////////
15371537
/// @brief Function-pointer for urBindlessImagesSampledImageHandleDestroyExp
15381538
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesSampledImageHandleDestroyExp_t)(
15391539
ur_context_handle_t,
15401540
ur_device_handle_t,
1541-
ur_exp_image_handle_t);
1541+
ur_exp_image_native_handle_t);
15421542

15431543
///////////////////////////////////////////////////////////////////////////////
15441544
/// @brief Function-pointer for urBindlessImagesImageAllocateExp
@@ -1547,35 +1547,35 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageAllocateExp_t)(
15471547
ur_device_handle_t,
15481548
const ur_image_format_t *,
15491549
const ur_image_desc_t *,
1550-
ur_exp_image_mem_handle_t *);
1550+
ur_exp_image_mem_native_handle_t *);
15511551

15521552
///////////////////////////////////////////////////////////////////////////////
15531553
/// @brief Function-pointer for urBindlessImagesImageFreeExp
15541554
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageFreeExp_t)(
15551555
ur_context_handle_t,
15561556
ur_device_handle_t,
1557-
ur_exp_image_mem_handle_t);
1557+
ur_exp_image_mem_native_handle_t);
15581558

15591559
///////////////////////////////////////////////////////////////////////////////
15601560
/// @brief Function-pointer for urBindlessImagesUnsampledImageCreateExp
15611561
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesUnsampledImageCreateExp_t)(
15621562
ur_context_handle_t,
15631563
ur_device_handle_t,
1564-
ur_exp_image_mem_handle_t,
1564+
ur_exp_image_mem_native_handle_t,
15651565
const ur_image_format_t *,
15661566
const ur_image_desc_t *,
1567-
ur_exp_image_handle_t *);
1567+
ur_exp_image_native_handle_t *);
15681568

15691569
///////////////////////////////////////////////////////////////////////////////
15701570
/// @brief Function-pointer for urBindlessImagesSampledImageCreateExp
15711571
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesSampledImageCreateExp_t)(
15721572
ur_context_handle_t,
15731573
ur_device_handle_t,
1574-
ur_exp_image_mem_handle_t,
1574+
ur_exp_image_mem_native_handle_t,
15751575
const ur_image_format_t *,
15761576
const ur_image_desc_t *,
15771577
ur_sampler_handle_t,
1578-
ur_exp_image_handle_t *);
1578+
ur_exp_image_native_handle_t *);
15791579

15801580
///////////////////////////////////////////////////////////////////////////////
15811581
/// @brief Function-pointer for urBindlessImagesImageCopyExp
@@ -1597,7 +1597,8 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageCopyExp_t)(
15971597
///////////////////////////////////////////////////////////////////////////////
15981598
/// @brief Function-pointer for urBindlessImagesImageGetInfoExp
15991599
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageGetInfoExp_t)(
1600-
ur_exp_image_mem_handle_t,
1600+
ur_context_handle_t,
1601+
ur_exp_image_mem_native_handle_t,
16011602
ur_image_info_t,
16021603
void *,
16031604
size_t *);
@@ -1607,16 +1608,16 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesImageGetInfoExp_t)(
16071608
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesMipmapGetLevelExp_t)(
16081609
ur_context_handle_t,
16091610
ur_device_handle_t,
1610-
ur_exp_image_mem_handle_t,
1611+
ur_exp_image_mem_native_handle_t,
16111612
uint32_t,
1612-
ur_exp_image_mem_handle_t *);
1613+
ur_exp_image_mem_native_handle_t *);
16131614

16141615
///////////////////////////////////////////////////////////////////////////////
16151616
/// @brief Function-pointer for urBindlessImagesMipmapFreeExp
16161617
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesMipmapFreeExp_t)(
16171618
ur_context_handle_t,
16181619
ur_device_handle_t,
1619-
ur_exp_image_mem_handle_t);
1620+
ur_exp_image_mem_native_handle_t);
16201621

16211622
///////////////////////////////////////////////////////////////////////////////
16221623
/// @brief Function-pointer for urBindlessImagesImportExternalMemoryExp
@@ -1636,7 +1637,7 @@ typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesMapExternalArrayExp_t)(
16361637
const ur_image_format_t *,
16371638
const ur_image_desc_t *,
16381639
ur_exp_interop_mem_handle_t,
1639-
ur_exp_image_mem_handle_t *);
1640+
ur_exp_image_mem_native_handle_t *);
16401641

16411642
///////////////////////////////////////////////////////////////////////////////
16421643
/// @brief Function-pointer for urBindlessImagesReleaseInteropExp

include/ur_print.hpp

+24-22
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ struct is_handle<ur_kernel_handle_t> : std::true_type {};
3939
template <>
4040
struct is_handle<ur_queue_handle_t> : std::true_type {};
4141
template <>
42-
struct is_handle<ur_native_handle_t> : std::true_type {};
43-
template <>
4442
struct is_handle<ur_sampler_handle_t> : std::true_type {};
4543
template <>
4644
struct is_handle<ur_mem_handle_t> : std::true_type {};
@@ -49,14 +47,12 @@ struct is_handle<ur_physical_mem_handle_t> : std::true_type {};
4947
template <>
5048
struct is_handle<ur_usm_pool_handle_t> : std::true_type {};
5149
template <>
52-
struct is_handle<ur_exp_image_handle_t> : std::true_type {};
53-
template <>
54-
struct is_handle<ur_exp_image_mem_handle_t> : std::true_type {};
55-
template <>
5650
struct is_handle<ur_exp_interop_mem_handle_t> : std::true_type {};
5751
template <>
5852
struct is_handle<ur_exp_interop_semaphore_handle_t> : std::true_type {};
5953
template <>
54+
struct is_handle<ur_exp_win32_handle_t> : std::true_type {};
55+
template <>
6056
struct is_handle<ur_exp_command_buffer_handle_t> : std::true_type {};
6157
template <>
6258
struct is_handle<ur_exp_command_buffer_command_handle_t> : std::true_type {};
@@ -14646,8 +14642,8 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1464614642
os << ", ";
1464714643
os << ".hImage = ";
1464814644

14649-
ur::details::printPtr(os,
14650-
*(params->phImage));
14645+
ur::details::printPtr(os, reinterpret_cast<void *>(
14646+
*(params->phImage)));
1465114647

1465214648
return os;
1465314649
}
@@ -14672,8 +14668,8 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1467214668
os << ", ";
1467314669
os << ".hImage = ";
1467414670

14675-
ur::details::printPtr(os,
14676-
*(params->phImage));
14671+
ur::details::printPtr(os, reinterpret_cast<void *>(
14672+
*(params->phImage)));
1467714673

1467814674
return os;
1467914675
}
@@ -14736,8 +14732,8 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1473614732
os << ", ";
1473714733
os << ".hImageMem = ";
1473814734

14739-
ur::details::printPtr(os,
14740-
*(params->phImageMem));
14735+
ur::details::printPtr(os, reinterpret_cast<void *>(
14736+
*(params->phImageMem)));
1474114737

1474214738
return os;
1474314739
}
@@ -14762,8 +14758,8 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1476214758
os << ", ";
1476314759
os << ".hImageMem = ";
1476414760

14765-
ur::details::printPtr(os,
14766-
*(params->phImageMem));
14761+
ur::details::printPtr(os, reinterpret_cast<void *>(
14762+
*(params->phImageMem)));
1476714763

1476814764
os << ", ";
1476914765
os << ".pImageFormat = ";
@@ -14806,8 +14802,8 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1480614802
os << ", ";
1480714803
os << ".hImageMem = ";
1480814804

14809-
ur::details::printPtr(os,
14810-
*(params->phImageMem));
14805+
ur::details::printPtr(os, reinterpret_cast<void *>(
14806+
*(params->phImageMem)));
1481114807

1481214808
os << ", ";
1481314809
os << ".pImageFormat = ";
@@ -14929,10 +14925,16 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1492914925
/// std::ostream &
1493014926
inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_bindless_images_image_get_info_exp_params_t *params) {
1493114927

14932-
os << ".hImageMem = ";
14928+
os << ".hContext = ";
1493314929

1493414930
ur::details::printPtr(os,
14935-
*(params->phImageMem));
14931+
*(params->phContext));
14932+
14933+
os << ", ";
14934+
os << ".hImageMem = ";
14935+
14936+
ur::details::printPtr(os, reinterpret_cast<void *>(
14937+
*(params->phImageMem)));
1493614938

1493714939
os << ", ";
1493814940
os << ".propName = ";
@@ -14974,8 +14976,8 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1497414976
os << ", ";
1497514977
os << ".hImageMem = ";
1497614978

14977-
ur::details::printPtr(os,
14978-
*(params->phImageMem));
14979+
ur::details::printPtr(os, reinterpret_cast<void *>(
14980+
*(params->phImageMem)));
1497914981

1498014982
os << ", ";
1498114983
os << ".mipmapLevel = ";
@@ -15011,8 +15013,8 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1501115013
os << ", ";
1501215014
os << ".hMem = ";
1501315015

15014-
ur::details::printPtr(os,
15015-
*(params->phMem));
15016+
ur::details::printPtr(os, reinterpret_cast<void *>(
15017+
*(params->phMem)));
1501615018

1501715019
return os;
1501815020
}

scripts/core/EXP-BINDLESS-IMAGES.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Enums
148148
Types
149149
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150150
* ${x}_exp_sampler_mip_properties_t
151-
* ${x}_exp_image_handle_t
152-
* ${x}_exp_image_mem_handle_t
151+
* ${x}_exp_image_native_handle_t
152+
* ${x}_exp_image_mem_native_handle_t
153153
* ${x}_exp_interop_mem_handle_t
154154
* ${x}_exp_interop_semaphore_handle_t
155155
* ${x}_exp_interop_mem_desc_t

0 commit comments

Comments
 (0)