triton-windows 3.2.0.post18__cp39-cp39-win_amd64.whl → 3.2.0.post21__cp39-cp39-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 (111) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/backends/amd/driver.py +6 -1
  3. triton/backends/nvidia/compiler.py +1 -3
  4. triton/backends/nvidia/driver.c +1 -0
  5. triton/backends/nvidia/driver.py +8 -3
  6. triton/runtime/autotuner.py +2 -2
  7. triton/runtime/build.py +14 -6
  8. triton/runtime/tcc/lib/python310.def +1610 -0
  9. triton/runtime/tcc/lib/python311.def +1633 -0
  10. triton/runtime/tcc/lib/python312.def +1703 -0
  11. triton/runtime/tcc/lib/python313.def +1651 -0
  12. triton/runtime/tcc/lib/python313t.def +1656 -0
  13. triton/runtime/tcc/lib/python39.def +1644 -0
  14. triton/runtime/tcc/lib/python3t.def +905 -0
  15. triton/windows_utils.py +11 -4
  16. {triton_windows-3.2.0.post18.dist-info → triton_windows-3.2.0.post21.dist-info}/METADATA +1 -1
  17. {triton_windows-3.2.0.post18.dist-info → triton_windows-3.2.0.post21.dist-info}/RECORD +19 -104
  18. {triton_windows-3.2.0.post18.dist-info → triton_windows-3.2.0.post21.dist-info}/WHEEL +1 -1
  19. triton/backends/amd/include/hip/amd_detail/amd_channel_descriptor.h +0 -358
  20. triton/backends/amd/include/hip/amd_detail/amd_device_functions.h +0 -1031
  21. triton/backends/amd/include/hip/amd_detail/amd_hip_atomic.h +0 -1612
  22. triton/backends/amd/include/hip/amd_detail/amd_hip_bf16.h +0 -1337
  23. triton/backends/amd/include/hip/amd_detail/amd_hip_bfloat16.h +0 -293
  24. triton/backends/amd/include/hip/amd_detail/amd_hip_common.h +0 -32
  25. triton/backends/amd/include/hip/amd_detail/amd_hip_complex.h +0 -174
  26. triton/backends/amd/include/hip/amd_detail/amd_hip_cooperative_groups.h +0 -829
  27. triton/backends/amd/include/hip/amd_detail/amd_hip_fp16.h +0 -1809
  28. triton/backends/amd/include/hip/amd_detail/amd_hip_gl_interop.h +0 -108
  29. triton/backends/amd/include/hip/amd_detail/amd_hip_math_constants.h +0 -124
  30. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime.h +0 -405
  31. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime_pt_api.h +0 -196
  32. triton/backends/amd/include/hip/amd_detail/amd_hip_unsafe_atomics.h +0 -565
  33. triton/backends/amd/include/hip/amd_detail/amd_hip_vector_types.h +0 -2226
  34. triton/backends/amd/include/hip/amd_detail/amd_math_functions.h +0 -104
  35. triton/backends/amd/include/hip/amd_detail/amd_surface_functions.h +0 -244
  36. triton/backends/amd/include/hip/amd_detail/amd_warp_functions.h +0 -494
  37. triton/backends/amd/include/hip/amd_detail/concepts.hpp +0 -30
  38. triton/backends/amd/include/hip/amd_detail/device_library_decls.h +0 -133
  39. triton/backends/amd/include/hip/amd_detail/functional_grid_launch.hpp +0 -218
  40. triton/backends/amd/include/hip/amd_detail/grid_launch.h +0 -67
  41. triton/backends/amd/include/hip/amd_detail/grid_launch.hpp +0 -50
  42. triton/backends/amd/include/hip/amd_detail/grid_launch_GGL.hpp +0 -26
  43. triton/backends/amd/include/hip/amd_detail/helpers.hpp +0 -137
  44. triton/backends/amd/include/hip/amd_detail/hip_api_trace.hpp +0 -1350
  45. triton/backends/amd/include/hip/amd_detail/hip_assert.h +0 -101
  46. triton/backends/amd/include/hip/amd_detail/hip_cooperative_groups_helper.h +0 -242
  47. triton/backends/amd/include/hip/amd_detail/hip_fp16_gcc.h +0 -254
  48. triton/backends/amd/include/hip/amd_detail/hip_fp16_math_fwd.h +0 -96
  49. triton/backends/amd/include/hip/amd_detail/hip_ldg.h +0 -100
  50. triton/backends/amd/include/hip/amd_detail/hip_prof_str.h +0 -10169
  51. triton/backends/amd/include/hip/amd_detail/hip_runtime_prof.h +0 -77
  52. triton/backends/amd/include/hip/amd_detail/host_defines.h +0 -180
  53. triton/backends/amd/include/hip/amd_detail/hsa_helpers.hpp +0 -102
  54. triton/backends/amd/include/hip/amd_detail/macro_based_grid_launch.hpp +0 -798
  55. triton/backends/amd/include/hip/amd_detail/math_fwd.h +0 -698
  56. triton/backends/amd/include/hip/amd_detail/ockl_image.h +0 -177
  57. triton/backends/amd/include/hip/amd_detail/program_state.hpp +0 -107
  58. triton/backends/amd/include/hip/amd_detail/texture_fetch_functions.h +0 -491
  59. triton/backends/amd/include/hip/amd_detail/texture_indirect_functions.h +0 -478
  60. triton/backends/amd/include/hip/channel_descriptor.h +0 -39
  61. triton/backends/amd/include/hip/device_functions.h +0 -38
  62. triton/backends/amd/include/hip/driver_types.h +0 -468
  63. triton/backends/amd/include/hip/hip_bf16.h +0 -36
  64. triton/backends/amd/include/hip/hip_bfloat16.h +0 -44
  65. triton/backends/amd/include/hip/hip_common.h +0 -100
  66. triton/backends/amd/include/hip/hip_complex.h +0 -38
  67. triton/backends/amd/include/hip/hip_cooperative_groups.h +0 -46
  68. triton/backends/amd/include/hip/hip_deprecated.h +0 -95
  69. triton/backends/amd/include/hip/hip_ext.h +0 -159
  70. triton/backends/amd/include/hip/hip_fp16.h +0 -36
  71. triton/backends/amd/include/hip/hip_gl_interop.h +0 -32
  72. triton/backends/amd/include/hip/hip_hcc.h +0 -24
  73. triton/backends/amd/include/hip/hip_math_constants.h +0 -36
  74. triton/backends/amd/include/hip/hip_profile.h +0 -27
  75. triton/backends/amd/include/hip/hip_runtime.h +0 -75
  76. triton/backends/amd/include/hip/hip_runtime_api.h +0 -8919
  77. triton/backends/amd/include/hip/hip_texture_types.h +0 -29
  78. triton/backends/amd/include/hip/hip_vector_types.h +0 -41
  79. triton/backends/amd/include/hip/hip_version.h +0 -17
  80. triton/backends/amd/include/hip/hiprtc.h +0 -421
  81. triton/backends/amd/include/hip/library_types.h +0 -78
  82. triton/backends/amd/include/hip/math_functions.h +0 -42
  83. triton/backends/amd/include/hip/surface_types.h +0 -63
  84. triton/backends/amd/include/hip/texture_types.h +0 -194
  85. triton/backends/amd/include/hsa/Brig.h +0 -1131
  86. triton/backends/amd/include/hsa/amd_hsa_common.h +0 -91
  87. triton/backends/amd/include/hsa/amd_hsa_elf.h +0 -436
  88. triton/backends/amd/include/hsa/amd_hsa_kernel_code.h +0 -269
  89. triton/backends/amd/include/hsa/amd_hsa_queue.h +0 -109
  90. triton/backends/amd/include/hsa/amd_hsa_signal.h +0 -80
  91. triton/backends/amd/include/hsa/hsa.h +0 -5729
  92. triton/backends/amd/include/hsa/hsa_amd_tool.h +0 -91
  93. triton/backends/amd/include/hsa/hsa_api_trace.h +0 -566
  94. triton/backends/amd/include/hsa/hsa_ext_amd.h +0 -3090
  95. triton/backends/amd/include/hsa/hsa_ext_finalize.h +0 -531
  96. triton/backends/amd/include/hsa/hsa_ext_image.h +0 -1454
  97. triton/backends/amd/include/hsa/hsa_ven_amd_aqlprofile.h +0 -488
  98. triton/backends/amd/include/hsa/hsa_ven_amd_loader.h +0 -667
  99. triton/backends/amd/include/roctracer/ext/prof_protocol.h +0 -107
  100. triton/backends/amd/include/roctracer/hip_ostream_ops.h +0 -4435
  101. triton/backends/amd/include/roctracer/hsa_ostream_ops.h +0 -1467
  102. triton/backends/amd/include/roctracer/hsa_prof_str.h +0 -3027
  103. triton/backends/amd/include/roctracer/roctracer.h +0 -779
  104. triton/backends/amd/include/roctracer/roctracer_ext.h +0 -81
  105. triton/backends/amd/include/roctracer/roctracer_hcc.h +0 -24
  106. triton/backends/amd/include/roctracer/roctracer_hip.h +0 -37
  107. triton/backends/amd/include/roctracer/roctracer_hsa.h +0 -112
  108. triton/backends/amd/include/roctracer/roctracer_plugin.h +0 -137
  109. triton/backends/amd/include/roctracer/roctracer_roctx.h +0 -67
  110. triton/backends/amd/include/roctracer/roctx.h +0 -229
  111. {triton_windows-3.2.0.post18.dist-info → triton_windows-3.2.0.post21.dist-info}/top_level.txt +0 -0
@@ -1,667 +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
- // HSA AMD extension for additional loader functionality.
44
-
45
- #ifndef HSA_VEN_AMD_LOADER_H
46
- #define HSA_VEN_AMD_LOADER_H
47
-
48
- #include "hsa.h"
49
-
50
- #ifdef __cplusplus
51
- extern "C" {
52
- #endif /* __cplusplus */
53
-
54
- /**
55
- * @brief Queries equivalent host address for given @p device_address, and
56
- * records it in @p host_address.
57
- *
58
- *
59
- * @details Contents of memory pointed to by @p host_address would be identical
60
- * to contents of memory pointed to by @p device_address. Only difference
61
- * between the two is host accessibility: @p host_address is always accessible
62
- * from host, @p device_address might not be accessible from host.
63
- *
64
- * If @p device_address already points to host accessible memory, then the value
65
- * of @p device_address is simply copied into @p host_address.
66
- *
67
- * The lifetime of @p host_address is the same as the lifetime of @p
68
- * device_address, and both lifetimes are limited by the lifetime of the
69
- * executable that is managing these addresses.
70
- *
71
- *
72
- * @param[in] device_address Device address to query equivalent host address
73
- * for.
74
- *
75
- * @param[out] host_address Pointer to application-allocated buffer to record
76
- * queried equivalent host address in.
77
- *
78
- *
79
- * @retval HSA_STATUS_SUCCESS Function is executed successfully.
80
- *
81
- * @retval HSA_STATUS_ERROR_NOT_INITIALIZED Runtime is not initialized.
82
- *
83
- * @retval HSA_STATUS_ERROR_INVALID_ARGUMENT @p device_address is invalid or
84
- * null, or @p host_address is null.
85
- */
86
- hsa_status_t hsa_ven_amd_loader_query_host_address(
87
- const void *device_address,
88
- const void **host_address);
89
-
90
- /**
91
- * @brief The storage type of the code object that is backing loaded memory
92
- * segment.
93
- */
94
- typedef enum {
95
- /**
96
- * Loaded memory segment is not backed by any code object (anonymous), as the
97
- * case would be with BSS (uninitialized data).
98
- */
99
- HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE = 0,
100
- /**
101
- * Loaded memory segment is backed by the code object that is stored in the
102
- * file.
103
- */
104
- HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE = 1,
105
- /**
106
- * Loaded memory segment is backed by the code object that is stored in the
107
- * memory.
108
- */
109
- HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_MEMORY = 2
110
- } hsa_ven_amd_loader_code_object_storage_type_t;
111
-
112
- /**
113
- * @brief Loaded memory segment descriptor.
114
- *
115
- *
116
- * @details Loaded memory segment descriptor describes underlying loaded memory
117
- * segment. Loaded memory segment is created/allocated by the executable during
118
- * the loading of the code object that is backing underlying memory segment.
119
- *
120
- * The lifetime of underlying memory segment is limited by the lifetime of the
121
- * executable that is managing underlying memory segment.
122
- */
123
- typedef struct hsa_ven_amd_loader_segment_descriptor_s {
124
- /**
125
- * Agent underlying memory segment is allocated on. If the code object that is
126
- * backing underlying memory segment is program code object, then 0.
127
- */
128
- hsa_agent_t agent;
129
- /**
130
- * Executable that is managing this underlying memory segment.
131
- */
132
- hsa_executable_t executable;
133
- /**
134
- * Storage type of the code object that is backing underlying memory segment.
135
- */
136
- hsa_ven_amd_loader_code_object_storage_type_t code_object_storage_type;
137
- /**
138
- * If the storage type of the code object that is backing underlying memory
139
- * segment is:
140
- * - HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE, then null;
141
- * - HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE, then null-terminated
142
- * filepath to the code object;
143
- * - HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_MEMORY, then host
144
- * accessible pointer to the first byte of the code object.
145
- */
146
- const void *code_object_storage_base;
147
- /**
148
- * If the storage type of the code object that is backing underlying memory
149
- * segment is:
150
- * - HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE, then 0;
151
- * - HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE, then the length of
152
- * the filepath to the code object (including null-terminating character);
153
- * - HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_MEMORY, then the size, in
154
- * bytes, of the memory occupied by the code object.
155
- */
156
- size_t code_object_storage_size;
157
- /**
158
- * If the storage type of the code object that is backing underlying memory
159
- * segment is:
160
- * - HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_NONE, then 0;
161
- * - other, then offset, in bytes, from the beginning of the code object to
162
- * the first byte in the code object data is copied from.
163
- */
164
- size_t code_object_storage_offset;
165
- /**
166
- * Starting address of the underlying memory segment.
167
- */
168
- const void *segment_base;
169
- /**
170
- * Size, in bytes, of the underlying memory segment.
171
- */
172
- size_t segment_size;
173
- } hsa_ven_amd_loader_segment_descriptor_t;
174
-
175
- /**
176
- * @brief Either queries loaded memory segment descriptors, or total number of
177
- * loaded memory segment descriptors.
178
- *
179
- *
180
- * @details If @p segment_descriptors is not null and @p num_segment_descriptors
181
- * points to number that exactly matches total number of loaded memory segment
182
- * descriptors, then queries loaded memory segment descriptors, and records them
183
- * in @p segment_descriptors. If @p segment_descriptors is null and @p
184
- * num_segment_descriptors points to zero, then queries total number of loaded
185
- * memory segment descriptors, and records it in @p num_segment_descriptors. In
186
- * all other cases returns appropriate error code (see below).
187
- *
188
- * The caller of this function is responsible for the allocation/deallocation
189
- * and the lifetime of @p segment_descriptors and @p num_segment_descriptors.
190
- *
191
- * The lifetime of loaded memory segments that are described by queried loaded
192
- * memory segment descriptors is limited by the lifetime of the executable that
193
- * is managing loaded memory segments.
194
- *
195
- * Queried loaded memory segment descriptors are always self-consistent: they
196
- * describe a complete set of loaded memory segments that are being backed by
197
- * fully loaded code objects that are present at the time (i.e. this function
198
- * is blocked until all executable manipulations are fully complete).
199
- *
200
- *
201
- * @param[out] segment_descriptors Pointer to application-allocated buffer to
202
- * record queried loaded memory segment descriptors in. Can be null if @p
203
- * num_segment_descriptors points to zero.
204
- *
205
- * @param[in,out] num_segment_descriptors Pointer to application-allocated
206
- * buffer that contains either total number of loaded memory segment descriptors
207
- * or zero.
208
- *
209
- *
210
- * @retval HSA_STATUS_SUCCESS Function is executed successfully.
211
- *
212
- * @retval HSA_STATUS_ERROR_NOT_INITIALIZED Runtime is not initialized.
213
- *
214
- * @retval HSA_STATUS_ERROR_INVALID_ARGUMENT @p segment_descriptors is null
215
- * while @p num_segment_descriptors points to non-zero number, @p
216
- * segment_descriptors is not null while @p num_segment_descriptors points to
217
- * zero, or @p num_segment_descriptors is null.
218
- *
219
- * @retval HSA_STATUS_ERROR_INCOMPATIBLE_ARGUMENTS @p num_segment_descriptors
220
- * does not point to number that exactly matches total number of loaded memory
221
- * segment descriptors.
222
- */
223
- hsa_status_t hsa_ven_amd_loader_query_segment_descriptors(
224
- hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
225
- size_t *num_segment_descriptors);
226
-
227
- /**
228
- * @brief Obtains the handle of executable to which the device address belongs.
229
- *
230
- * @details This method should not be used to obtain executable handle by using
231
- * a host address. The executable returned is expected to be alive until its
232
- * destroyed by the user.
233
- *
234
- * @retval HSA_STATUS_SUCCESS Function is executed successfully.
235
- *
236
- * @retval HSA_STATUS_ERROR_NOT_INITIALIZED Runtime is not initialized.
237
- *
238
- * @retval HSA_STATUS_ERROR_INVALID_ARGUMENT The input is invalid or there
239
- * is no exectuable found for this kernel code object.
240
- */
241
- hsa_status_t hsa_ven_amd_loader_query_executable(
242
- const void *device_address,
243
- hsa_executable_t *executable);
244
-
245
- //===----------------------------------------------------------------------===//
246
-
247
- /**
248
- * @brief Iterate over the loaded code objects in an executable, and invoke
249
- * an application-defined callback on every iteration.
250
- *
251
- * @param[in] executable Executable.
252
- *
253
- * @param[in] callback Callback to be invoked once per loaded code object. The
254
- * HSA runtime passes three arguments to the callback: the executable, a
255
- * loaded code object, and the application data. If @p callback returns a
256
- * status other than ::HSA_STATUS_SUCCESS for a particular iteration, the
257
- * traversal stops and
258
- * ::hsa_ven_amd_loader_executable_iterate_loaded_code_objects returns that
259
- * status value.
260
- *
261
- * @param[in] data Application data that is passed to @p callback on every
262
- * iteration. May be NULL.
263
- *
264
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
265
- *
266
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
267
- * initialized.
268
- *
269
- * @retval ::HSA_STATUS_ERROR_INVALID_EXECUTABLE The executable is invalid.
270
- *
271
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p callback is NULL.
272
- */
273
- hsa_status_t hsa_ven_amd_loader_executable_iterate_loaded_code_objects(
274
- hsa_executable_t executable,
275
- hsa_status_t (*callback)(
276
- hsa_executable_t executable,
277
- hsa_loaded_code_object_t loaded_code_object,
278
- void *data),
279
- void *data);
280
-
281
- /**
282
- * @brief Loaded code object kind.
283
- */
284
- typedef enum {
285
- /**
286
- * Program code object.
287
- */
288
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_KIND_PROGRAM = 1,
289
- /**
290
- * Agent code object.
291
- */
292
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_KIND_AGENT = 2
293
- } hsa_ven_amd_loader_loaded_code_object_kind_t;
294
-
295
- /**
296
- * @brief Loaded code object attributes.
297
- */
298
- typedef enum hsa_ven_amd_loader_loaded_code_object_info_e {
299
- /**
300
- * The executable in which this loaded code object is loaded. The
301
- * type of this attribute is ::hsa_executable_t.
302
- */
303
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_EXECUTABLE = 1,
304
- /**
305
- * The kind of this loaded code object. The type of this attribute is
306
- * ::uint32_t interpreted as ::hsa_ven_amd_loader_loaded_code_object_kind_t.
307
- */
308
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_KIND = 2,
309
- /**
310
- * The agent on which this loaded code object is loaded. The
311
- * value of this attribute is only defined if
312
- * ::HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_KIND is
313
- * ::HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_KIND_AGENT. The type of this
314
- * attribute is ::hsa_agent_t.
315
- */
316
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_AGENT = 3,
317
- /**
318
- * The storage type of the code object reader used to load the loaded code object.
319
- * The type of this attribute is ::uint32_t interpreted as a
320
- * ::hsa_ven_amd_loader_code_object_storage_type_t.
321
- */
322
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_CODE_OBJECT_STORAGE_TYPE = 4,
323
- /**
324
- * The memory address of the first byte of the code object that was loaaded.
325
- * The value of this attribute is only defined if
326
- * ::HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_CODE_OBJECT_STORAGE_TYPE is
327
- * ::HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_MEMORY. The type of this
328
- * attribute is ::uint64_t.
329
- */
330
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_CODE_OBJECT_STORAGE_MEMORY_BASE = 5,
331
- /**
332
- * The memory size in bytes of the code object that was loaaded.
333
- * The value of this attribute is only defined if
334
- * ::HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_CODE_OBJECT_STORAGE_TYPE is
335
- * ::HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_MEMORY. The type of this
336
- * attribute is ::uint64_t.
337
- */
338
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_CODE_OBJECT_STORAGE_MEMORY_SIZE = 6,
339
- /**
340
- * The file descriptor of the code object that was loaaded.
341
- * The value of this attribute is only defined if
342
- * ::HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_CODE_OBJECT_STORAGE_TYPE is
343
- * ::HSA_VEN_AMD_LOADER_CODE_OBJECT_STORAGE_TYPE_FILE. The type of this
344
- * attribute is ::int.
345
- */
346
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_CODE_OBJECT_STORAGE_FILE = 7,
347
- /**
348
- * The signed byte address difference of the memory address at which the code
349
- * object is loaded minus the virtual address specified in the code object
350
- * that is loaded. The value of this attribute is only defined if the
351
- * executable in which the code object is loaded is froozen. The type of this
352
- * attribute is ::int64_t.
353
- */
354
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_LOAD_DELTA = 8,
355
- /**
356
- * The base memory address at which the code object is loaded. This is the
357
- * base address of the allocation for the lowest addressed segment of the code
358
- * object that is loaded. Note that any non-loaded segments before the first
359
- * loaded segment are ignored. The value of this attribute is only defined if
360
- * the executable in which the code object is loaded is froozen. The type of
361
- * this attribute is ::uint64_t.
362
- */
363
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_LOAD_BASE = 9,
364
- /**
365
- * The byte size of the loaded code objects contiguous memory allocation. The
366
- * value of this attribute is only defined if the executable in which the code
367
- * object is loaded is froozen. The type of this attribute is ::uint64_t.
368
- */
369
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_LOAD_SIZE = 10,
370
- /**
371
- * The length of the URI in bytes, not including the NUL terminator. The type
372
- * of this attribute is uint32_t.
373
- */
374
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_URI_LENGTH = 11,
375
- /**
376
- * The URI name from which the code object was loaded. The type of this
377
- * attribute is a NUL terminated \p char* with the length equal to the value
378
- * of ::HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_URI_LENGTH attribute.
379
- * The URI name syntax is defined by the following BNF syntax:
380
- *
381
- * code_object_uri ::== file_uri | memory_uri
382
- * file_uri ::== "file://" file_path [ range_specifier ]
383
- * memory_uri ::== "memory://" process_id range_specifier
384
- * range_specifier ::== [ "#" | "?" ] "offset=" number "&" "size=" number
385
- * file_path ::== URI_ENCODED_OS_FILE_PATH
386
- * process_id ::== DECIMAL_NUMBER
387
- * number ::== HEX_NUMBER | DECIMAL_NUMBER | OCTAL_NUMBER
388
- *
389
- * ``number`` is a C integral literal where hexadecimal values are prefixed by
390
- * "0x" or "0X", and octal values by "0".
391
- *
392
- * ``file_path`` is the file's path specified as a URI encoded UTF-8 string.
393
- * In URI encoding, every character that is not in the regular expression
394
- * ``[a-zA-Z0-9/_.~-]`` is encoded as two uppercase hexidecimal digits
395
- * proceeded by "%". Directories in the path are separated by "/".
396
- *
397
- * ``offset`` is a 0-based byte offset to the start of the code object. For a
398
- * file URI, it is from the start of the file specified by the ``file_path``,
399
- * and if omitted defaults to 0. For a memory URI, it is the memory address
400
- * and is required.
401
- *
402
- * ``size`` is the number of bytes in the code object. For a file URI, if
403
- * omitted it defaults to the size of the file. It is required for a memory
404
- * URI.
405
- *
406
- * ``process_id`` is the identity of the process owning the memory. For Linux
407
- * it is the C unsigned integral decimal literal for the process ID (PID).
408
- *
409
- * For example:
410
- *
411
- * file:///dir1/dir2/file1
412
- * file:///dir3/dir4/file2#offset=0x2000&size=3000
413
- * memory://1234#offset=0x20000&size=3000
414
- */
415
- HSA_VEN_AMD_LOADER_LOADED_CODE_OBJECT_INFO_URI = 12,
416
- } hsa_ven_amd_loader_loaded_code_object_info_t;
417
-
418
- /**
419
- * @brief Get the current value of an attribute for a given loaded code
420
- * object.
421
- *
422
- * @param[in] loaded_code_object Loaded code object.
423
- *
424
- * @param[in] attribute Attribute to query.
425
- *
426
- * @param[out] value Pointer to an application-allocated buffer where to store
427
- * the value of the attribute. If the buffer passed by the application is not
428
- * large enough to hold the value of @p attribute, the behavior is undefined.
429
- *
430
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
431
- *
432
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
433
- * initialized.
434
- *
435
- * @retval ::HSA_STATUS_ERROR_INVALID_CODE_OBJECT The loaded code object is
436
- * invalid.
437
- *
438
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p attribute is an invalid
439
- * loaded code object attribute, or @p value is NULL.
440
- */
441
- hsa_status_t hsa_ven_amd_loader_loaded_code_object_get_info(
442
- hsa_loaded_code_object_t loaded_code_object,
443
- hsa_ven_amd_loader_loaded_code_object_info_t attribute,
444
- void *value);
445
-
446
- //===----------------------------------------------------------------------===//
447
-
448
- /**
449
- * @brief Create a code object reader to operate on a file with size and offset.
450
- *
451
- * @param[in] file File descriptor. The file must have been opened by
452
- * application with at least read permissions prior calling this function. The
453
- * file must contain a vendor-specific code object.
454
- *
455
- * The file is owned and managed by the application; the lifetime of the file
456
- * descriptor must exceed that of any associated code object reader.
457
- *
458
- * @param[in] size Size of the code object embedded in @p file.
459
- *
460
- * @param[in] offset 0-based offset relative to the beginning of the @p file
461
- * that denotes the beginning of the code object embedded within the @p file.
462
- *
463
- * @param[out] code_object_reader Memory location to store the newly created
464
- * code object reader handle. Must not be NULL.
465
- *
466
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
467
- *
468
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
469
- * initialized.
470
- *
471
- * @retval ::HSA_STATUS_ERROR_INVALID_FILE @p file is not opened with at least
472
- * read permissions. This condition may also be reported as
473
- * ::HSA_STATUS_ERROR_INVALID_CODE_OBJECT_READER by the
474
- * ::hsa_executable_load_agent_code_object function.
475
- *
476
- * @retval ::HSA_STATUS_ERROR_INVALID_CODE_OBJECT The bytes starting at offset
477
- * do not form a valid code object. If file size is 0. Or offset > file size.
478
- * This condition may also be reported as
479
- * ::HSA_STATUS_ERROR_INVALID_CODE_OBJECT by the
480
- * ::hsa_executable_load_agent_code_object function.
481
- *
482
- * @retval ::HSA_STATUS_ERROR_OUT_OF_RESOURCES The HSA runtime failed to
483
- * allocate the required resources.
484
- *
485
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p code_object_reader is NULL.
486
- */
487
- hsa_status_t
488
- hsa_ven_amd_loader_code_object_reader_create_from_file_with_offset_size(
489
- hsa_file_t file,
490
- size_t offset,
491
- size_t size,
492
- hsa_code_object_reader_t *code_object_reader);
493
-
494
- //===----------------------------------------------------------------------===//
495
-
496
- /**
497
- * @brief Iterate over the available executables, and invoke an
498
- * application-defined callback on every iteration. While
499
- * ::hsa_ven_amd_loader_iterate_executables is executing any calls to
500
- * ::hsa_executable_create, ::hsa_executable_create_alt, or
501
- * ::hsa_executable_destroy will be blocked.
502
- *
503
- * @param[in] callback Callback to be invoked once per executable. The HSA
504
- * runtime passes two arguments to the callback: the executable and the
505
- * application data. If @p callback returns a status other than
506
- * ::HSA_STATUS_SUCCESS for a particular iteration, the traversal stops and
507
- * ::hsa_ven_amd_loader_iterate_executables returns that status value. If
508
- * @p callback invokes ::hsa_executable_create, ::hsa_executable_create_alt, or
509
- * ::hsa_executable_destroy then the behavior is undefined.
510
- *
511
- * @param[in] data Application data that is passed to @p callback on every
512
- * iteration. May be NULL.
513
- *
514
- * @retval ::HSA_STATUS_SUCCESS The function has been executed successfully.
515
- *
516
- * @retval ::HSA_STATUS_ERROR_NOT_INITIALIZED The HSA runtime has not been
517
- * initialized.
518
- *
519
- * @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT @p callback is NULL.
520
- */
521
- hsa_status_t
522
- hsa_ven_amd_loader_iterate_executables(
523
- hsa_status_t (*callback)(
524
- hsa_executable_t executable,
525
- void *data),
526
- void *data);
527
-
528
- //===----------------------------------------------------------------------===//
529
-
530
- /**
531
- * @brief Extension version.
532
- */
533
- #define hsa_ven_amd_loader 001003
534
-
535
- /**
536
- * @brief Extension function table version 1.00.
537
- */
538
- typedef struct hsa_ven_amd_loader_1_00_pfn_s {
539
- hsa_status_t (*hsa_ven_amd_loader_query_host_address)(
540
- const void *device_address,
541
- const void **host_address);
542
-
543
- hsa_status_t (*hsa_ven_amd_loader_query_segment_descriptors)(
544
- hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
545
- size_t *num_segment_descriptors);
546
-
547
- hsa_status_t (*hsa_ven_amd_loader_query_executable)(
548
- const void *device_address,
549
- hsa_executable_t *executable);
550
- } hsa_ven_amd_loader_1_00_pfn_t;
551
-
552
- /**
553
- * @brief Extension function table version 1.01.
554
- */
555
- typedef struct hsa_ven_amd_loader_1_01_pfn_s {
556
- hsa_status_t (*hsa_ven_amd_loader_query_host_address)(
557
- const void *device_address,
558
- const void **host_address);
559
-
560
- hsa_status_t (*hsa_ven_amd_loader_query_segment_descriptors)(
561
- hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
562
- size_t *num_segment_descriptors);
563
-
564
- hsa_status_t (*hsa_ven_amd_loader_query_executable)(
565
- const void *device_address,
566
- hsa_executable_t *executable);
567
-
568
- hsa_status_t (*hsa_ven_amd_loader_executable_iterate_loaded_code_objects)(
569
- hsa_executable_t executable,
570
- hsa_status_t (*callback)(
571
- hsa_executable_t executable,
572
- hsa_loaded_code_object_t loaded_code_object,
573
- void *data),
574
- void *data);
575
-
576
- hsa_status_t (*hsa_ven_amd_loader_loaded_code_object_get_info)(
577
- hsa_loaded_code_object_t loaded_code_object,
578
- hsa_ven_amd_loader_loaded_code_object_info_t attribute,
579
- void *value);
580
- } hsa_ven_amd_loader_1_01_pfn_t;
581
-
582
- /**
583
- * @brief Extension function table version 1.02.
584
- */
585
- typedef struct hsa_ven_amd_loader_1_02_pfn_s {
586
- hsa_status_t (*hsa_ven_amd_loader_query_host_address)(
587
- const void *device_address,
588
- const void **host_address);
589
-
590
- hsa_status_t (*hsa_ven_amd_loader_query_segment_descriptors)(
591
- hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
592
- size_t *num_segment_descriptors);
593
-
594
- hsa_status_t (*hsa_ven_amd_loader_query_executable)(
595
- const void *device_address,
596
- hsa_executable_t *executable);
597
-
598
- hsa_status_t (*hsa_ven_amd_loader_executable_iterate_loaded_code_objects)(
599
- hsa_executable_t executable,
600
- hsa_status_t (*callback)(
601
- hsa_executable_t executable,
602
- hsa_loaded_code_object_t loaded_code_object,
603
- void *data),
604
- void *data);
605
-
606
- hsa_status_t (*hsa_ven_amd_loader_loaded_code_object_get_info)(
607
- hsa_loaded_code_object_t loaded_code_object,
608
- hsa_ven_amd_loader_loaded_code_object_info_t attribute,
609
- void *value);
610
-
611
- hsa_status_t
612
- (*hsa_ven_amd_loader_code_object_reader_create_from_file_with_offset_size)(
613
- hsa_file_t file,
614
- size_t offset,
615
- size_t size,
616
- hsa_code_object_reader_t *code_object_reader);
617
- } hsa_ven_amd_loader_1_02_pfn_t;
618
-
619
- /**
620
- * @brief Extension function table version 1.03.
621
- */
622
- typedef struct hsa_ven_amd_loader_1_03_pfn_s {
623
- hsa_status_t (*hsa_ven_amd_loader_query_host_address)(
624
- const void *device_address,
625
- const void **host_address);
626
-
627
- hsa_status_t (*hsa_ven_amd_loader_query_segment_descriptors)(
628
- hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
629
- size_t *num_segment_descriptors);
630
-
631
- hsa_status_t (*hsa_ven_amd_loader_query_executable)(
632
- const void *device_address,
633
- hsa_executable_t *executable);
634
-
635
- hsa_status_t (*hsa_ven_amd_loader_executable_iterate_loaded_code_objects)(
636
- hsa_executable_t executable,
637
- hsa_status_t (*callback)(
638
- hsa_executable_t executable,
639
- hsa_loaded_code_object_t loaded_code_object,
640
- void *data),
641
- void *data);
642
-
643
- hsa_status_t (*hsa_ven_amd_loader_loaded_code_object_get_info)(
644
- hsa_loaded_code_object_t loaded_code_object,
645
- hsa_ven_amd_loader_loaded_code_object_info_t attribute,
646
- void *value);
647
-
648
- hsa_status_t
649
- (*hsa_ven_amd_loader_code_object_reader_create_from_file_with_offset_size)(
650
- hsa_file_t file,
651
- size_t offset,
652
- size_t size,
653
- hsa_code_object_reader_t *code_object_reader);
654
-
655
- hsa_status_t
656
- (*hsa_ven_amd_loader_iterate_executables)(
657
- hsa_status_t (*callback)(
658
- hsa_executable_t executable,
659
- void *data),
660
- void *data);
661
- } hsa_ven_amd_loader_1_03_pfn_t;
662
-
663
- #ifdef __cplusplus
664
- }
665
- #endif /* __cplusplus */
666
-
667
- #endif /* HSA_VEN_AMD_LOADER_H */