triton-windows 3.3.1.post19__cp311-cp311-win_amd64.whl → 3.4.0.post20__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of triton-windows might be problematic. Click here for more details.

Files changed (166) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/__init__.py +4 -1
  3. triton/_filecheck.py +87 -0
  4. triton/_internal_testing.py +26 -15
  5. triton/_utils.py +110 -21
  6. triton/backends/__init__.py +20 -23
  7. triton/backends/amd/__init__.py +0 -0
  8. triton/backends/amd/compiler.py +112 -78
  9. triton/backends/amd/driver.c +5 -2
  10. triton/backends/amd/driver.py +149 -47
  11. triton/backends/compiler.py +7 -21
  12. triton/backends/nvidia/bin/ptxas.exe +0 -0
  13. triton/backends/nvidia/compiler.py +92 -93
  14. triton/backends/nvidia/driver.c +90 -98
  15. triton/backends/nvidia/driver.py +303 -128
  16. triton/compiler/code_generator.py +212 -111
  17. triton/compiler/compiler.py +110 -25
  18. triton/experimental/__init__.py +0 -0
  19. triton/experimental/gluon/__init__.py +4 -0
  20. triton/experimental/gluon/_compiler.py +0 -0
  21. triton/experimental/gluon/_runtime.py +99 -0
  22. triton/experimental/gluon/language/__init__.py +18 -0
  23. triton/experimental/gluon/language/_core.py +312 -0
  24. triton/experimental/gluon/language/_layouts.py +230 -0
  25. triton/experimental/gluon/language/_math.py +12 -0
  26. triton/experimental/gluon/language/_semantic.py +287 -0
  27. triton/experimental/gluon/language/_standard.py +47 -0
  28. triton/experimental/gluon/language/nvidia/__init__.py +4 -0
  29. triton/experimental/gluon/language/nvidia/blackwell/__init__.py +202 -0
  30. triton/experimental/gluon/language/nvidia/blackwell/tma.py +32 -0
  31. triton/experimental/gluon/language/nvidia/hopper/__init__.py +11 -0
  32. triton/experimental/gluon/language/nvidia/hopper/mbarrier.py +51 -0
  33. triton/experimental/gluon/language/nvidia/hopper/tma.py +96 -0
  34. triton/experimental/gluon/nvidia/__init__.py +4 -0
  35. triton/experimental/gluon/nvidia/blackwell.py +3 -0
  36. triton/experimental/gluon/nvidia/hopper.py +40 -0
  37. triton/knobs.py +481 -0
  38. triton/language/__init__.py +39 -14
  39. triton/language/core.py +794 -537
  40. triton/language/extra/cuda/__init__.py +10 -7
  41. triton/language/extra/cuda/gdc.py +42 -0
  42. triton/language/extra/cuda/libdevice.py +394 -394
  43. triton/language/extra/cuda/utils.py +21 -21
  44. triton/language/extra/hip/libdevice.py +113 -104
  45. triton/language/math.py +65 -66
  46. triton/language/random.py +12 -2
  47. triton/language/semantic.py +1706 -1770
  48. triton/language/standard.py +116 -51
  49. triton/runtime/autotuner.py +117 -59
  50. triton/runtime/build.py +76 -12
  51. triton/runtime/cache.py +18 -47
  52. triton/runtime/driver.py +32 -29
  53. triton/runtime/interpreter.py +72 -35
  54. triton/runtime/jit.py +146 -110
  55. triton/testing.py +16 -12
  56. triton/tools/disasm.py +3 -4
  57. triton/tools/tensor_descriptor.py +36 -0
  58. triton/windows_utils.py +14 -6
  59. {triton_windows-3.3.1.post19.dist-info → triton_windows-3.4.0.post20.dist-info}/METADATA +7 -2
  60. triton_windows-3.4.0.post20.dist-info/RECORD +186 -0
  61. triton_windows-3.4.0.post20.dist-info/entry_points.txt +3 -0
  62. triton_windows-3.4.0.post20.dist-info/licenses/LICENSE +23 -0
  63. triton_windows-3.4.0.post20.dist-info/top_level.txt +1 -0
  64. triton/backends/amd/include/hip/amd_detail/amd_channel_descriptor.h +0 -358
  65. triton/backends/amd/include/hip/amd_detail/amd_device_functions.h +0 -1010
  66. triton/backends/amd/include/hip/amd_detail/amd_hip_atomic.h +0 -1638
  67. triton/backends/amd/include/hip/amd_detail/amd_hip_bf16.h +0 -1814
  68. triton/backends/amd/include/hip/amd_detail/amd_hip_bfloat16.h +0 -293
  69. triton/backends/amd/include/hip/amd_detail/amd_hip_common.h +0 -32
  70. triton/backends/amd/include/hip/amd_detail/amd_hip_complex.h +0 -174
  71. triton/backends/amd/include/hip/amd_detail/amd_hip_cooperative_groups.h +0 -835
  72. triton/backends/amd/include/hip/amd_detail/amd_hip_fp16.h +0 -1809
  73. triton/backends/amd/include/hip/amd_detail/amd_hip_fp8.h +0 -1391
  74. triton/backends/amd/include/hip/amd_detail/amd_hip_gl_interop.h +0 -108
  75. triton/backends/amd/include/hip/amd_detail/amd_hip_math_constants.h +0 -124
  76. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime.h +0 -405
  77. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime_pt_api.h +0 -196
  78. triton/backends/amd/include/hip/amd_detail/amd_hip_unsafe_atomics.h +0 -565
  79. triton/backends/amd/include/hip/amd_detail/amd_hip_vector_types.h +0 -2226
  80. triton/backends/amd/include/hip/amd_detail/amd_math_functions.h +0 -104
  81. triton/backends/amd/include/hip/amd_detail/amd_surface_functions.h +0 -244
  82. triton/backends/amd/include/hip/amd_detail/amd_warp_functions.h +0 -538
  83. triton/backends/amd/include/hip/amd_detail/amd_warp_sync_functions.h +0 -288
  84. triton/backends/amd/include/hip/amd_detail/concepts.hpp +0 -30
  85. triton/backends/amd/include/hip/amd_detail/device_library_decls.h +0 -133
  86. triton/backends/amd/include/hip/amd_detail/functional_grid_launch.hpp +0 -218
  87. triton/backends/amd/include/hip/amd_detail/grid_launch.h +0 -67
  88. triton/backends/amd/include/hip/amd_detail/grid_launch.hpp +0 -50
  89. triton/backends/amd/include/hip/amd_detail/grid_launch_GGL.hpp +0 -26
  90. triton/backends/amd/include/hip/amd_detail/helpers.hpp +0 -137
  91. triton/backends/amd/include/hip/amd_detail/hip_api_trace.hpp +0 -1446
  92. triton/backends/amd/include/hip/amd_detail/hip_assert.h +0 -101
  93. triton/backends/amd/include/hip/amd_detail/hip_cooperative_groups_helper.h +0 -242
  94. triton/backends/amd/include/hip/amd_detail/hip_fp16_gcc.h +0 -254
  95. triton/backends/amd/include/hip/amd_detail/hip_fp16_math_fwd.h +0 -96
  96. triton/backends/amd/include/hip/amd_detail/hip_ldg.h +0 -100
  97. triton/backends/amd/include/hip/amd_detail/hip_prof_str.h +0 -10570
  98. triton/backends/amd/include/hip/amd_detail/hip_runtime_prof.h +0 -78
  99. triton/backends/amd/include/hip/amd_detail/host_defines.h +0 -184
  100. triton/backends/amd/include/hip/amd_detail/hsa_helpers.hpp +0 -102
  101. triton/backends/amd/include/hip/amd_detail/macro_based_grid_launch.hpp +0 -798
  102. triton/backends/amd/include/hip/amd_detail/math_fwd.h +0 -698
  103. triton/backends/amd/include/hip/amd_detail/ockl_image.h +0 -177
  104. triton/backends/amd/include/hip/amd_detail/program_state.hpp +0 -107
  105. triton/backends/amd/include/hip/amd_detail/texture_fetch_functions.h +0 -491
  106. triton/backends/amd/include/hip/amd_detail/texture_indirect_functions.h +0 -478
  107. triton/backends/amd/include/hip/channel_descriptor.h +0 -39
  108. triton/backends/amd/include/hip/device_functions.h +0 -38
  109. triton/backends/amd/include/hip/driver_types.h +0 -468
  110. triton/backends/amd/include/hip/hip_bf16.h +0 -36
  111. triton/backends/amd/include/hip/hip_bfloat16.h +0 -44
  112. triton/backends/amd/include/hip/hip_common.h +0 -100
  113. triton/backends/amd/include/hip/hip_complex.h +0 -38
  114. triton/backends/amd/include/hip/hip_cooperative_groups.h +0 -46
  115. triton/backends/amd/include/hip/hip_deprecated.h +0 -95
  116. triton/backends/amd/include/hip/hip_ext.h +0 -161
  117. triton/backends/amd/include/hip/hip_fp16.h +0 -36
  118. triton/backends/amd/include/hip/hip_fp8.h +0 -33
  119. triton/backends/amd/include/hip/hip_gl_interop.h +0 -32
  120. triton/backends/amd/include/hip/hip_hcc.h +0 -24
  121. triton/backends/amd/include/hip/hip_math_constants.h +0 -36
  122. triton/backends/amd/include/hip/hip_profile.h +0 -27
  123. triton/backends/amd/include/hip/hip_runtime.h +0 -75
  124. triton/backends/amd/include/hip/hip_runtime_api.h +0 -9261
  125. triton/backends/amd/include/hip/hip_texture_types.h +0 -29
  126. triton/backends/amd/include/hip/hip_vector_types.h +0 -41
  127. triton/backends/amd/include/hip/hip_version.h +0 -17
  128. triton/backends/amd/include/hip/hiprtc.h +0 -421
  129. triton/backends/amd/include/hip/library_types.h +0 -78
  130. triton/backends/amd/include/hip/math_functions.h +0 -42
  131. triton/backends/amd/include/hip/surface_types.h +0 -63
  132. triton/backends/amd/include/hip/texture_types.h +0 -194
  133. triton/backends/amd/include/hsa/Brig.h +0 -1131
  134. triton/backends/amd/include/hsa/amd_hsa_common.h +0 -91
  135. triton/backends/amd/include/hsa/amd_hsa_elf.h +0 -462
  136. triton/backends/amd/include/hsa/amd_hsa_kernel_code.h +0 -269
  137. triton/backends/amd/include/hsa/amd_hsa_queue.h +0 -109
  138. triton/backends/amd/include/hsa/amd_hsa_signal.h +0 -80
  139. triton/backends/amd/include/hsa/hsa.h +0 -5738
  140. triton/backends/amd/include/hsa/hsa_amd_tool.h +0 -91
  141. triton/backends/amd/include/hsa/hsa_api_trace.h +0 -579
  142. triton/backends/amd/include/hsa/hsa_api_trace_version.h +0 -68
  143. triton/backends/amd/include/hsa/hsa_ext_amd.h +0 -3146
  144. triton/backends/amd/include/hsa/hsa_ext_finalize.h +0 -531
  145. triton/backends/amd/include/hsa/hsa_ext_image.h +0 -1454
  146. triton/backends/amd/include/hsa/hsa_ven_amd_aqlprofile.h +0 -488
  147. triton/backends/amd/include/hsa/hsa_ven_amd_loader.h +0 -667
  148. triton/backends/amd/include/hsa/hsa_ven_amd_pc_sampling.h +0 -416
  149. triton/backends/amd/include/roctracer/ext/prof_protocol.h +0 -107
  150. triton/backends/amd/include/roctracer/hip_ostream_ops.h +0 -4515
  151. triton/backends/amd/include/roctracer/hsa_ostream_ops.h +0 -1727
  152. triton/backends/amd/include/roctracer/hsa_prof_str.h +0 -3059
  153. triton/backends/amd/include/roctracer/roctracer.h +0 -779
  154. triton/backends/amd/include/roctracer/roctracer_ext.h +0 -81
  155. triton/backends/amd/include/roctracer/roctracer_hcc.h +0 -24
  156. triton/backends/amd/include/roctracer/roctracer_hip.h +0 -37
  157. triton/backends/amd/include/roctracer/roctracer_hsa.h +0 -112
  158. triton/backends/amd/include/roctracer/roctracer_plugin.h +0 -137
  159. triton/backends/amd/include/roctracer/roctracer_roctx.h +0 -67
  160. triton/backends/amd/include/roctracer/roctx.h +0 -229
  161. triton/language/_utils.py +0 -21
  162. triton/language/extra/cuda/_experimental_tma.py +0 -106
  163. triton/tools/experimental_descriptor.py +0 -32
  164. triton_windows-3.3.1.post19.dist-info/RECORD +0 -260
  165. triton_windows-3.3.1.post19.dist-info/top_level.txt +0 -14
  166. {triton_windows-3.3.1.post19.dist-info → triton_windows-3.4.0.post20.dist-info}/WHEEL +0 -0
@@ -1,1454 +0,0 @@
1
- ////////////////////////////////////////////////////////////////////////////////
2
- //
3
- // The University of Illinois/NCSA
4
- // Open Source License (NCSA)
5
- //
6
- // Copyright (c) 2014-2020, Advanced Micro Devices, Inc. All rights reserved.
7
- //
8
- // Developed by:
9
- //
10
- // AMD Research and AMD HSA Software Development
11
- //
12
- // Advanced Micro Devices, Inc.
13
- //
14
- // www.amd.com
15
- //
16
- // Permission is hereby granted, free of charge, to any person obtaining a copy
17
- // of this software and associated documentation files (the "Software"), to
18
- // deal with the Software without restriction, including without limitation
19
- // the rights to use, copy, modify, merge, publish, distribute, sublicense,
20
- // and/or sell copies of the Software, and to permit persons to whom the
21
- // Software is furnished to do so, subject to the following conditions:
22
- //
23
- // - Redistributions of source code must retain the above copyright notice,
24
- // this list of conditions and the following disclaimers.
25
- // - Redistributions in binary form must reproduce the above copyright
26
- // notice, this list of conditions and the following disclaimers in
27
- // the documentation and/or other materials provided with the distribution.
28
- // - Neither the names of Advanced Micro Devices, Inc,
29
- // nor the names of its contributors may be used to endorse or promote
30
- // products derived from this Software without specific prior written
31
- // permission.
32
- //
33
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
36
- // THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
37
- // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
38
- // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
39
- // DEALINGS WITH THE SOFTWARE.
40
- //
41
- ////////////////////////////////////////////////////////////////////////////////
42
-
43
- #ifndef HSA_EXT_IMAGE_H
44
- #define HSA_EXT_IMAGE_H
45
-
46
- #include "hsa.h"
47
-
48
- #undef HSA_API
49
- #ifdef HSA_EXPORT_IMAGES
50
- #define HSA_API HSA_API_EXPORT
51
- #else
52
- #define HSA_API HSA_API_IMPORT
53
- #endif
54
-
55
- #ifdef __cplusplus
56
- extern "C" {
57
- #endif /*__cplusplus*/
58
-
59
- /** \defgroup ext-images Images and Samplers
60
- * @{
61
- */
62
-
63
- /**
64
- * @brief Enumeration constants added to ::hsa_status_t by this extension.
65
- *
66
- * @remark Additions to hsa_status_t
67
- */
68
- enum {
69
- /**
70
- * Image format is not supported.
71
- */
72
- HSA_EXT_STATUS_ERROR_IMAGE_FORMAT_UNSUPPORTED = 0x3000,
73
- /**
74
- * Image size is not supported.
75
- */
76
- HSA_EXT_STATUS_ERROR_IMAGE_SIZE_UNSUPPORTED = 0x3001,
77
- /**
78
- * Image pitch is not supported or invalid.
79
- */
80
- HSA_EXT_STATUS_ERROR_IMAGE_PITCH_UNSUPPORTED = 0x3002,
81
- /**
82
- * Sampler descriptor is not supported or invalid.
83
- */
84
- HSA_EXT_STATUS_ERROR_SAMPLER_DESCRIPTOR_UNSUPPORTED = 0x3003
85
- };
86
-
87
- /**
88
- * @brief Enumeration constants added to ::hsa_agent_info_t by this
89
- * extension.
90
- *
91
- * @remark Additions to hsa_agent_info_t
92
- */
93
- enum {
94
- /**
95
- * Maximum number of elements in 1D images. Must be at least 16384. The type
96
- * of this attribute is size_t.
97
- */
98
- HSA_EXT_AGENT_INFO_IMAGE_1D_MAX_ELEMENTS = 0x3000,
99
- /**
100
- * Maximum number of elements in 1DA images. Must be at least 16384. The type
101
- * of this attribute is size_t.
102
- */
103
- HSA_EXT_AGENT_INFO_IMAGE_1DA_MAX_ELEMENTS = 0x3001,
104
- /**
105
- * Maximum number of elements in 1DB images. Must be at least 65536. The type
106
- * of this attribute is size_t.
107
- */
108
- HSA_EXT_AGENT_INFO_IMAGE_1DB_MAX_ELEMENTS = 0x3002,
109
- /**
110
- * Maximum dimensions (width, height) of 2D images, in image elements. The X
111
- * and Y maximums must be at least 16384. The type of this attribute is
112
- * size_t[2].
113
- */
114
- HSA_EXT_AGENT_INFO_IMAGE_2D_MAX_ELEMENTS = 0x3003,
115
- /**
116
- * Maximum dimensions (width, height) of 2DA images, in image elements. The X
117
- * and Y maximums must be at least 16384. The type of this attribute is
118
- * size_t[2].
119
- */
120
- HSA_EXT_AGENT_INFO_IMAGE_2DA_MAX_ELEMENTS = 0x3004,
121
- /**
122
- * Maximum dimensions (width, height) of 2DDEPTH images, in image
123
- * elements. The X and Y maximums must be at least 16384. The type of this
124
- * attribute is size_t[2].
125
- */
126
- HSA_EXT_AGENT_INFO_IMAGE_2DDEPTH_MAX_ELEMENTS = 0x3005,
127
- /**
128
- * Maximum dimensions (width, height) of 2DADEPTH images, in image
129
- * elements. The X and Y maximums must be at least 16384. The type of this
130
- * attribute is size_t[2].
131
- */
132
- HSA_EXT_AGENT_INFO_IMAGE_2DADEPTH_MAX_ELEMENTS = 0x3006,
133
- /**
134
- * Maximum dimensions (width, height, depth) of 3D images, in image
135
- * elements. The maximum along any dimension must be at least 2048. The type
136
- * of this attribute is size_t[3].
137
- */
138
- HSA_EXT_AGENT_INFO_IMAGE_3D_MAX_ELEMENTS = 0x3007,
139
- /**
140
- * Maximum number of image layers in a image array. Must be at least 2048. The
141
- * type of this attribute is size_t.
142
- */
143
- HSA_EXT_AGENT_INFO_IMAGE_ARRAY_MAX_LAYERS = 0x3008,
144
- /**
145
- * Maximum number of read-only image handles that can be created for an agent at any one
146
- * time. Must be at least 128. The type of this attribute is size_t.
147
- */
148
- HSA_EXT_AGENT_INFO_MAX_IMAGE_RD_HANDLES = 0x3009,
149
- /**
150
- * Maximum number of write-only and read-write image handles (combined) that
151
- * can be created for an agent at any one time. Must be at least 64. The type of this
152
- * attribute is size_t.
153
- */
154
- HSA_EXT_AGENT_INFO_MAX_IMAGE_RORW_HANDLES = 0x300A,
155
- /**
156
- * Maximum number of sampler handlers that can be created for an agent at any one
157
- * time. Must be at least 16. The type of this attribute is size_t.
158
- */
159
- HSA_EXT_AGENT_INFO_MAX_SAMPLER_HANDLERS = 0x300B,
160
- /**
161
- * Image pitch alignment. The agent only supports linear image data
162
- * layouts with a row pitch that is a multiple of this value. Must be
163
- * a power of 2. The type of this attribute is size_t.
164
- */
165
- HSA_EXT_AGENT_INFO_IMAGE_LINEAR_ROW_PITCH_ALIGNMENT = 0x300C
166
- };
167
-
168
- /**
169
- * @brief Image handle, populated by ::hsa_ext_image_create or
170
- * ::hsa_ext_image_create_with_layout. Image
171
- * handles are only unique within an agent, not across agents.
172
- *
173
- */
174
- typedef struct hsa_ext_image_s {
175
- /**
176
- * Opaque handle. For a given agent, two handles reference the same object of
177
- * the enclosing type if and only if they are equal.
178
- */
179
- uint64_t handle;
180
-
181
- } hsa_ext_image_t;
182
-
183
- /**
184
- * @brief Geometry associated with the image. This specifies the
185
- * number of image dimensions and whether the image is an image
186
- * array. See the <em>Image Geometry</em> section in the <em>HSA
187
- * Programming Reference Manual</em> for definitions on each
188
- * geometry. The enumeration values match the BRIG type @p
189
- * hsa_ext_brig_image_geometry_t.
190
- */
191
- typedef enum {
192
- /**
193
- * One-dimensional image addressed by width coordinate.
194
- */
195
- HSA_EXT_IMAGE_GEOMETRY_1D = 0,
196
-
197
- /**
198
- * Two-dimensional image addressed by width and height coordinates.
199
- */
200
- HSA_EXT_IMAGE_GEOMETRY_2D = 1,
201
-
202
- /**
203
- * Three-dimensional image addressed by width, height, and depth coordinates.
204
- */
205
- HSA_EXT_IMAGE_GEOMETRY_3D = 2,
206
-
207
- /**
208
- * Array of one-dimensional images with the same size and format. 1D arrays
209
- * are addressed by width and index coordinate.
210
- */
211
- HSA_EXT_IMAGE_GEOMETRY_1DA = 3,
212
-
213
- /**
214
- * Array of two-dimensional images with the same size and format. 2D arrays
215
- * are addressed by width, height, and index coordinates.
216
- */
217
- HSA_EXT_IMAGE_GEOMETRY_2DA = 4,
218
-
219
- /**
220
- * One-dimensional image addressed by width coordinate. It has
221
- * specific restrictions compared to ::HSA_EXT_IMAGE_GEOMETRY_1D. An
222
- * image with an opaque image data layout will always use a linear
223
- * image data layout, and one with an explicit image data layout
224
- * must specify ::HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR.
225
- */
226
- HSA_EXT_IMAGE_GEOMETRY_1DB = 5,
227
-
228
- /**
229
- * Two-dimensional depth image addressed by width and height coordinates.
230
- */
231
- HSA_EXT_IMAGE_GEOMETRY_2DDEPTH = 6,
232
-
233
- /**
234
- * Array of two-dimensional depth images with the same size and format. 2D
235
- * arrays are addressed by width, height, and index coordinates.
236
- */
237
- HSA_EXT_IMAGE_GEOMETRY_2DADEPTH = 7
238
- } hsa_ext_image_geometry_t;
239
-
240
- /**
241
- * @brief Channel type associated with the elements of an image. See
242
- * the <em>Channel Type</em> section in the <em>HSA Programming Reference
243
- * Manual</em> for definitions on each channel type. The
244
- * enumeration values and definition match the BRIG type @p
245
- * hsa_ext_brig_image_channel_type_t.
246
- */
247
- typedef enum {
248
- HSA_EXT_IMAGE_CHANNEL_TYPE_SNORM_INT8 = 0,
249
- HSA_EXT_IMAGE_CHANNEL_TYPE_SNORM_INT16 = 1,
250
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT8 = 2,
251
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT16 = 3,
252
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT24 = 4,
253
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_SHORT_555 = 5,
254
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_SHORT_565 = 6,
255
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_SHORT_101010 = 7,
256
- HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT8 = 8,
257
- HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT16 = 9,
258
- HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT32 = 10,
259
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8 = 11,
260
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16 = 12,
261
- HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32 = 13,
262
- HSA_EXT_IMAGE_CHANNEL_TYPE_HALF_FLOAT = 14,
263
- HSA_EXT_IMAGE_CHANNEL_TYPE_FLOAT = 15
264
- } hsa_ext_image_channel_type_t;
265
-
266
- /**
267
- * @brief A fixed-size type used to represent ::hsa_ext_image_channel_type_t constants.
268
- */
269
- typedef uint32_t hsa_ext_image_channel_type32_t;
270
-
271
- /**
272
- *
273
- * @brief Channel order associated with the elements of an image. See
274
- * the <em>Channel Order</em> section in the <em>HSA Programming Reference
275
- * Manual</em> for definitions on each channel order. The
276
- * enumeration values match the BRIG type @p
277
- * hsa_ext_brig_image_channel_order_t.
278
- */
279
- typedef enum {
280
- HSA_EXT_IMAGE_CHANNEL_ORDER_A = 0,
281
- HSA_EXT_IMAGE_CHANNEL_ORDER_R = 1,
282
- HSA_EXT_IMAGE_CHANNEL_ORDER_RX = 2,
283
- HSA_EXT_IMAGE_CHANNEL_ORDER_RG = 3,
284
- HSA_EXT_IMAGE_CHANNEL_ORDER_RGX = 4,
285
- HSA_EXT_IMAGE_CHANNEL_ORDER_RA = 5,
286
- HSA_EXT_IMAGE_CHANNEL_ORDER_RGB = 6,
287
- HSA_EXT_IMAGE_CHANNEL_ORDER_RGBX = 7,
288
- HSA_EXT_IMAGE_CHANNEL_ORDER_RGBA = 8,
289
- HSA_EXT_IMAGE_CHANNEL_ORDER_BGRA = 9,
290
- HSA_EXT_IMAGE_CHANNEL_ORDER_ARGB = 10,
291
- HSA_EXT_IMAGE_CHANNEL_ORDER_ABGR = 11,
292
- HSA_EXT_IMAGE_CHANNEL_ORDER_SRGB = 12,
293
- HSA_EXT_IMAGE_CHANNEL_ORDER_SRGBX = 13,
294
- HSA_EXT_IMAGE_CHANNEL_ORDER_SRGBA = 14,
295
- HSA_EXT_IMAGE_CHANNEL_ORDER_SBGRA = 15,
296
- HSA_EXT_IMAGE_CHANNEL_ORDER_INTENSITY = 16,
297
- HSA_EXT_IMAGE_CHANNEL_ORDER_LUMINANCE = 17,
298
- HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH = 18,
299
- HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH_STENCIL = 19
300
- } hsa_ext_image_channel_order_t;
301
-
302
- /**
303
- * @brief A fixed-size type used to represent ::hsa_ext_image_channel_order_t constants.
304
- */
305
- typedef uint32_t hsa_ext_image_channel_order32_t;
306
-
307
-
308
- /**
309
- * @brief Image format.
310
- */
311
- typedef struct hsa_ext_image_format_s {
312
- /**
313
- * Channel type.
314
- */
315
- hsa_ext_image_channel_type32_t channel_type;
316
-
317
- /**
318
- * Channel order.
319
- */
320
- hsa_ext_image_channel_order32_t channel_order;
321
- } hsa_ext_image_format_t;
322
-
323
- /**
324
- * @brief Implementation independent image descriptor.
325
- */
326
- typedef struct hsa_ext_image_descriptor_s {
327
- /**
328
- * Image geometry.
329
- */
330
- hsa_ext_image_geometry_t geometry;
331
- /**
332
- * Width of the image, in components.
333
- */
334
- size_t width;
335
- /**
336
- * Height of the image, in components. Only used if the geometry is
337
- * ::HSA_EXT_IMAGE_GEOMETRY_2D, ::HSA_EXT_IMAGE_GEOMETRY_3D,
338
- * HSA_EXT_IMAGE_GEOMETRY_2DA, HSA_EXT_IMAGE_GEOMETRY_2DDEPTH, or
339
- * HSA_EXT_IMAGE_GEOMETRY_2DADEPTH, otherwise must be 0.
340
- */
341
- size_t height;
342
- /**
343
- * Depth of the image, in components. Only used if the geometry is
344
- * ::HSA_EXT_IMAGE_GEOMETRY_3D, otherwise must be 0.
345
- */
346
- size_t depth;
347
- /**
348
- * Number of image layers in the image array. Only used if the geometry is
349
- * ::HSA_EXT_IMAGE_GEOMETRY_1DA, ::HSA_EXT_IMAGE_GEOMETRY_2DA, or
350
- * HSA_EXT_IMAGE_GEOMETRY_2DADEPTH, otherwise must be 0.
351
- */
352
- size_t array_size;
353
- /**
354
- * Image format.
355
- */
356
- hsa_ext_image_format_t format;
357
- } hsa_ext_image_descriptor_t;
358
-
359
- /**
360
- * @brief Image capability.
361
- */
362
- typedef enum {
363
- /**
364
- * Images of this geometry, format, and layout are not supported by
365
- * the agent.
366
- */
367
- HSA_EXT_IMAGE_CAPABILITY_NOT_SUPPORTED = 0x0,
368
- /**
369
- * Read-only images of this geometry, format, and layout are
370
- * supported by the agent.
371
- */
372
- HSA_EXT_IMAGE_CAPABILITY_READ_ONLY = 0x1,
373
- /**
374
- * Write-only images of this geometry, format, and layout are
375
- * supported by the agent.
376
- */
377
- HSA_EXT_IMAGE_CAPABILITY_WRITE_ONLY = 0x2,
378
- /**
379
- * Read-write images of this geometry, format, and layout are
380
- * supported by the agent.
381
- */
382
- HSA_EXT_IMAGE_CAPABILITY_READ_WRITE = 0x4,
383
- /**
384
- * @deprecated Images of this geometry, format, and layout can be accessed from
385
- * read-modify-write atomic operations in the agent.
386
- */
387
- HSA_EXT_IMAGE_CAPABILITY_READ_MODIFY_WRITE = 0x8,
388
- /**
389
- * Images of this geometry, format, and layout are guaranteed to
390
- * have a consistent data layout regardless of how they are
391
- * accessed by the associated agent.
392
- */
393
- HSA_EXT_IMAGE_CAPABILITY_ACCESS_INVARIANT_DATA_LAYOUT = 0x10
394
- } hsa_ext_image_capability_t;
395
-
396
- /**
397
- * @brief Image data layout.
398
- *
399
- * @details An image data layout denotes such aspects of image data
400
- * layout as tiling and organization of channels in memory. Some image
401
- * data layouts may only apply to specific image geometries, formats,
402
- * and access permissions. Different agents may support different
403
- * image layout identifiers, including vendor specific layouts. Note
404
- * that an agent may not support the same image data layout for
405
- * different access permissions to images with the same image
406
- * geometry, size, and format. If multiple agents support the same
407
- * image data layout then it is possible to use separate image handles
408
- * for each agent that references the same image data.
409
- */
410
-
411
- typedef enum {
412
- /**
413
- * An implementation specific opaque image data layout which can
414
- * vary depending on the agent, geometry, image format, image size,
415
- * and access permissions.
416
- */
417
- HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE = 0x0,
418
- /**
419
- * The image data layout is specified by the following rules in
420
- * ascending byte address order. For a 3D image, 2DA image array,
421
- * or 1DA image array, the image data is stored as a linear sequence
422
- * of adjacent 2D image slices, 2D images, or 1D images
423
- * respectively, spaced according to the slice pitch. Each 2D image
424
- * is stored as a linear sequence of adjacent image rows, spaced
425
- * according to the row pitch. Each 1D or 1DB image is stored as a
426
- * single image row. Each image row is stored as a linear sequence
427
- * of image elements. Each image element is stored as a linear
428
- * sequence of image components specified by the left to right
429
- * channel order definition. Each image component is stored using
430
- * the memory type specified by the channel type.
431
- *
432
- * The 1DB image geometry always uses the linear image data layout.
433
- */
434
- HSA_EXT_IMAGE_DATA_LAYOUT_LINEAR = 0x1
435
- } hsa_ext_image_data_layout_t;
436
-
437
- /**
438
- * @brief Retrieve the supported image capabilities for a given combination of
439
- * agent, geometry, and image format for an image created with an opaque image
440
- * data layout.
441
- *
442
- * @param[in] agent Agent to be associated with the image handle.
443
- *
444
- * @param[in] geometry Geometry.
445
- *
446
- * @param[in] image_format Pointer to an image format. Must not be NULL.
447
- *
448
- * @param[out] capability_mask Pointer to a memory location where the HSA
449
- * runtime stores a bit-mask of supported image capability
450
- * (::hsa_ext_image_capability_t) values. Must not be NULL.
451
- *
452
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
453
- *
454
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
455
- * initialized.
456
- *
457
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
458
- *
459
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p image_format is
460
- * NULL, or @p capability_mask is NULL.
461
- */
462
- hsa_status_t HSA_API hsa_ext_image_get_capability(
463
- hsa_agent_t agent,
464
- hsa_ext_image_geometry_t geometry,
465
- const hsa_ext_image_format_t *image_format,
466
- uint32_t *capability_mask);
467
-
468
- /**
469
- * @brief Retrieve the supported image capabilities for a given combination of
470
- * agent, geometry, image format, and image layout for an image created with
471
- * an explicit image data layout.
472
- *
473
- * @param[in] agent Agent to be associated with the image handle.
474
- *
475
- * @param[in] geometry Geometry.
476
- *
477
- * @param[in] image_format Pointer to an image format. Must not be NULL.
478
- *
479
- * @param[in] image_data_layout The image data layout.
480
- * It is invalid to use ::HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE; use
481
- * ::hsa_ext_image_get_capability instead.
482
- *
483
- * @param[out] capability_mask Pointer to a memory location where the HSA
484
- * runtime stores a bit-mask of supported image capability
485
- * (::hsa_ext_image_capability_t) values. Must not be NULL.
486
- *
487
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
488
- *
489
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
490
- * initialized.
491
- *
492
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
493
- *
494
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p image_format is
495
- * NULL, @p image_data_layout is ::HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE,
496
- * or @p capability_mask is NULL.
497
- */
498
- hsa_status_t HSA_API hsa_ext_image_get_capability_with_layout(
499
- hsa_agent_t agent,
500
- hsa_ext_image_geometry_t geometry,
501
- const hsa_ext_image_format_t *image_format,
502
- hsa_ext_image_data_layout_t image_data_layout,
503
- uint32_t *capability_mask);
504
-
505
- /**
506
- * @brief Agent specific image size and alignment requirements, populated by
507
- * ::hsa_ext_image_data_get_info and ::hsa_ext_image_data_get_info_with_layout.
508
- */
509
- typedef struct hsa_ext_image_data_info_s {
510
- /**
511
- * Image data size, in bytes.
512
- */
513
- size_t size;
514
-
515
- /**
516
- * Image data alignment, in bytes. Must always be a power of 2.
517
- */
518
- size_t alignment;
519
-
520
- } hsa_ext_image_data_info_t;
521
-
522
- /**
523
- * @brief Retrieve the image data requirements for a given combination of agent, image
524
- * descriptor, and access permission for an image created with an opaque image
525
- * data layout.
526
- *
527
- * @details The optimal image data size and alignment requirements may
528
- * vary depending on the image attributes specified in @p
529
- * image_descriptor, the @p access_permission, and the @p agent. Also,
530
- * different implementations of the HSA runtime may return different
531
- * requirements for the same input values.
532
- *
533
- * The implementation must return the same image data requirements for
534
- * different access permissions with matching image descriptors as long
535
- * as ::hsa_ext_image_get_capability reports
536
- * ::HSA_EXT_IMAGE_CAPABILITY_ACCESS_INVARIANT_DATA_LAYOUT. Image
537
- * descriptors match if they have the same values, with the exception
538
- * that s-form channel orders match the corresponding non-s-form
539
- * channel order and vice versa.
540
- *
541
- * @param[in] agent Agent to be associated with the image handle.
542
- *
543
- * @param[in] image_descriptor Pointer to an image descriptor. Must not be NULL.
544
- *
545
- * @param[in] access_permission Access permission of the image when
546
- * accessed by @p agent. The access permission defines how the agent
547
- * is allowed to access the image and must match the corresponding
548
- * HSAIL image handle type. The @p agent must support the image format
549
- * specified in @p image_descriptor for the given @p
550
- * access_permission.
551
- *
552
- * @param[out] image_data_info Memory location where the runtime stores the
553
- * size and alignment requirements. Must not be NULL.
554
- *
555
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
556
- *
557
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
558
- * initialized.
559
- *
560
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
561
- *
562
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_FORMAT_UNSUPPORTED The @p
563
- * agent does not support the image format specified by @p
564
- * image_descriptor with the specified @p access_permission.
565
- *
566
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_SIZE_UNSUPPORTED The agent
567
- * does not support the image dimensions specified by @p
568
- * image_descriptor with the specified @p access_permission.
569
- *
570
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p image_descriptor is NULL, @p
571
- * access_permission is not a valid access permission value, or @p
572
- * image_data_info is NULL.
573
- */
574
- hsa_status_t HSA_API hsa_ext_image_data_get_info(
575
- hsa_agent_t agent,
576
- const hsa_ext_image_descriptor_t *image_descriptor,
577
- hsa_access_permission_t access_permission,
578
- hsa_ext_image_data_info_t *image_data_info);
579
-
580
- /**
581
- * @brief Retrieve the image data requirements for a given combination of
582
- * image descriptor, access permission, image data layout, image data row pitch,
583
- * and image data slice pitch for an image created with an explicit image
584
- * data layout.
585
- *
586
- * @details The image data size and alignment requirements may vary
587
- * depending on the image attributes specified in @p image_descriptor,
588
- * the @p access_permission, and the image layout. However, different
589
- * implementations of the HSA runtime will return the same
590
- * requirements for the same input values.
591
- *
592
- * The implementation must return the same image data requirements for
593
- * different access permissions with matching image descriptors and
594
- * matching image layouts as long as ::hsa_ext_image_get_capability
595
- * reports
596
- * ::HSA_EXT_IMAGE_CAPABILITY_ACCESS_INVARIANT_DATA_LAYOUT. Image
597
- * descriptors match if they have the same values, with the exception
598
- * that s-form channel orders match the corresponding non-s-form
599
- * channel order and vice versa. Image layouts match if they are the
600
- * same image data layout and use the same image row and slice pitch
601
- * values.
602
- *
603
- * @param[in] image_descriptor Pointer to an image descriptor. Must not be NULL.
604
- *
605
- * @param[in] access_permission Access permission of the image when
606
- * accessed by an agent. The access permission defines how the agent
607
- * is allowed to access the image and must match the corresponding
608
- * HSAIL image handle type.
609
- *
610
- * @param[in] image_data_layout The image data layout to use.
611
- * It is invalid to use ::HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE; use
612
- * ::hsa_ext_image_data_get_info instead.
613
- *
614
- * @param[in] image_data_row_pitch The size in bytes for a single row
615
- * of the image in the image data. If 0 is specified then the default
616
- * row pitch value is used: image width * image element byte size.
617
- * The value used must be greater than or equal to the default row
618
- * pitch, and be a multiple of the image element byte size. For the
619
- * linear image layout it must also be a multiple of the image linear
620
- * row pitch alignment for the agents that will access the image data
621
- * using image instructions.
622
- *
623
- * @param[in] image_data_slice_pitch The size in bytes of a single
624
- * slice of a 3D image, or the size in bytes of each image layer in an
625
- * image array in the image data. If 0 is specified then the default
626
- * slice pitch value is used: row pitch * height if geometry is
627
- * ::HSA_EXT_IMAGE_GEOMETRY_3D, ::HSA_EXT_IMAGE_GEOMETRY_2DA, or
628
- * ::HSA_EXT_IMAGE_GEOMETRY_2DADEPTH; row pitch if geometry is
629
- * ::HSA_EXT_IMAGE_GEOMETRY_1DA; and 0 otherwise. The value used must
630
- * be 0 if the default slice pitch is 0, be greater than or equal to
631
- * the default slice pitch, and be a multiple of the row pitch.
632
- *
633
- * @param[out] image_data_info Memory location where the runtime stores the
634
- * size and alignment requirements. Must not be NULL.
635
- *
636
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
637
- *
638
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
639
- * initialized.
640
- *
641
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_FORMAT_UNSUPPORTED The image
642
- * format specified by @p image_descriptor is not supported for the
643
- * @p access_permission and @p image_data_layout specified.
644
- *
645
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_SIZE_UNSUPPORTED The image
646
- * dimensions specified by @p image_descriptor are not supported for
647
- * the @p access_permission and @p image_data_layout specified.
648
- *
649
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_PITCH_UNSUPPORTED The row and
650
- * slice pitch specified by @p image_data_row_pitch and @p
651
- * image_data_slice_pitch are invalid or not supported.
652
- *
653
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p image_descriptor is
654
- * NULL, @p image_data_layout is ::HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE,
655
- * or @p image_data_info is NULL.
656
- */
657
- hsa_status_t HSA_API hsa_ext_image_data_get_info_with_layout(
658
- hsa_agent_t agent,
659
- const hsa_ext_image_descriptor_t *image_descriptor,
660
- hsa_access_permission_t access_permission,
661
- hsa_ext_image_data_layout_t image_data_layout,
662
- size_t image_data_row_pitch,
663
- size_t image_data_slice_pitch,
664
- hsa_ext_image_data_info_t *image_data_info);
665
-
666
- /**
667
- * @brief Creates an agent specific image handle to an image with an
668
- * opaque image data layout.
669
- *
670
- * @details Images with an opaque image data layout created with
671
- * different access permissions but matching image descriptors and
672
- * same agent can share the same image data if
673
- * ::HSA_EXT_IMAGE_CAPABILITY_ACCESS_INVARIANT_DATA_LAYOUT is reported
674
- * by ::hsa_ext_image_get_capability for the image format specified in
675
- * the image descriptor. Image descriptors match if they have the same
676
- * values, with the exception that s-form channel orders match the
677
- * corresponding non-s-form channel order and vice versa.
678
- *
679
- * If necessary, an application can use image operations (import,
680
- * export, copy, clear) to prepare the image for the intended use
681
- * regardless of the access permissions.
682
- *
683
- * @param[in] agent agent to be associated with the image handle created.
684
- *
685
- * @param[in] image_descriptor Pointer to an image descriptor. Must not be NULL.
686
- *
687
- * @param[in] image_data Image data buffer that must have been allocated
688
- * according to the size and alignment requirements dictated by
689
- * ::hsa_ext_image_data_get_info. Must not be NULL.
690
- *
691
- * Any previous memory contents are preserved upon creation. The application is
692
- * responsible for ensuring that the lifetime of the image data exceeds that of
693
- * all the associated images.
694
- *
695
- * @param[in] access_permission Access permission of the image when
696
- * accessed by agent. The access permission defines how the agent
697
- * is allowed to access the image using the image handle created and
698
- * must match the corresponding HSAIL image handle type. The agent
699
- * must support the image format specified in @p image_descriptor for
700
- * the given @p access_permission.
701
- *
702
- * @param[out] image Pointer to a memory location where the HSA runtime stores
703
- * the newly created image handle. Must not be NULL.
704
- *
705
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
706
- *
707
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
708
- * initialized.
709
- *
710
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
711
- *
712
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_FORMAT_UNSUPPORTED The agent
713
- * does not have the capability to support the image format contained
714
- * in @p image_descriptor using the specified @p access_permission.
715
- *
716
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_SIZE_UNSUPPORTED The agent
717
- * does not support the image dimensions specified by @p
718
- * image_descriptor using the specified @p access_permission.
719
- *
720
- * @retval ::HSA_STATUS_ERROR_OUT_OF_RESOURCES The HSA runtime failed to allocate
721
- * the required resources.
722
- *
723
- * support the creation of more image handles with the given @p access_permission).
724
- *
725
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p image_descriptor is NULL, @p
726
- * image_data is NULL, @p image_data does not have a valid alignment,
727
- * @p access_permission is not a valid access permission
728
- * value, or @p image is NULL.
729
- */
730
- hsa_status_t HSA_API hsa_ext_image_create(
731
- hsa_agent_t agent,
732
- const hsa_ext_image_descriptor_t *image_descriptor,
733
- const void *image_data,
734
- hsa_access_permission_t access_permission,
735
- hsa_ext_image_t *image);
736
-
737
- /**
738
- * @brief Creates an agent specific image handle to an image with an explicit
739
- * image data layout.
740
- *
741
- * @details Images with an explicit image data layout created with
742
- * different access permissions but matching image descriptors and
743
- * matching image layout can share the same image data if
744
- * ::HSA_EXT_IMAGE_CAPABILITY_ACCESS_INVARIANT_DATA_LAYOUT is reported
745
- * by ::hsa_ext_image_get_capability_with_layout for the image format
746
- * specified in the image descriptor and specified image data
747
- * layout. Image descriptors match if they have the same values, with
748
- * the exception that s-form channel orders match the corresponding
749
- * non-s-form channel order and vice versa. Image layouts match if
750
- * they are the same image data layout and use the same image row and
751
- * slice values.
752
- *
753
- * If necessary, an application can use image operations (import, export, copy,
754
- * clear) to prepare the image for the intended use regardless of the access
755
- * permissions.
756
- *
757
- * @param[in] agent agent to be associated with the image handle created.
758
- *
759
- * @param[in] image_descriptor Pointer to an image descriptor. Must not be NULL.
760
- *
761
- * @param[in] image_data Image data buffer that must have been allocated
762
- * according to the size and alignment requirements dictated by
763
- * ::hsa_ext_image_data_get_info_with_layout. Must not be NULL.
764
- *
765
- * Any previous memory contents are preserved upon creation. The application is
766
- * responsible for ensuring that the lifetime of the image data exceeds that of
767
- * all the associated images.
768
- *
769
- * @param[in] access_permission Access permission of the image when
770
- * accessed by the agent. The access permission defines how the agent
771
- * is allowed to access the image and must match the corresponding
772
- * HSAIL image handle type. The agent must support the image format
773
- * specified in @p image_descriptor for the given @p access_permission
774
- * and @p image_data_layout.
775
- *
776
- * @param[in] image_data_layout The image data layout to use for the
777
- * @p image_data. It is invalid to use
778
- * ::HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE; use ::hsa_ext_image_create
779
- * instead.
780
- *
781
- * @param[in] image_data_row_pitch The size in bytes for a single row
782
- * of the image in the image data. If 0 is specified then the default
783
- * row pitch value is used: image width * image element byte size.
784
- * The value used must be greater than or equal to the default row
785
- * pitch, and be a multiple of the image element byte size. For the
786
- * linear image layout it must also be a multiple of the image linear
787
- * row pitch alignment for the agents that will access the image data
788
- * using image instructions.
789
- *
790
- * @param[in] image_data_slice_pitch The size in bytes of a single
791
- * slice of a 3D image, or the size in bytes of each image layer in an
792
- * image array in the image data. If 0 is specified then the default
793
- * slice pitch value is used: row pitch * height if geometry is
794
- * ::HSA_EXT_IMAGE_GEOMETRY_3D, ::HSA_EXT_IMAGE_GEOMETRY_2DA, or
795
- * ::HSA_EXT_IMAGE_GEOMETRY_2DADEPTH; row pitch if geometry is
796
- * ::HSA_EXT_IMAGE_GEOMETRY_1DA; and 0 otherwise. The value used must
797
- * be 0 if the default slice pitch is 0, be greater than or equal to
798
- * the default slice pitch, and be a multiple of the row pitch.
799
- *
800
- * @param[out] image Pointer to a memory location where the HSA runtime stores
801
- * the newly created image handle. Must not be NULL.
802
- *
803
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
804
- *
805
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
806
- * initialized.
807
- *
808
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
809
- *
810
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_FORMAT_UNSUPPORTED The agent does
811
- * not have the capability to support the image format contained in the image
812
- * descriptor using the specified @p access_permission and @p image_data_layout.
813
- *
814
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_SIZE_UNSUPPORTED The agent
815
- * does not support the image dimensions specified by @p
816
- * image_descriptor using the specified @p access_permission and @p
817
- * image_data_layout.
818
- *
819
- * @retval ::HSA_EXT_STATUS_ERROR_IMAGE_PITCH_UNSUPPORTED The agent does
820
- * not support the row and slice pitch specified by @p image_data_row_pitch
821
- * and @p image_data_slice_pitch, or the values are invalid.
822
- *
823
- * @retval ::HSA_STATUS_ERROR_OUT_OF_RESOURCES The HSA runtime failed to allocate
824
- * the required resources.
825
- *
826
- * support the creation of more image handles with the given @p access_permission).
827
- *
828
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p image_descriptor is NULL, @p
829
- * image_data is NULL, @p image_data does not have a valid alignment,
830
- * @p image_data_layout is ::HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE,
831
- * or @p image is NULL.
832
- */
833
- hsa_status_t HSA_API hsa_ext_image_create_with_layout(
834
- hsa_agent_t agent,
835
- const hsa_ext_image_descriptor_t *image_descriptor,
836
- const void *image_data,
837
- hsa_access_permission_t access_permission,
838
- hsa_ext_image_data_layout_t image_data_layout,
839
- size_t image_data_row_pitch,
840
- size_t image_data_slice_pitch,
841
- hsa_ext_image_t *image);
842
-
843
- /**
844
- * @brief Destroy an image handle previously created using ::hsa_ext_image_create or
845
- * ::hsa_ext_image_create_with_layout.
846
- *
847
- * @details Destroying the image handle does not free the associated image data,
848
- * or modify its contents. The application should not destroy an image handle while
849
- * there are references to it queued for execution or currently being used in a
850
- * kernel dispatch.
851
- *
852
- * @param[in] agent Agent associated with the image handle.
853
- *
854
- * @param[in] image Image handle to destroy.
855
- *
856
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
857
- *
858
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
859
- * initialized.
860
- *
861
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
862
- */
863
- hsa_status_t HSA_API hsa_ext_image_destroy(
864
- hsa_agent_t agent,
865
- hsa_ext_image_t image);
866
-
867
- /**
868
- * @brief Copies a portion of one image (the source) to another image (the
869
- * destination).
870
- *
871
- * @details The source and destination image formats should be the
872
- * same, with the exception that s-form channel orders match the
873
- * corresponding non-s-form channel order and vice versa. For example,
874
- * it is allowed to copy a source image with a channel order of
875
- * HSA_EXT_IMAGE_CHANNEL_ORDER_SRGB to a destination image with a
876
- * channel order of HSA_EXT_IMAGE_CHANNEL_ORDER_RGB.
877
- *
878
- * The source and destination images do not have to be of the same geometry and
879
- * appropriate scaling is performed by the HSA runtime. It is possible to copy
880
- * subregions between any combinations of source and destination geometries, provided
881
- * that the dimensions of the subregions are the same. For example, it is
882
- * allowed to copy a rectangular region from a 2D image to a slice of a 3D
883
- * image.
884
- *
885
- * If the source and destination image data overlap, or the combination of
886
- * offset and range references an out-out-bounds element in any of the images,
887
- * the behavior is undefined.
888
- *
889
- * @param[in] agent Agent associated with both the source and destination image handles.
890
- *
891
- * @param[in] src_image Image handle of source image. The agent associated with the source
892
- * image handle must be identical to that of the destination image.
893
- *
894
- * @param[in] src_offset Pointer to the offset within the source image where to
895
- * copy the data from. Must not be NULL.
896
- *
897
- * @param[in] dst_image Image handle of destination image.
898
- *
899
- * @param[in] dst_offset Pointer to the offset within the destination
900
- * image where to copy the data. Must not be NULL.
901
- *
902
- * @param[in] range Dimensions of the image portion to be copied. The HSA
903
- * runtime computes the size of the image data to be copied using this
904
- * argument. Must not be NULL.
905
- *
906
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
907
- *
908
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
909
- * initialized.
910
- *
911
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
912
- *
913
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p src_offset is
914
- * NULL, @p dst_offset is NULL, or @p range is NULL.
915
- */
916
- hsa_status_t HSA_API hsa_ext_image_copy(
917
- hsa_agent_t agent,
918
- hsa_ext_image_t src_image,
919
- const hsa_dim3_t* src_offset,
920
- hsa_ext_image_t dst_image,
921
- const hsa_dim3_t* dst_offset,
922
- const hsa_dim3_t* range);
923
-
924
- /**
925
- * @brief Image region.
926
- */
927
- typedef struct hsa_ext_image_region_s {
928
- /**
929
- * Offset within an image (in coordinates).
930
- */
931
- hsa_dim3_t offset;
932
-
933
- /**
934
- * Dimension size of the image range (in coordinates). The x, y, and z dimensions
935
- * correspond to width, height, and depth or index respectively.
936
- */
937
- hsa_dim3_t range;
938
- } hsa_ext_image_region_t;
939
-
940
- /**
941
- * @brief Import a linearly organized image data from memory directly to an
942
- * image handle.
943
- *
944
- * @details This operation updates the image data referenced by the image handle
945
- * from the source memory. The size of the data imported from memory is
946
- * implicitly derived from the image region.
947
- *
948
- * It is the application's responsibility to avoid out of bounds memory access.
949
- *
950
- * None of the source memory or destination image data memory can
951
- * overlap. Overlapping of any of the source and destination image
952
- * data memory within the import operation produces undefined results.
953
- *
954
- * @param[in] agent Agent associated with the image handle.
955
- *
956
- * @param[in] src_memory Source memory. Must not be NULL.
957
- *
958
- * @param[in] src_row_pitch The size in bytes of a single row of the image in the
959
- * source memory. If the value is smaller than the destination image region
960
- * width * image element byte size, then region width * image element byte
961
- * size is used.
962
- *
963
- * @param[in] src_slice_pitch The size in bytes of a single 2D slice of a 3D image,
964
- * or the size in bytes of each image layer in an image array in the source memory.
965
- * If the geometry is ::HSA_EXT_IMAGE_GEOMETRY_1DA and the value is smaller than the
966
- * value used for @p src_row_pitch, then the value used for @p src_row_pitch is used.
967
- * If the geometry is ::HSA_EXT_IMAGE_GEOMETRY_3D, ::HSA_EXT_IMAGE_GEOMETRY_2DA, or
968
- * HSA_EXT_IMAGE_GEOMETRY_2DADEPTH and the value is smaller than the value used for
969
- * @p src_row_pitch * destination image region height, then the value used for
970
- * @p src_row_pitch * destination image region height is used.
971
- * Otherwise, the value is not used.
972
- *
973
- * @param[in] dst_image Image handle of destination image.
974
- *
975
- * @param[in] image_region Pointer to the image region to be updated. Must not
976
- * be NULL.
977
- *
978
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
979
- *
980
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
981
- * initialized.
982
- *
983
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
984
- *
985
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p src_memory is NULL, or @p
986
- * image_region is NULL.
987
- *
988
- */
989
- hsa_status_t HSA_API hsa_ext_image_import(
990
- hsa_agent_t agent,
991
- const void *src_memory,
992
- size_t src_row_pitch,
993
- size_t src_slice_pitch,
994
- hsa_ext_image_t dst_image,
995
- const hsa_ext_image_region_t *image_region);
996
-
997
- /**
998
- * @brief Export the image data to linearly organized memory.
999
- *
1000
- * @details The operation updates the destination memory with the image data of
1001
- * @p src_image. The size of the data exported to memory is implicitly derived
1002
- * from the image region.
1003
- *
1004
- * It is the application's responsibility to avoid out of bounds memory access.
1005
- *
1006
- * None of the destination memory or source image data memory can
1007
- * overlap. Overlapping of any of the source and destination image
1008
- * data memory within the export operation produces undefined results.
1009
- *
1010
- * @param[in] agent Agent associated with the image handle.
1011
- *
1012
- * @param[in] src_image Image handle of source image.
1013
- *
1014
- * @param[in] dst_memory Destination memory. Must not be NULL.
1015
- *
1016
- * @param[in] dst_row_pitch The size in bytes of a single row of the image in the
1017
- * destination memory. If the value is smaller than the source image region
1018
- * width * image element byte size, then region width * image element byte
1019
- * size is used.
1020
- *
1021
- * @param[in] dst_slice_pitch The size in bytes of a single 2D slice of a 3D image,
1022
- * or the size in bytes of each image in an image array in the destination memory.
1023
- * If the geometry is ::HSA_EXT_IMAGE_GEOMETRY_1DA and the value is smaller than the
1024
- * value used for @p dst_row_pitch, then the value used for @p dst_row_pitch is used.
1025
- * If the geometry is ::HSA_EXT_IMAGE_GEOMETRY_3D, ::HSA_EXT_IMAGE_GEOMETRY_2DA, or
1026
- * HSA_EXT_IMAGE_GEOMETRY_2DADEPTH and the value is smaller than the value used for
1027
- * @p dst_row_pitch * source image region height, then the value used for
1028
- * @p dst_row_pitch * source image region height is used.
1029
- * Otherwise, the value is not used.
1030
- *
1031
- * @param[in] image_region Pointer to the image region to be exported. Must not
1032
- * be NULL.
1033
- *
1034
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
1035
- *
1036
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
1037
- * initialized.
1038
- *
1039
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
1040
- *
1041
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p dst_memory is NULL, or @p
1042
- * image_region is NULL.
1043
- */
1044
- hsa_status_t HSA_API hsa_ext_image_export(
1045
- hsa_agent_t agent,
1046
- hsa_ext_image_t src_image,
1047
- void *dst_memory,
1048
- size_t dst_row_pitch,
1049
- size_t dst_slice_pitch,
1050
- const hsa_ext_image_region_t *image_region);
1051
-
1052
- /**
1053
- * @brief Clear a region of an image so that every image element has
1054
- * the specified value.
1055
- *
1056
- * @param[in] agent Agent associated with the image handle.
1057
- *
1058
- * @param[in] image Image handle for image to be cleared.
1059
- *
1060
- * @param[in] data The value to which to set each image element being
1061
- * cleared. It is specified as an array of image component values. The
1062
- * number of array elements must match the number of access components
1063
- * for the image channel order. The type of each array element must
1064
- * match the image access type of the image channel type. When the
1065
- * value is used to set the value of an image element, the conversion
1066
- * method corresponding to the image channel type is used. See the
1067
- * <em>Channel Order</em> section and <em>Channel Type</em> section in
1068
- * the <em>HSA Programming Reference Manual</em> for more
1069
- * information. Must not be NULL.
1070
- *
1071
- * @param[in] image_region Pointer to the image region to clear. Must not be
1072
- * NULL. If the region references an out-out-bounds element, the behavior is
1073
- * undefined.
1074
- *
1075
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
1076
- *
1077
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
1078
- * initialized.
1079
- *
1080
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
1081
- *
1082
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p data is NULL, or @p
1083
- * image_region is NULL.
1084
- */
1085
- hsa_status_t HSA_API hsa_ext_image_clear(
1086
- hsa_agent_t agent,
1087
- hsa_ext_image_t image,
1088
- const void* data,
1089
- const hsa_ext_image_region_t *image_region);
1090
-
1091
- /**
1092
- * @brief Sampler handle. Samplers are populated by
1093
- * ::hsa_ext_sampler_create. Sampler handles are only unique within an
1094
- * agent, not across agents.
1095
- */
1096
- typedef struct hsa_ext_sampler_s {
1097
- /**
1098
- * Opaque handle. For a given agent, two handles reference the same object of
1099
- * the enclosing type if and only if they are equal.
1100
- */
1101
- uint64_t handle;
1102
- } hsa_ext_sampler_t;
1103
-
1104
- /**
1105
- * @brief Sampler address modes. The sampler address mode describes
1106
- * the processing of out-of-range image coordinates. See the
1107
- * <em>Addressing Mode</em> section in the <em>HSA Programming Reference
1108
- * Manual</em> for definitions on each address mode. The values
1109
- * match the BRIG type @p hsa_ext_brig_sampler_addressing_t.
1110
- */
1111
- typedef enum {
1112
- /**
1113
- * Out-of-range coordinates are not handled.
1114
- */
1115
- HSA_EXT_SAMPLER_ADDRESSING_MODE_UNDEFINED = 0,
1116
-
1117
- /**
1118
- * Clamp out-of-range coordinates to the image edge.
1119
- */
1120
- HSA_EXT_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE = 1,
1121
-
1122
- /**
1123
- * Clamp out-of-range coordinates to the image border color.
1124
- */
1125
- HSA_EXT_SAMPLER_ADDRESSING_MODE_CLAMP_TO_BORDER = 2,
1126
-
1127
- /**
1128
- * Wrap out-of-range coordinates back into the valid coordinate
1129
- * range so the image appears as repeated tiles.
1130
- */
1131
- HSA_EXT_SAMPLER_ADDRESSING_MODE_REPEAT = 3,
1132
-
1133
- /**
1134
- * Mirror out-of-range coordinates back into the valid coordinate
1135
- * range so the image appears as repeated tiles with every other
1136
- * tile a reflection.
1137
- */
1138
- HSA_EXT_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT = 4
1139
-
1140
- } hsa_ext_sampler_addressing_mode_t;
1141
-
1142
- /**
1143
- * @brief A fixed-size type used to represent ::hsa_ext_sampler_addressing_mode_t constants.
1144
- */
1145
- typedef uint32_t hsa_ext_sampler_addressing_mode32_t;
1146
-
1147
- /**
1148
- * @brief Sampler coordinate normalization modes. See the
1149
- * <em>Coordinate Normalization Mode</em> section in the <em>HSA
1150
- * Programming Reference Manual</em> for definitions on each
1151
- * coordinate normalization mode. The values match the BRIG type @p
1152
- * hsa_ext_brig_sampler_coord_normalization_t.
1153
- */
1154
- typedef enum {
1155
-
1156
- /**
1157
- * Coordinates are used to directly address an image element.
1158
- */
1159
- HSA_EXT_SAMPLER_COORDINATE_MODE_UNNORMALIZED = 0,
1160
-
1161
- /**
1162
- * Coordinates are scaled by the image dimension size before being
1163
- * used to address an image element.
1164
- */
1165
- HSA_EXT_SAMPLER_COORDINATE_MODE_NORMALIZED = 1
1166
-
1167
- } hsa_ext_sampler_coordinate_mode_t;
1168
-
1169
- /**
1170
- * @brief A fixed-size type used to represent ::hsa_ext_sampler_coordinate_mode_t constants.
1171
- */
1172
- typedef uint32_t hsa_ext_sampler_coordinate_mode32_t;
1173
-
1174
-
1175
- /**
1176
- * @brief Sampler filter modes. See the <em>Filter Mode</em> section
1177
- * in the <em>HSA Programming Reference Manual</em> for definitions
1178
- * on each address mode. The enumeration values match the BRIG type @p
1179
- * hsa_ext_brig_sampler_filter_t.
1180
- */
1181
- typedef enum {
1182
- /**
1183
- * Filter to the image element nearest (in Manhattan distance) to the
1184
- * specified coordinate.
1185
- */
1186
- HSA_EXT_SAMPLER_FILTER_MODE_NEAREST = 0,
1187
-
1188
- /**
1189
- * Filter to the image element calculated by combining the elements in a 2x2
1190
- * square block or 2x2x2 cube block around the specified coordinate. The
1191
- * elements are combined using linear interpolation.
1192
- */
1193
- HSA_EXT_SAMPLER_FILTER_MODE_LINEAR = 1
1194
-
1195
- } hsa_ext_sampler_filter_mode_t;
1196
-
1197
- /**
1198
- * @brief A fixed-size type used to represent ::hsa_ext_sampler_filter_mode_t constants.
1199
- */
1200
- typedef uint32_t hsa_ext_sampler_filter_mode32_t;
1201
-
1202
- /**
1203
- * @brief Implementation independent sampler descriptor.
1204
- */
1205
- typedef struct hsa_ext_sampler_descriptor_s {
1206
- /**
1207
- * Sampler coordinate mode describes the normalization of image coordinates.
1208
- */
1209
- hsa_ext_sampler_coordinate_mode32_t coordinate_mode;
1210
-
1211
- /**
1212
- * Sampler filter type describes the type of sampling performed.
1213
- */
1214
- hsa_ext_sampler_filter_mode32_t filter_mode;
1215
-
1216
- /**
1217
- * Sampler address mode describes the processing of out-of-range image
1218
- * coordinates.
1219
- */
1220
- hsa_ext_sampler_addressing_mode32_t address_mode;
1221
-
1222
- } hsa_ext_sampler_descriptor_t;
1223
-
1224
- /**
1225
- * @brief Create an agent specific sampler handle for a given agent
1226
- * independent sampler descriptor and agent.
1227
- *
1228
- * @param[in] agent Agent to be associated with the sampler handle created.
1229
- *
1230
- * @param[in] sampler_descriptor Pointer to a sampler descriptor. Must not be
1231
- * NULL.
1232
- *
1233
- * @param[out] sampler Memory location where the HSA runtime stores the newly
1234
- * created sampler handle. Must not be NULL.
1235
- *
1236
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
1237
- *
1238
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
1239
- * initialized.
1240
- *
1241
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
1242
- *
1243
- * @retval ::HSA_EXT_STATUS_ERROR_SAMPLER_DESCRIPTOR_UNSUPPORTED The
1244
- * @p agent does not have the capability to support the properties
1245
- * specified by @p sampler_descriptor or it is invalid.
1246
- *
1247
- * @retval ::HSA_STATUS_ERROR_OUT_OF_RESOURCES The HSA runtime failed to allocate
1248
- * the required resources.
1249
- *
1250
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p sampler_descriptor is NULL, or
1251
- * @p sampler is NULL.
1252
- */
1253
- hsa_status_t HSA_API hsa_ext_sampler_create(
1254
- hsa_agent_t agent,
1255
- const hsa_ext_sampler_descriptor_t *sampler_descriptor,
1256
- hsa_ext_sampler_t *sampler);
1257
-
1258
- /**
1259
- * @brief Destroy a sampler handle previously created using ::hsa_ext_sampler_create.
1260
- *
1261
- * @details The sampler handle should not be destroyed while there are
1262
- * references to it queued for execution or currently being used in a
1263
- * kernel dispatch.
1264
- *
1265
- * @param[in] agent Agent associated with the sampler handle.
1266
- *
1267
- * @param[in] sampler Sampler handle to destroy.
1268
- *
1269
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
1270
- *
1271
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
1272
- * initialized.
1273
- *
1274
- * @retval ::HSA_STATUS_ERROR_INVALID_AGENT The agent is invalid.
1275
- */
1276
- hsa_status_t HSA_API hsa_ext_sampler_destroy(
1277
- hsa_agent_t agent,
1278
- hsa_ext_sampler_t sampler);
1279
-
1280
-
1281
- #define hsa_ext_images_1_00
1282
-
1283
- /**
1284
- * @brief The function pointer table for the images v1.00 extension. Can be returned by ::hsa_system_get_extension_table or ::hsa_system_get_major_extension_table.
1285
- */
1286
- typedef struct hsa_ext_images_1_00_pfn_s {
1287
-
1288
- hsa_status_t (*hsa_ext_image_get_capability)(
1289
- hsa_agent_t agent,
1290
- hsa_ext_image_geometry_t geometry,
1291
- const hsa_ext_image_format_t *image_format,
1292
- uint32_t *capability_mask);
1293
-
1294
- hsa_status_t (*hsa_ext_image_data_get_info)(
1295
- hsa_agent_t agent,
1296
- const hsa_ext_image_descriptor_t *image_descriptor,
1297
- hsa_access_permission_t access_permission,
1298
- hsa_ext_image_data_info_t *image_data_info);
1299
-
1300
- hsa_status_t (*hsa_ext_image_create)(
1301
- hsa_agent_t agent,
1302
- const hsa_ext_image_descriptor_t *image_descriptor,
1303
- const void *image_data,
1304
- hsa_access_permission_t access_permission,
1305
- hsa_ext_image_t *image);
1306
-
1307
- hsa_status_t (*hsa_ext_image_destroy)(
1308
- hsa_agent_t agent,
1309
- hsa_ext_image_t image);
1310
-
1311
- hsa_status_t (*hsa_ext_image_copy)(
1312
- hsa_agent_t agent,
1313
- hsa_ext_image_t src_image,
1314
- const hsa_dim3_t* src_offset,
1315
- hsa_ext_image_t dst_image,
1316
- const hsa_dim3_t* dst_offset,
1317
- const hsa_dim3_t* range);
1318
-
1319
- hsa_status_t (*hsa_ext_image_import)(
1320
- hsa_agent_t agent,
1321
- const void *src_memory,
1322
- size_t src_row_pitch,
1323
- size_t src_slice_pitch,
1324
- hsa_ext_image_t dst_image,
1325
- const hsa_ext_image_region_t *image_region);
1326
-
1327
- hsa_status_t (*hsa_ext_image_export)(
1328
- hsa_agent_t agent,
1329
- hsa_ext_image_t src_image,
1330
- void *dst_memory,
1331
- size_t dst_row_pitch,
1332
- size_t dst_slice_pitch,
1333
- const hsa_ext_image_region_t *image_region);
1334
-
1335
- hsa_status_t (*hsa_ext_image_clear)(
1336
- hsa_agent_t agent,
1337
- hsa_ext_image_t image,
1338
- const void* data,
1339
- const hsa_ext_image_region_t *image_region);
1340
-
1341
- hsa_status_t (*hsa_ext_sampler_create)(
1342
- hsa_agent_t agent,
1343
- const hsa_ext_sampler_descriptor_t *sampler_descriptor,
1344
- hsa_ext_sampler_t *sampler);
1345
-
1346
- hsa_status_t (*hsa_ext_sampler_destroy)(
1347
- hsa_agent_t agent,
1348
- hsa_ext_sampler_t sampler);
1349
-
1350
- } hsa_ext_images_1_00_pfn_t;
1351
-
1352
- #define hsa_ext_images_1
1353
-
1354
- /**
1355
- * @brief The function pointer table for the images v1 extension. Can be returned by ::hsa_system_get_extension_table or ::hsa_system_get_major_extension_table.
1356
- */
1357
- typedef struct hsa_ext_images_1_pfn_s {
1358
-
1359
- hsa_status_t (*hsa_ext_image_get_capability)(
1360
- hsa_agent_t agent,
1361
- hsa_ext_image_geometry_t geometry,
1362
- const hsa_ext_image_format_t *image_format,
1363
- uint32_t *capability_mask);
1364
-
1365
- hsa_status_t (*hsa_ext_image_data_get_info)(
1366
- hsa_agent_t agent,
1367
- const hsa_ext_image_descriptor_t *image_descriptor,
1368
- hsa_access_permission_t access_permission,
1369
- hsa_ext_image_data_info_t *image_data_info);
1370
-
1371
- hsa_status_t (*hsa_ext_image_create)(
1372
- hsa_agent_t agent,
1373
- const hsa_ext_image_descriptor_t *image_descriptor,
1374
- const void *image_data,
1375
- hsa_access_permission_t access_permission,
1376
- hsa_ext_image_t *image);
1377
-
1378
- hsa_status_t (*hsa_ext_image_destroy)(
1379
- hsa_agent_t agent,
1380
- hsa_ext_image_t image);
1381
-
1382
- hsa_status_t (*hsa_ext_image_copy)(
1383
- hsa_agent_t agent,
1384
- hsa_ext_image_t src_image,
1385
- const hsa_dim3_t* src_offset,
1386
- hsa_ext_image_t dst_image,
1387
- const hsa_dim3_t* dst_offset,
1388
- const hsa_dim3_t* range);
1389
-
1390
- hsa_status_t (*hsa_ext_image_import)(
1391
- hsa_agent_t agent,
1392
- const void *src_memory,
1393
- size_t src_row_pitch,
1394
- size_t src_slice_pitch,
1395
- hsa_ext_image_t dst_image,
1396
- const hsa_ext_image_region_t *image_region);
1397
-
1398
- hsa_status_t (*hsa_ext_image_export)(
1399
- hsa_agent_t agent,
1400
- hsa_ext_image_t src_image,
1401
- void *dst_memory,
1402
- size_t dst_row_pitch,
1403
- size_t dst_slice_pitch,
1404
- const hsa_ext_image_region_t *image_region);
1405
-
1406
- hsa_status_t (*hsa_ext_image_clear)(
1407
- hsa_agent_t agent,
1408
- hsa_ext_image_t image,
1409
- const void* data,
1410
- const hsa_ext_image_region_t *image_region);
1411
-
1412
- hsa_status_t (*hsa_ext_sampler_create)(
1413
- hsa_agent_t agent,
1414
- const hsa_ext_sampler_descriptor_t *sampler_descriptor,
1415
- hsa_ext_sampler_t *sampler);
1416
-
1417
- hsa_status_t (*hsa_ext_sampler_destroy)(
1418
- hsa_agent_t agent,
1419
- hsa_ext_sampler_t sampler);
1420
-
1421
- hsa_status_t (*hsa_ext_image_get_capability_with_layout)(
1422
- hsa_agent_t agent,
1423
- hsa_ext_image_geometry_t geometry,
1424
- const hsa_ext_image_format_t *image_format,
1425
- hsa_ext_image_data_layout_t image_data_layout,
1426
- uint32_t *capability_mask);
1427
-
1428
- hsa_status_t (*hsa_ext_image_data_get_info_with_layout)(
1429
- hsa_agent_t agent,
1430
- const hsa_ext_image_descriptor_t *image_descriptor,
1431
- hsa_access_permission_t access_permission,
1432
- hsa_ext_image_data_layout_t image_data_layout,
1433
- size_t image_data_row_pitch,
1434
- size_t image_data_slice_pitch,
1435
- hsa_ext_image_data_info_t *image_data_info);
1436
-
1437
- hsa_status_t (*hsa_ext_image_create_with_layout)(
1438
- hsa_agent_t agent,
1439
- const hsa_ext_image_descriptor_t *image_descriptor,
1440
- const void *image_data,
1441
- hsa_access_permission_t access_permission,
1442
- hsa_ext_image_data_layout_t image_data_layout,
1443
- size_t image_data_row_pitch,
1444
- size_t image_data_slice_pitch,
1445
- hsa_ext_image_t *image);
1446
-
1447
- } hsa_ext_images_1_pfn_t;
1448
- /** @} */
1449
-
1450
- #ifdef __cplusplus
1451
- } // end extern "C" block
1452
- #endif /*__cplusplus*/
1453
-
1454
- #endif