triton-windows 3.2.0.post19__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 (110) 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.py +7 -3
  5. triton/runtime/autotuner.py +2 -2
  6. triton/runtime/build.py +5 -5
  7. triton/runtime/tcc/lib/python310.def +1610 -0
  8. triton/runtime/tcc/lib/python311.def +1633 -0
  9. triton/runtime/tcc/lib/python312.def +1703 -0
  10. triton/runtime/tcc/lib/python313.def +1651 -0
  11. triton/runtime/tcc/lib/python313t.def +1656 -0
  12. triton/runtime/tcc/lib/python39.def +1644 -0
  13. triton/runtime/tcc/lib/python3t.def +905 -0
  14. triton/windows_utils.py +11 -4
  15. {triton_windows-3.2.0.post19.dist-info → triton_windows-3.2.0.post21.dist-info}/METADATA +1 -1
  16. {triton_windows-3.2.0.post19.dist-info → triton_windows-3.2.0.post21.dist-info}/RECORD +18 -103
  17. {triton_windows-3.2.0.post19.dist-info → triton_windows-3.2.0.post21.dist-info}/WHEEL +1 -1
  18. triton/backends/amd/include/hip/amd_detail/amd_channel_descriptor.h +0 -358
  19. triton/backends/amd/include/hip/amd_detail/amd_device_functions.h +0 -1031
  20. triton/backends/amd/include/hip/amd_detail/amd_hip_atomic.h +0 -1612
  21. triton/backends/amd/include/hip/amd_detail/amd_hip_bf16.h +0 -1337
  22. triton/backends/amd/include/hip/amd_detail/amd_hip_bfloat16.h +0 -293
  23. triton/backends/amd/include/hip/amd_detail/amd_hip_common.h +0 -32
  24. triton/backends/amd/include/hip/amd_detail/amd_hip_complex.h +0 -174
  25. triton/backends/amd/include/hip/amd_detail/amd_hip_cooperative_groups.h +0 -829
  26. triton/backends/amd/include/hip/amd_detail/amd_hip_fp16.h +0 -1809
  27. triton/backends/amd/include/hip/amd_detail/amd_hip_gl_interop.h +0 -108
  28. triton/backends/amd/include/hip/amd_detail/amd_hip_math_constants.h +0 -124
  29. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime.h +0 -405
  30. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime_pt_api.h +0 -196
  31. triton/backends/amd/include/hip/amd_detail/amd_hip_unsafe_atomics.h +0 -565
  32. triton/backends/amd/include/hip/amd_detail/amd_hip_vector_types.h +0 -2226
  33. triton/backends/amd/include/hip/amd_detail/amd_math_functions.h +0 -104
  34. triton/backends/amd/include/hip/amd_detail/amd_surface_functions.h +0 -244
  35. triton/backends/amd/include/hip/amd_detail/amd_warp_functions.h +0 -494
  36. triton/backends/amd/include/hip/amd_detail/concepts.hpp +0 -30
  37. triton/backends/amd/include/hip/amd_detail/device_library_decls.h +0 -133
  38. triton/backends/amd/include/hip/amd_detail/functional_grid_launch.hpp +0 -218
  39. triton/backends/amd/include/hip/amd_detail/grid_launch.h +0 -67
  40. triton/backends/amd/include/hip/amd_detail/grid_launch.hpp +0 -50
  41. triton/backends/amd/include/hip/amd_detail/grid_launch_GGL.hpp +0 -26
  42. triton/backends/amd/include/hip/amd_detail/helpers.hpp +0 -137
  43. triton/backends/amd/include/hip/amd_detail/hip_api_trace.hpp +0 -1350
  44. triton/backends/amd/include/hip/amd_detail/hip_assert.h +0 -101
  45. triton/backends/amd/include/hip/amd_detail/hip_cooperative_groups_helper.h +0 -242
  46. triton/backends/amd/include/hip/amd_detail/hip_fp16_gcc.h +0 -254
  47. triton/backends/amd/include/hip/amd_detail/hip_fp16_math_fwd.h +0 -96
  48. triton/backends/amd/include/hip/amd_detail/hip_ldg.h +0 -100
  49. triton/backends/amd/include/hip/amd_detail/hip_prof_str.h +0 -10169
  50. triton/backends/amd/include/hip/amd_detail/hip_runtime_prof.h +0 -77
  51. triton/backends/amd/include/hip/amd_detail/host_defines.h +0 -180
  52. triton/backends/amd/include/hip/amd_detail/hsa_helpers.hpp +0 -102
  53. triton/backends/amd/include/hip/amd_detail/macro_based_grid_launch.hpp +0 -798
  54. triton/backends/amd/include/hip/amd_detail/math_fwd.h +0 -698
  55. triton/backends/amd/include/hip/amd_detail/ockl_image.h +0 -177
  56. triton/backends/amd/include/hip/amd_detail/program_state.hpp +0 -107
  57. triton/backends/amd/include/hip/amd_detail/texture_fetch_functions.h +0 -491
  58. triton/backends/amd/include/hip/amd_detail/texture_indirect_functions.h +0 -478
  59. triton/backends/amd/include/hip/channel_descriptor.h +0 -39
  60. triton/backends/amd/include/hip/device_functions.h +0 -38
  61. triton/backends/amd/include/hip/driver_types.h +0 -468
  62. triton/backends/amd/include/hip/hip_bf16.h +0 -36
  63. triton/backends/amd/include/hip/hip_bfloat16.h +0 -44
  64. triton/backends/amd/include/hip/hip_common.h +0 -100
  65. triton/backends/amd/include/hip/hip_complex.h +0 -38
  66. triton/backends/amd/include/hip/hip_cooperative_groups.h +0 -46
  67. triton/backends/amd/include/hip/hip_deprecated.h +0 -95
  68. triton/backends/amd/include/hip/hip_ext.h +0 -159
  69. triton/backends/amd/include/hip/hip_fp16.h +0 -36
  70. triton/backends/amd/include/hip/hip_gl_interop.h +0 -32
  71. triton/backends/amd/include/hip/hip_hcc.h +0 -24
  72. triton/backends/amd/include/hip/hip_math_constants.h +0 -36
  73. triton/backends/amd/include/hip/hip_profile.h +0 -27
  74. triton/backends/amd/include/hip/hip_runtime.h +0 -75
  75. triton/backends/amd/include/hip/hip_runtime_api.h +0 -8919
  76. triton/backends/amd/include/hip/hip_texture_types.h +0 -29
  77. triton/backends/amd/include/hip/hip_vector_types.h +0 -41
  78. triton/backends/amd/include/hip/hip_version.h +0 -17
  79. triton/backends/amd/include/hip/hiprtc.h +0 -421
  80. triton/backends/amd/include/hip/library_types.h +0 -78
  81. triton/backends/amd/include/hip/math_functions.h +0 -42
  82. triton/backends/amd/include/hip/surface_types.h +0 -63
  83. triton/backends/amd/include/hip/texture_types.h +0 -194
  84. triton/backends/amd/include/hsa/Brig.h +0 -1131
  85. triton/backends/amd/include/hsa/amd_hsa_common.h +0 -91
  86. triton/backends/amd/include/hsa/amd_hsa_elf.h +0 -436
  87. triton/backends/amd/include/hsa/amd_hsa_kernel_code.h +0 -269
  88. triton/backends/amd/include/hsa/amd_hsa_queue.h +0 -109
  89. triton/backends/amd/include/hsa/amd_hsa_signal.h +0 -80
  90. triton/backends/amd/include/hsa/hsa.h +0 -5729
  91. triton/backends/amd/include/hsa/hsa_amd_tool.h +0 -91
  92. triton/backends/amd/include/hsa/hsa_api_trace.h +0 -566
  93. triton/backends/amd/include/hsa/hsa_ext_amd.h +0 -3090
  94. triton/backends/amd/include/hsa/hsa_ext_finalize.h +0 -531
  95. triton/backends/amd/include/hsa/hsa_ext_image.h +0 -1454
  96. triton/backends/amd/include/hsa/hsa_ven_amd_aqlprofile.h +0 -488
  97. triton/backends/amd/include/hsa/hsa_ven_amd_loader.h +0 -667
  98. triton/backends/amd/include/roctracer/ext/prof_protocol.h +0 -107
  99. triton/backends/amd/include/roctracer/hip_ostream_ops.h +0 -4435
  100. triton/backends/amd/include/roctracer/hsa_ostream_ops.h +0 -1467
  101. triton/backends/amd/include/roctracer/hsa_prof_str.h +0 -3027
  102. triton/backends/amd/include/roctracer/roctracer.h +0 -779
  103. triton/backends/amd/include/roctracer/roctracer_ext.h +0 -81
  104. triton/backends/amd/include/roctracer/roctracer_hcc.h +0 -24
  105. triton/backends/amd/include/roctracer/roctracer_hip.h +0 -37
  106. triton/backends/amd/include/roctracer/roctracer_hsa.h +0 -112
  107. triton/backends/amd/include/roctracer/roctracer_plugin.h +0 -137
  108. triton/backends/amd/include/roctracer/roctracer_roctx.h +0 -67
  109. triton/backends/amd/include/roctracer/roctx.h +0 -229
  110. {triton_windows-3.2.0.post19.dist-info → triton_windows-3.2.0.post21.dist-info}/top_level.txt +0 -0
@@ -1,494 +0,0 @@
1
- /*
2
- Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved.
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in
12
- all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
- */
22
-
23
- #ifndef HIP_INCLUDE_HIP_AMD_DETAIL_WARP_FUNCTIONS_H
24
- #define HIP_INCLUDE_HIP_AMD_DETAIL_WARP_FUNCTIONS_H
25
-
26
- __device__ static inline unsigned __hip_ds_bpermute(int index, unsigned src) {
27
- union { int i; unsigned u; float f; } tmp; tmp.u = src;
28
- tmp.i = __builtin_amdgcn_ds_bpermute(index, tmp.i);
29
- return tmp.u;
30
- }
31
-
32
- __device__ static inline float __hip_ds_bpermutef(int index, float src) {
33
- union { int i; unsigned u; float f; } tmp; tmp.f = src;
34
- tmp.i = __builtin_amdgcn_ds_bpermute(index, tmp.i);
35
- return tmp.f;
36
- }
37
-
38
- __device__ static inline unsigned __hip_ds_permute(int index, unsigned src) {
39
- union { int i; unsigned u; float f; } tmp; tmp.u = src;
40
- tmp.i = __builtin_amdgcn_ds_permute(index, tmp.i);
41
- return tmp.u;
42
- }
43
-
44
- __device__ static inline float __hip_ds_permutef(int index, float src) {
45
- union { int i; unsigned u; float f; } tmp; tmp.f = src;
46
- tmp.i = __builtin_amdgcn_ds_permute(index, tmp.i);
47
- return tmp.f;
48
- }
49
-
50
- #define __hip_ds_swizzle(src, pattern) __hip_ds_swizzle_N<(pattern)>((src))
51
- #define __hip_ds_swizzlef(src, pattern) __hip_ds_swizzlef_N<(pattern)>((src))
52
-
53
- template <int pattern>
54
- __device__ static inline unsigned __hip_ds_swizzle_N(unsigned int src) {
55
- union { int i; unsigned u; float f; } tmp; tmp.u = src;
56
- tmp.i = __builtin_amdgcn_ds_swizzle(tmp.i, pattern);
57
- return tmp.u;
58
- }
59
-
60
- template <int pattern>
61
- __device__ static inline float __hip_ds_swizzlef_N(float src) {
62
- union { int i; unsigned u; float f; } tmp; tmp.f = src;
63
- tmp.i = __builtin_amdgcn_ds_swizzle(tmp.i, pattern);
64
- return tmp.f;
65
- }
66
-
67
- #define __hip_move_dpp(src, dpp_ctrl, row_mask, bank_mask, bound_ctrl) \
68
- __hip_move_dpp_N<(dpp_ctrl), (row_mask), (bank_mask), (bound_ctrl)>((src))
69
-
70
- template <int dpp_ctrl, int row_mask, int bank_mask, bool bound_ctrl>
71
- __device__ static inline int __hip_move_dpp_N(int src) {
72
- return __builtin_amdgcn_mov_dpp(src, dpp_ctrl, row_mask, bank_mask,
73
- bound_ctrl);
74
- }
75
-
76
- static constexpr int warpSize = __AMDGCN_WAVEFRONT_SIZE;
77
-
78
- __device__
79
- inline
80
- int __shfl(int var, int src_lane, int width = warpSize) {
81
- int self = __lane_id();
82
- int index = (src_lane & (width - 1)) + (self & ~(width-1));
83
- return __builtin_amdgcn_ds_bpermute(index<<2, var);
84
- }
85
- __device__
86
- inline
87
- unsigned int __shfl(unsigned int var, int src_lane, int width = warpSize) {
88
- union { int i; unsigned u; float f; } tmp; tmp.u = var;
89
- tmp.i = __shfl(tmp.i, src_lane, width);
90
- return tmp.u;
91
- }
92
- __device__
93
- inline
94
- float __shfl(float var, int src_lane, int width = warpSize) {
95
- union { int i; unsigned u; float f; } tmp; tmp.f = var;
96
- tmp.i = __shfl(tmp.i, src_lane, width);
97
- return tmp.f;
98
- }
99
- __device__
100
- inline
101
- double __shfl(double var, int src_lane, int width = warpSize) {
102
- static_assert(sizeof(double) == 2 * sizeof(int), "");
103
- static_assert(sizeof(double) == sizeof(uint64_t), "");
104
-
105
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
106
- tmp[0] = __shfl(tmp[0], src_lane, width);
107
- tmp[1] = __shfl(tmp[1], src_lane, width);
108
-
109
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
110
- double tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
111
- return tmp1;
112
- }
113
- __device__
114
- inline
115
- long __shfl(long var, int src_lane, int width = warpSize)
116
- {
117
- #ifndef _MSC_VER
118
- static_assert(sizeof(long) == 2 * sizeof(int), "");
119
- static_assert(sizeof(long) == sizeof(uint64_t), "");
120
-
121
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
122
- tmp[0] = __shfl(tmp[0], src_lane, width);
123
- tmp[1] = __shfl(tmp[1], src_lane, width);
124
-
125
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
126
- long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
127
- return tmp1;
128
- #else
129
- static_assert(sizeof(long) == sizeof(int), "");
130
- return static_cast<long>(__shfl(static_cast<int>(var), src_lane, width));
131
- #endif
132
- }
133
- __device__
134
- inline
135
- unsigned long __shfl(unsigned long var, int src_lane, int width = warpSize) {
136
- #ifndef _MSC_VER
137
- static_assert(sizeof(unsigned long) == 2 * sizeof(unsigned int), "");
138
- static_assert(sizeof(unsigned long) == sizeof(uint64_t), "");
139
-
140
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
141
- tmp[0] = __shfl(tmp[0], src_lane, width);
142
- tmp[1] = __shfl(tmp[1], src_lane, width);
143
-
144
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
145
- unsigned long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
146
- return tmp1;
147
- #else
148
- static_assert(sizeof(unsigned long) == sizeof(unsigned int), "");
149
- return static_cast<unsigned long>(__shfl(static_cast<unsigned int>(var), src_lane, width));
150
- #endif
151
- }
152
- __device__
153
- inline
154
- long long __shfl(long long var, int src_lane, int width = warpSize)
155
- {
156
- static_assert(sizeof(long long) == 2 * sizeof(int), "");
157
- static_assert(sizeof(long long) == sizeof(uint64_t), "");
158
-
159
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
160
- tmp[0] = __shfl(tmp[0], src_lane, width);
161
- tmp[1] = __shfl(tmp[1], src_lane, width);
162
-
163
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
164
- long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
165
- return tmp1;
166
- }
167
- __device__
168
- inline
169
- unsigned long long __shfl(unsigned long long var, int src_lane, int width = warpSize) {
170
- static_assert(sizeof(unsigned long long) == 2 * sizeof(unsigned int), "");
171
- static_assert(sizeof(unsigned long long) == sizeof(uint64_t), "");
172
-
173
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
174
- tmp[0] = __shfl(tmp[0], src_lane, width);
175
- tmp[1] = __shfl(tmp[1], src_lane, width);
176
-
177
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
178
- unsigned long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
179
- return tmp1;
180
- }
181
-
182
- __device__
183
- inline
184
- int __shfl_up(int var, unsigned int lane_delta, int width = warpSize) {
185
- int self = __lane_id();
186
- int index = self - lane_delta;
187
- index = (index < (self & ~(width-1)))?self:index;
188
- return __builtin_amdgcn_ds_bpermute(index<<2, var);
189
- }
190
- __device__
191
- inline
192
- unsigned int __shfl_up(unsigned int var, unsigned int lane_delta, int width = warpSize) {
193
- union { int i; unsigned u; float f; } tmp; tmp.u = var;
194
- tmp.i = __shfl_up(tmp.i, lane_delta, width);
195
- return tmp.u;
196
- }
197
- __device__
198
- inline
199
- float __shfl_up(float var, unsigned int lane_delta, int width = warpSize) {
200
- union { int i; unsigned u; float f; } tmp; tmp.f = var;
201
- tmp.i = __shfl_up(tmp.i, lane_delta, width);
202
- return tmp.f;
203
- }
204
- __device__
205
- inline
206
- double __shfl_up(double var, unsigned int lane_delta, int width = warpSize) {
207
- static_assert(sizeof(double) == 2 * sizeof(int), "");
208
- static_assert(sizeof(double) == sizeof(uint64_t), "");
209
-
210
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
211
- tmp[0] = __shfl_up(tmp[0], lane_delta, width);
212
- tmp[1] = __shfl_up(tmp[1], lane_delta, width);
213
-
214
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
215
- double tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
216
- return tmp1;
217
- }
218
- __device__
219
- inline
220
- long __shfl_up(long var, unsigned int lane_delta, int width = warpSize)
221
- {
222
- #ifndef _MSC_VER
223
- static_assert(sizeof(long) == 2 * sizeof(int), "");
224
- static_assert(sizeof(long) == sizeof(uint64_t), "");
225
-
226
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
227
- tmp[0] = __shfl_up(tmp[0], lane_delta, width);
228
- tmp[1] = __shfl_up(tmp[1], lane_delta, width);
229
-
230
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
231
- long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
232
- return tmp1;
233
- #else
234
- static_assert(sizeof(long) == sizeof(int), "");
235
- return static_cast<long>(__shfl_up(static_cast<int>(var), lane_delta, width));
236
- #endif
237
- }
238
-
239
- __device__
240
- inline
241
- unsigned long __shfl_up(unsigned long var, unsigned int lane_delta, int width = warpSize)
242
- {
243
- #ifndef _MSC_VER
244
- static_assert(sizeof(unsigned long) == 2 * sizeof(unsigned int), "");
245
- static_assert(sizeof(unsigned long) == sizeof(uint64_t), "");
246
-
247
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
248
- tmp[0] = __shfl_up(tmp[0], lane_delta, width);
249
- tmp[1] = __shfl_up(tmp[1], lane_delta, width);
250
-
251
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
252
- unsigned long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
253
- return tmp1;
254
- #else
255
- static_assert(sizeof(unsigned long) == sizeof(unsigned int), "");
256
- return static_cast<unsigned long>(__shfl_up(static_cast<unsigned int>(var), lane_delta, width));
257
- #endif
258
- }
259
-
260
- __device__
261
- inline
262
- long long __shfl_up(long long var, unsigned int lane_delta, int width = warpSize)
263
- {
264
- static_assert(sizeof(long long) == 2 * sizeof(int), "");
265
- static_assert(sizeof(long long) == sizeof(uint64_t), "");
266
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
267
- tmp[0] = __shfl_up(tmp[0], lane_delta, width);
268
- tmp[1] = __shfl_up(tmp[1], lane_delta, width);
269
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
270
- long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
271
- return tmp1;
272
- }
273
-
274
- __device__
275
- inline
276
- unsigned long long __shfl_up(unsigned long long var, unsigned int lane_delta, int width = warpSize)
277
- {
278
- static_assert(sizeof(unsigned long long) == 2 * sizeof(unsigned int), "");
279
- static_assert(sizeof(unsigned long long) == sizeof(uint64_t), "");
280
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
281
- tmp[0] = __shfl_up(tmp[0], lane_delta, width);
282
- tmp[1] = __shfl_up(tmp[1], lane_delta, width);
283
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
284
- unsigned long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
285
- return tmp1;
286
- }
287
-
288
- __device__
289
- inline
290
- int __shfl_down(int var, unsigned int lane_delta, int width = warpSize) {
291
- int self = __lane_id();
292
- int index = self + lane_delta;
293
- index = (int)((self&(width-1))+lane_delta) >= width?self:index;
294
- return __builtin_amdgcn_ds_bpermute(index<<2, var);
295
- }
296
- __device__
297
- inline
298
- unsigned int __shfl_down(unsigned int var, unsigned int lane_delta, int width = warpSize) {
299
- union { int i; unsigned u; float f; } tmp; tmp.u = var;
300
- tmp.i = __shfl_down(tmp.i, lane_delta, width);
301
- return tmp.u;
302
- }
303
- __device__
304
- inline
305
- float __shfl_down(float var, unsigned int lane_delta, int width = warpSize) {
306
- union { int i; unsigned u; float f; } tmp; tmp.f = var;
307
- tmp.i = __shfl_down(tmp.i, lane_delta, width);
308
- return tmp.f;
309
- }
310
- __device__
311
- inline
312
- double __shfl_down(double var, unsigned int lane_delta, int width = warpSize) {
313
- static_assert(sizeof(double) == 2 * sizeof(int), "");
314
- static_assert(sizeof(double) == sizeof(uint64_t), "");
315
-
316
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
317
- tmp[0] = __shfl_down(tmp[0], lane_delta, width);
318
- tmp[1] = __shfl_down(tmp[1], lane_delta, width);
319
-
320
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
321
- double tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
322
- return tmp1;
323
- }
324
- __device__
325
- inline
326
- long __shfl_down(long var, unsigned int lane_delta, int width = warpSize)
327
- {
328
- #ifndef _MSC_VER
329
- static_assert(sizeof(long) == 2 * sizeof(int), "");
330
- static_assert(sizeof(long) == sizeof(uint64_t), "");
331
-
332
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
333
- tmp[0] = __shfl_down(tmp[0], lane_delta, width);
334
- tmp[1] = __shfl_down(tmp[1], lane_delta, width);
335
-
336
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
337
- long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
338
- return tmp1;
339
- #else
340
- static_assert(sizeof(long) == sizeof(int), "");
341
- return static_cast<long>(__shfl_down(static_cast<int>(var), lane_delta, width));
342
- #endif
343
- }
344
- __device__
345
- inline
346
- unsigned long __shfl_down(unsigned long var, unsigned int lane_delta, int width = warpSize)
347
- {
348
- #ifndef _MSC_VER
349
- static_assert(sizeof(unsigned long) == 2 * sizeof(unsigned int), "");
350
- static_assert(sizeof(unsigned long) == sizeof(uint64_t), "");
351
-
352
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
353
- tmp[0] = __shfl_down(tmp[0], lane_delta, width);
354
- tmp[1] = __shfl_down(tmp[1], lane_delta, width);
355
-
356
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
357
- unsigned long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
358
- return tmp1;
359
- #else
360
- static_assert(sizeof(unsigned long) == sizeof(unsigned int), "");
361
- return static_cast<unsigned long>(__shfl_down(static_cast<unsigned int>(var), lane_delta, width));
362
- #endif
363
- }
364
- __device__
365
- inline
366
- long long __shfl_down(long long var, unsigned int lane_delta, int width = warpSize)
367
- {
368
- static_assert(sizeof(long long) == 2 * sizeof(int), "");
369
- static_assert(sizeof(long long) == sizeof(uint64_t), "");
370
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
371
- tmp[0] = __shfl_down(tmp[0], lane_delta, width);
372
- tmp[1] = __shfl_down(tmp[1], lane_delta, width);
373
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
374
- long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
375
- return tmp1;
376
- }
377
- __device__
378
- inline
379
- unsigned long long __shfl_down(unsigned long long var, unsigned int lane_delta, int width = warpSize)
380
- {
381
- static_assert(sizeof(unsigned long long) == 2 * sizeof(unsigned int), "");
382
- static_assert(sizeof(unsigned long long) == sizeof(uint64_t), "");
383
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
384
- tmp[0] = __shfl_down(tmp[0], lane_delta, width);
385
- tmp[1] = __shfl_down(tmp[1], lane_delta, width);
386
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
387
- unsigned long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
388
- return tmp1;
389
- }
390
-
391
- __device__
392
- inline
393
- int __shfl_xor(int var, int lane_mask, int width = warpSize) {
394
- int self = __lane_id();
395
- int index = self^lane_mask;
396
- index = index >= ((self+width)&~(width-1))?self:index;
397
- return __builtin_amdgcn_ds_bpermute(index<<2, var);
398
- }
399
- __device__
400
- inline
401
- unsigned int __shfl_xor(unsigned int var, int lane_mask, int width = warpSize) {
402
- union { int i; unsigned u; float f; } tmp; tmp.u = var;
403
- tmp.i = __shfl_xor(tmp.i, lane_mask, width);
404
- return tmp.u;
405
- }
406
- __device__
407
- inline
408
- float __shfl_xor(float var, int lane_mask, int width = warpSize) {
409
- union { int i; unsigned u; float f; } tmp; tmp.f = var;
410
- tmp.i = __shfl_xor(tmp.i, lane_mask, width);
411
- return tmp.f;
412
- }
413
- __device__
414
- inline
415
- double __shfl_xor(double var, int lane_mask, int width = warpSize) {
416
- static_assert(sizeof(double) == 2 * sizeof(int), "");
417
- static_assert(sizeof(double) == sizeof(uint64_t), "");
418
-
419
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
420
- tmp[0] = __shfl_xor(tmp[0], lane_mask, width);
421
- tmp[1] = __shfl_xor(tmp[1], lane_mask, width);
422
-
423
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
424
- double tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
425
- return tmp1;
426
- }
427
- __device__
428
- inline
429
- long __shfl_xor(long var, int lane_mask, int width = warpSize)
430
- {
431
- #ifndef _MSC_VER
432
- static_assert(sizeof(long) == 2 * sizeof(int), "");
433
- static_assert(sizeof(long) == sizeof(uint64_t), "");
434
-
435
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
436
- tmp[0] = __shfl_xor(tmp[0], lane_mask, width);
437
- tmp[1] = __shfl_xor(tmp[1], lane_mask, width);
438
-
439
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
440
- long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
441
- return tmp1;
442
- #else
443
- static_assert(sizeof(long) == sizeof(int), "");
444
- return static_cast<long>(__shfl_xor(static_cast<int>(var), lane_mask, width));
445
- #endif
446
- }
447
- __device__
448
- inline
449
- unsigned long __shfl_xor(unsigned long var, int lane_mask, int width = warpSize)
450
- {
451
- #ifndef _MSC_VER
452
- static_assert(sizeof(unsigned long) == 2 * sizeof(unsigned int), "");
453
- static_assert(sizeof(unsigned long) == sizeof(uint64_t), "");
454
-
455
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
456
- tmp[0] = __shfl_xor(tmp[0], lane_mask, width);
457
- tmp[1] = __shfl_xor(tmp[1], lane_mask, width);
458
-
459
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
460
- unsigned long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
461
- return tmp1;
462
- #else
463
- static_assert(sizeof(unsigned long) == sizeof(unsigned int), "");
464
- return static_cast<unsigned long>(__shfl_xor(static_cast<unsigned int>(var), lane_mask, width));
465
- #endif
466
- }
467
- __device__
468
- inline
469
- long long __shfl_xor(long long var, int lane_mask, int width = warpSize)
470
- {
471
- static_assert(sizeof(long long) == 2 * sizeof(int), "");
472
- static_assert(sizeof(long long) == sizeof(uint64_t), "");
473
- int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
474
- tmp[0] = __shfl_xor(tmp[0], lane_mask, width);
475
- tmp[1] = __shfl_xor(tmp[1], lane_mask, width);
476
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
477
- long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
478
- return tmp1;
479
- }
480
- __device__
481
- inline
482
- unsigned long long __shfl_xor(unsigned long long var, int lane_mask, int width = warpSize)
483
- {
484
- static_assert(sizeof(unsigned long long) == 2 * sizeof(unsigned int), "");
485
- static_assert(sizeof(unsigned long long) == sizeof(uint64_t), "");
486
- unsigned int tmp[2]; __builtin_memcpy(tmp, &var, sizeof(tmp));
487
- tmp[0] = __shfl_xor(tmp[0], lane_mask, width);
488
- tmp[1] = __shfl_xor(tmp[1], lane_mask, width);
489
- uint64_t tmp0 = (static_cast<uint64_t>(tmp[1]) << 32ull) | static_cast<uint32_t>(tmp[0]);
490
- unsigned long long tmp1; __builtin_memcpy(&tmp1, &tmp0, sizeof(tmp0));
491
- return tmp1;
492
- }
493
-
494
- #endif
@@ -1,30 +0,0 @@
1
- /*
2
- Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in
12
- all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
- */
22
-
23
- #pragma once
24
-
25
- namespace hip_impl // Documentation only.
26
- {
27
- #define requires(...)
28
-
29
- #define FunctionalProcedure typename
30
- } // namespace hip_impl
@@ -1,133 +0,0 @@
1
- /*
2
- Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in
12
- all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
- */
22
-
23
- /**
24
- * @file amd_detail/device_library_decls.h
25
- * @brief Contains declarations for types and functions in device library.
26
- * Uses int64_t and uint64_t instead of long, long long, unsigned
27
- * long and unsigned long long types for device library API
28
- * declarations.
29
- */
30
-
31
- #ifndef HIP_INCLUDE_HIP_AMD_DETAIL_DEVICE_LIBRARY_DECLS_H
32
- #define HIP_INCLUDE_HIP_AMD_DETAIL_DEVICE_LIBRARY_DECLS_H
33
-
34
- #if !defined(__HIPCC_RTC__)
35
- #include "hip/amd_detail/host_defines.h"
36
- #endif
37
-
38
- typedef unsigned char uchar;
39
- typedef unsigned short ushort;
40
- typedef unsigned int uint;
41
- typedef unsigned long ulong;
42
- typedef unsigned long long ullong;
43
-
44
- extern "C" __device__ __attribute__((const)) bool __ockl_wfany_i32(int);
45
- extern "C" __device__ __attribute__((const)) bool __ockl_wfall_i32(int);
46
- extern "C" __device__ uint __ockl_activelane_u32(void);
47
-
48
- extern "C" __device__ __attribute__((const)) uint __ockl_mul24_u32(uint, uint);
49
- extern "C" __device__ __attribute__((const)) int __ockl_mul24_i32(int, int);
50
- extern "C" __device__ __attribute__((const)) uint __ockl_mul_hi_u32(uint, uint);
51
- extern "C" __device__ __attribute__((const)) int __ockl_mul_hi_i32(int, int);
52
- extern "C" __device__ __attribute__((const)) uint __ockl_sadd_u32(uint, uint, uint);
53
-
54
- extern "C" __device__ __attribute__((const)) uchar __ockl_clz_u8(uchar);
55
- extern "C" __device__ __attribute__((const)) ushort __ockl_clz_u16(ushort);
56
- extern "C" __device__ __attribute__((const)) uint __ockl_clz_u32(uint);
57
- extern "C" __device__ __attribute__((const)) uint64_t __ockl_clz_u64(uint64_t);
58
-
59
- extern "C" __device__ __attribute__((const)) float __ocml_floor_f32(float);
60
- extern "C" __device__ __attribute__((const)) float __ocml_rint_f32(float);
61
- extern "C" __device__ __attribute__((const)) float __ocml_ceil_f32(float);
62
- extern "C" __device__ __attribute__((const)) float __ocml_trunc_f32(float);
63
-
64
- extern "C" __device__ __attribute__((const)) float __ocml_fmin_f32(float, float);
65
- extern "C" __device__ __attribute__((const)) float __ocml_fmax_f32(float, float);
66
-
67
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtn_f32_f64(double);
68
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtp_f32_f64(double);
69
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtz_f32_f64(double);
70
-
71
- extern "C" __device__ __attribute__((const)) _Float16 __ocml_cvtrtn_f16_f32(float);
72
- extern "C" __device__ __attribute__((const)) _Float16 __ocml_cvtrtp_f16_f32(float);
73
- extern "C" __device__ __attribute__((const)) _Float16 __ocml_cvtrtz_f16_f32(float);
74
-
75
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtn_f32_s32(int);
76
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtp_f32_s32(int);
77
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtz_f32_s32(int);
78
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtn_f32_u32(uint32_t);
79
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtp_f32_u32(uint32_t);
80
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtz_f32_u32(uint32_t);
81
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtn_f32_s64(int64_t);
82
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtp_f32_s64(int64_t);
83
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtz_f32_s64(int64_t);
84
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtn_f32_u64(uint64_t);
85
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtp_f32_u64(uint64_t);
86
- extern "C" __device__ __attribute__((const)) float __ocml_cvtrtz_f32_u64(uint64_t);
87
- extern "C" __device__ __attribute__((const)) double __ocml_cvtrtn_f64_s64(int64_t);
88
- extern "C" __device__ __attribute__((const)) double __ocml_cvtrtp_f64_s64(int64_t);
89
- extern "C" __device__ __attribute__((const)) double __ocml_cvtrtz_f64_s64(int64_t);
90
- extern "C" __device__ __attribute__((const)) double __ocml_cvtrtn_f64_u64(uint64_t);
91
- extern "C" __device__ __attribute__((const)) double __ocml_cvtrtp_f64_u64(uint64_t);
92
- extern "C" __device__ __attribute__((const)) double __ocml_cvtrtz_f64_u64(uint64_t);
93
-
94
- extern "C" __device__ __attribute__((convergent)) void __ockl_gws_init(uint nwm1, uint rid);
95
- extern "C" __device__ __attribute__((convergent)) void __ockl_gws_barrier(uint nwm1, uint rid);
96
-
97
- extern "C" __device__ __attribute__((const)) uint32_t __ockl_lane_u32();
98
- extern "C" __device__ __attribute__((const)) int __ockl_grid_is_valid(void);
99
- extern "C" __device__ __attribute__((convergent)) void __ockl_grid_sync(void);
100
- extern "C" __device__ __attribute__((const)) uint __ockl_multi_grid_num_grids(void);
101
- extern "C" __device__ __attribute__((const)) uint __ockl_multi_grid_grid_rank(void);
102
- extern "C" __device__ __attribute__((const)) uint __ockl_multi_grid_size(void);
103
- extern "C" __device__ __attribute__((const)) uint __ockl_multi_grid_thread_rank(void);
104
- extern "C" __device__ __attribute__((const)) int __ockl_multi_grid_is_valid(void);
105
- extern "C" __device__ __attribute__((convergent)) void __ockl_multi_grid_sync(void);
106
-
107
- extern "C" __device__ void __ockl_atomic_add_noret_f32(float*, float);
108
-
109
- extern "C" __device__ __attribute__((convergent)) int __ockl_wgred_add_i32(int a);
110
- extern "C" __device__ __attribute__((convergent)) int __ockl_wgred_and_i32(int a);
111
- extern "C" __device__ __attribute__((convergent)) int __ockl_wgred_or_i32(int a);
112
-
113
- extern "C" __device__ uint64_t __ockl_fprintf_stderr_begin();
114
- extern "C" __device__ uint64_t __ockl_fprintf_append_args(uint64_t msg_desc, uint32_t num_args,
115
- uint64_t value0, uint64_t value1,
116
- uint64_t value2, uint64_t value3,
117
- uint64_t value4, uint64_t value5,
118
- uint64_t value6, uint32_t is_last);
119
- extern "C" __device__ uint64_t __ockl_fprintf_append_string_n(uint64_t msg_desc, const char* data,
120
- uint64_t length, uint32_t is_last);
121
-
122
- // Introduce local address space
123
- #define __local __attribute__((address_space(3)))
124
-
125
- #ifdef __HIP_DEVICE_COMPILE__
126
- __device__ inline static __local void* __to_local(unsigned x) { return (__local void*)x; }
127
- #endif //__HIP_DEVICE_COMPILE__
128
-
129
- // Using hip.amdgcn.bc - sync threads
130
- #define __CLK_LOCAL_MEM_FENCE 0x01
131
- typedef unsigned __cl_mem_fence_flags;
132
-
133
- #endif