triton-windows 3.3.1.post19__cp313-cp313-win_amd64.whl → 3.5.0.post21__cp313-cp313-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 (225) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/__init__.py +11 -2
  3. triton/_filecheck.py +97 -0
  4. triton/_internal_testing.py +95 -18
  5. triton/_utils.py +112 -21
  6. triton/backends/__init__.py +20 -23
  7. triton/backends/amd/__init__.py +0 -0
  8. triton/backends/amd/compiler.py +161 -119
  9. triton/backends/amd/driver.c +118 -46
  10. triton/backends/amd/driver.py +274 -96
  11. triton/backends/compiler.py +7 -21
  12. triton/backends/driver.py +13 -0
  13. triton/backends/nvidia/bin/ptxas.exe +0 -0
  14. triton/backends/nvidia/compiler.py +163 -106
  15. triton/backends/nvidia/driver.c +166 -101
  16. triton/backends/nvidia/driver.py +384 -202
  17. triton/compiler/__init__.py +5 -2
  18. triton/compiler/code_generator.py +439 -231
  19. triton/compiler/compiler.py +152 -84
  20. triton/experimental/__init__.py +0 -0
  21. triton/experimental/gluon/__init__.py +5 -0
  22. triton/experimental/gluon/_compiler.py +0 -0
  23. triton/experimental/gluon/_runtime.py +102 -0
  24. triton/experimental/gluon/language/__init__.py +119 -0
  25. triton/experimental/gluon/language/_core.py +490 -0
  26. triton/experimental/gluon/language/_layouts.py +583 -0
  27. triton/experimental/gluon/language/_math.py +20 -0
  28. triton/experimental/gluon/language/_semantic.py +380 -0
  29. triton/experimental/gluon/language/_standard.py +80 -0
  30. triton/experimental/gluon/language/amd/__init__.py +4 -0
  31. triton/experimental/gluon/language/amd/_layouts.py +96 -0
  32. triton/experimental/gluon/language/amd/cdna3/__init__.py +100 -0
  33. triton/experimental/gluon/language/amd/cdna4/__init__.py +48 -0
  34. triton/experimental/gluon/language/amd/cdna4/async_copy.py +151 -0
  35. triton/experimental/gluon/language/extra/__init__.py +3 -0
  36. triton/experimental/gluon/language/nvidia/__init__.py +4 -0
  37. triton/experimental/gluon/language/nvidia/ampere/__init__.py +3 -0
  38. triton/experimental/gluon/language/nvidia/ampere/async_copy.py +74 -0
  39. triton/experimental/gluon/language/nvidia/ampere/mbarrier.py +80 -0
  40. triton/experimental/gluon/language/nvidia/blackwell/__init__.py +387 -0
  41. triton/experimental/gluon/language/nvidia/blackwell/tma.py +52 -0
  42. triton/experimental/gluon/language/nvidia/hopper/__init__.py +132 -0
  43. triton/experimental/gluon/language/nvidia/hopper/mbarrier.py +34 -0
  44. triton/experimental/gluon/language/nvidia/hopper/tma.py +97 -0
  45. triton/experimental/gluon/nvidia/__init__.py +4 -0
  46. triton/experimental/gluon/nvidia/blackwell.py +3 -0
  47. triton/experimental/gluon/nvidia/hopper.py +45 -0
  48. triton/knobs.py +546 -0
  49. triton/language/__init__.py +50 -19
  50. triton/language/core.py +909 -572
  51. triton/language/extra/cuda/__init__.py +10 -7
  52. triton/language/extra/cuda/gdc.py +42 -0
  53. triton/language/extra/cuda/libdevice.py +394 -394
  54. triton/language/extra/cuda/utils.py +21 -21
  55. triton/language/extra/hip/__init__.py +3 -1
  56. triton/language/extra/hip/libdevice.py +120 -104
  57. triton/language/extra/hip/utils.py +35 -0
  58. triton/language/extra/libdevice.py +4 -0
  59. triton/language/math.py +65 -66
  60. triton/language/random.py +12 -2
  61. triton/language/semantic.py +1757 -1768
  62. triton/language/standard.py +127 -62
  63. triton/language/target_info.py +54 -0
  64. triton/runtime/_allocation.py +15 -3
  65. triton/runtime/_async_compile.py +55 -0
  66. triton/runtime/autotuner.py +117 -60
  67. triton/runtime/build.py +83 -17
  68. triton/runtime/cache.py +61 -47
  69. triton/runtime/driver.py +25 -47
  70. triton/runtime/interpreter.py +95 -50
  71. triton/runtime/jit.py +445 -248
  72. triton/runtime/tcc/include/_mingw.h +8 -10
  73. triton/runtime/tcc/include/assert.h +5 -0
  74. triton/runtime/tcc/include/errno.h +1 -1
  75. triton/runtime/tcc/include/float.h +21 -3
  76. triton/runtime/tcc/include/iso646.h +36 -0
  77. triton/runtime/tcc/include/limits.h +5 -0
  78. triton/runtime/tcc/include/malloc.h +2 -2
  79. triton/runtime/tcc/include/math.h +21 -261
  80. triton/runtime/tcc/include/stdalign.h +16 -0
  81. triton/runtime/tcc/include/stdarg.h +5 -70
  82. triton/runtime/tcc/include/stdatomic.h +171 -0
  83. triton/runtime/tcc/include/stddef.h +7 -19
  84. triton/runtime/tcc/include/stdlib.h +15 -4
  85. triton/runtime/tcc/include/stdnoreturn.h +7 -0
  86. triton/runtime/tcc/include/sys/stat.h +2 -2
  87. triton/runtime/tcc/include/sys/types.h +5 -0
  88. triton/runtime/tcc/include/tcc/tcc_libm.h +444 -27
  89. triton/runtime/tcc/include/tccdefs.h +342 -0
  90. triton/runtime/tcc/include/tgmath.h +89 -0
  91. triton/runtime/tcc/include/uchar.h +33 -0
  92. triton/runtime/tcc/include/unistd.h +1 -0
  93. triton/runtime/tcc/include/winapi/qos.h +72 -0
  94. triton/runtime/tcc/include/winapi/shellapi.h +59 -0
  95. triton/runtime/tcc/include/winapi/winbase.h +9 -2
  96. triton/runtime/tcc/include/winapi/wincon.h +8 -0
  97. triton/runtime/tcc/include/winapi/windows.h +1 -1
  98. triton/runtime/tcc/include/winapi/winnls.h +778 -0
  99. triton/runtime/tcc/include/winapi/winnt.h +9 -7
  100. triton/runtime/tcc/include/winapi/winsock2.h +1474 -0
  101. triton/runtime/tcc/include/winapi/ws2ipdef.h +21 -0
  102. triton/runtime/tcc/include/winapi/ws2tcpip.h +391 -0
  103. triton/runtime/tcc/lib/libtcc1.a +0 -0
  104. triton/runtime/tcc/lib/python314.def +1800 -0
  105. triton/runtime/tcc/lib/python314t.def +1809 -0
  106. triton/runtime/tcc/libtcc.dll +0 -0
  107. triton/runtime/tcc/tcc.exe +0 -0
  108. triton/testing.py +16 -12
  109. triton/tools/compile.py +62 -14
  110. triton/tools/disasm.py +3 -4
  111. triton/tools/extra/cuda/compile.c +1 -0
  112. triton/tools/extra/hip/compile.cpp +66 -0
  113. triton/tools/extra/hip/compile.h +13 -0
  114. triton/tools/ragged_tma.py +92 -0
  115. triton/tools/tensor_descriptor.py +34 -0
  116. triton/windows_utils.py +52 -81
  117. {triton_windows-3.3.1.post19.dist-info → triton_windows-3.5.0.post21.dist-info}/METADATA +8 -4
  118. triton_windows-3.5.0.post21.dist-info/RECORD +217 -0
  119. triton_windows-3.5.0.post21.dist-info/entry_points.txt +3 -0
  120. triton_windows-3.5.0.post21.dist-info/licenses/LICENSE +23 -0
  121. triton_windows-3.5.0.post21.dist-info/top_level.txt +1 -0
  122. triton/backends/amd/include/hip/amd_detail/amd_channel_descriptor.h +0 -358
  123. triton/backends/amd/include/hip/amd_detail/amd_device_functions.h +0 -1010
  124. triton/backends/amd/include/hip/amd_detail/amd_hip_atomic.h +0 -1638
  125. triton/backends/amd/include/hip/amd_detail/amd_hip_bf16.h +0 -1814
  126. triton/backends/amd/include/hip/amd_detail/amd_hip_bfloat16.h +0 -293
  127. triton/backends/amd/include/hip/amd_detail/amd_hip_common.h +0 -32
  128. triton/backends/amd/include/hip/amd_detail/amd_hip_complex.h +0 -174
  129. triton/backends/amd/include/hip/amd_detail/amd_hip_cooperative_groups.h +0 -835
  130. triton/backends/amd/include/hip/amd_detail/amd_hip_fp16.h +0 -1809
  131. triton/backends/amd/include/hip/amd_detail/amd_hip_fp8.h +0 -1391
  132. triton/backends/amd/include/hip/amd_detail/amd_hip_gl_interop.h +0 -108
  133. triton/backends/amd/include/hip/amd_detail/amd_hip_math_constants.h +0 -124
  134. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime.h +0 -405
  135. triton/backends/amd/include/hip/amd_detail/amd_hip_runtime_pt_api.h +0 -196
  136. triton/backends/amd/include/hip/amd_detail/amd_hip_unsafe_atomics.h +0 -565
  137. triton/backends/amd/include/hip/amd_detail/amd_hip_vector_types.h +0 -2226
  138. triton/backends/amd/include/hip/amd_detail/amd_math_functions.h +0 -104
  139. triton/backends/amd/include/hip/amd_detail/amd_surface_functions.h +0 -244
  140. triton/backends/amd/include/hip/amd_detail/amd_warp_functions.h +0 -538
  141. triton/backends/amd/include/hip/amd_detail/amd_warp_sync_functions.h +0 -288
  142. triton/backends/amd/include/hip/amd_detail/concepts.hpp +0 -30
  143. triton/backends/amd/include/hip/amd_detail/device_library_decls.h +0 -133
  144. triton/backends/amd/include/hip/amd_detail/functional_grid_launch.hpp +0 -218
  145. triton/backends/amd/include/hip/amd_detail/grid_launch.h +0 -67
  146. triton/backends/amd/include/hip/amd_detail/grid_launch.hpp +0 -50
  147. triton/backends/amd/include/hip/amd_detail/grid_launch_GGL.hpp +0 -26
  148. triton/backends/amd/include/hip/amd_detail/helpers.hpp +0 -137
  149. triton/backends/amd/include/hip/amd_detail/hip_api_trace.hpp +0 -1446
  150. triton/backends/amd/include/hip/amd_detail/hip_assert.h +0 -101
  151. triton/backends/amd/include/hip/amd_detail/hip_cooperative_groups_helper.h +0 -242
  152. triton/backends/amd/include/hip/amd_detail/hip_fp16_gcc.h +0 -254
  153. triton/backends/amd/include/hip/amd_detail/hip_fp16_math_fwd.h +0 -96
  154. triton/backends/amd/include/hip/amd_detail/hip_ldg.h +0 -100
  155. triton/backends/amd/include/hip/amd_detail/hip_prof_str.h +0 -10570
  156. triton/backends/amd/include/hip/amd_detail/hip_runtime_prof.h +0 -78
  157. triton/backends/amd/include/hip/amd_detail/host_defines.h +0 -184
  158. triton/backends/amd/include/hip/amd_detail/hsa_helpers.hpp +0 -102
  159. triton/backends/amd/include/hip/amd_detail/macro_based_grid_launch.hpp +0 -798
  160. triton/backends/amd/include/hip/amd_detail/math_fwd.h +0 -698
  161. triton/backends/amd/include/hip/amd_detail/ockl_image.h +0 -177
  162. triton/backends/amd/include/hip/amd_detail/program_state.hpp +0 -107
  163. triton/backends/amd/include/hip/amd_detail/texture_fetch_functions.h +0 -491
  164. triton/backends/amd/include/hip/amd_detail/texture_indirect_functions.h +0 -478
  165. triton/backends/amd/include/hip/channel_descriptor.h +0 -39
  166. triton/backends/amd/include/hip/device_functions.h +0 -38
  167. triton/backends/amd/include/hip/driver_types.h +0 -468
  168. triton/backends/amd/include/hip/hip_bf16.h +0 -36
  169. triton/backends/amd/include/hip/hip_bfloat16.h +0 -44
  170. triton/backends/amd/include/hip/hip_common.h +0 -100
  171. triton/backends/amd/include/hip/hip_complex.h +0 -38
  172. triton/backends/amd/include/hip/hip_cooperative_groups.h +0 -46
  173. triton/backends/amd/include/hip/hip_deprecated.h +0 -95
  174. triton/backends/amd/include/hip/hip_ext.h +0 -161
  175. triton/backends/amd/include/hip/hip_fp16.h +0 -36
  176. triton/backends/amd/include/hip/hip_fp8.h +0 -33
  177. triton/backends/amd/include/hip/hip_gl_interop.h +0 -32
  178. triton/backends/amd/include/hip/hip_hcc.h +0 -24
  179. triton/backends/amd/include/hip/hip_math_constants.h +0 -36
  180. triton/backends/amd/include/hip/hip_profile.h +0 -27
  181. triton/backends/amd/include/hip/hip_runtime.h +0 -75
  182. triton/backends/amd/include/hip/hip_runtime_api.h +0 -9261
  183. triton/backends/amd/include/hip/hip_texture_types.h +0 -29
  184. triton/backends/amd/include/hip/hip_vector_types.h +0 -41
  185. triton/backends/amd/include/hip/hip_version.h +0 -17
  186. triton/backends/amd/include/hip/hiprtc.h +0 -421
  187. triton/backends/amd/include/hip/library_types.h +0 -78
  188. triton/backends/amd/include/hip/math_functions.h +0 -42
  189. triton/backends/amd/include/hip/surface_types.h +0 -63
  190. triton/backends/amd/include/hip/texture_types.h +0 -194
  191. triton/backends/amd/include/hsa/Brig.h +0 -1131
  192. triton/backends/amd/include/hsa/amd_hsa_common.h +0 -91
  193. triton/backends/amd/include/hsa/amd_hsa_elf.h +0 -462
  194. triton/backends/amd/include/hsa/amd_hsa_kernel_code.h +0 -269
  195. triton/backends/amd/include/hsa/amd_hsa_queue.h +0 -109
  196. triton/backends/amd/include/hsa/amd_hsa_signal.h +0 -80
  197. triton/backends/amd/include/hsa/hsa.h +0 -5738
  198. triton/backends/amd/include/hsa/hsa_amd_tool.h +0 -91
  199. triton/backends/amd/include/hsa/hsa_api_trace.h +0 -579
  200. triton/backends/amd/include/hsa/hsa_api_trace_version.h +0 -68
  201. triton/backends/amd/include/hsa/hsa_ext_amd.h +0 -3146
  202. triton/backends/amd/include/hsa/hsa_ext_finalize.h +0 -531
  203. triton/backends/amd/include/hsa/hsa_ext_image.h +0 -1454
  204. triton/backends/amd/include/hsa/hsa_ven_amd_aqlprofile.h +0 -488
  205. triton/backends/amd/include/hsa/hsa_ven_amd_loader.h +0 -667
  206. triton/backends/amd/include/hsa/hsa_ven_amd_pc_sampling.h +0 -416
  207. triton/backends/amd/include/roctracer/ext/prof_protocol.h +0 -107
  208. triton/backends/amd/include/roctracer/hip_ostream_ops.h +0 -4515
  209. triton/backends/amd/include/roctracer/hsa_ostream_ops.h +0 -1727
  210. triton/backends/amd/include/roctracer/hsa_prof_str.h +0 -3059
  211. triton/backends/amd/include/roctracer/roctracer.h +0 -779
  212. triton/backends/amd/include/roctracer/roctracer_ext.h +0 -81
  213. triton/backends/amd/include/roctracer/roctracer_hcc.h +0 -24
  214. triton/backends/amd/include/roctracer/roctracer_hip.h +0 -37
  215. triton/backends/amd/include/roctracer/roctracer_hsa.h +0 -112
  216. triton/backends/amd/include/roctracer/roctracer_plugin.h +0 -137
  217. triton/backends/amd/include/roctracer/roctracer_roctx.h +0 -67
  218. triton/backends/amd/include/roctracer/roctx.h +0 -229
  219. triton/language/_utils.py +0 -21
  220. triton/language/extra/cuda/_experimental_tma.py +0 -106
  221. triton/runtime/tcc/lib/libtcc1-64.a +0 -0
  222. triton/tools/experimental_descriptor.py +0 -32
  223. triton_windows-3.3.1.post19.dist-info/RECORD +0 -260
  224. triton_windows-3.3.1.post19.dist-info/top_level.txt +0 -14
  225. {triton_windows-3.3.1.post19.dist-info → triton_windows-3.5.0.post21.dist-info}/WHEEL +0 -0
@@ -1,491 +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
- #pragma once
24
-
25
- #if defined(__cplusplus)
26
-
27
- #if !defined(__HIPCC_RTC__)
28
- #include <hip/hip_vector_types.h>
29
- #include <hip/hip_texture_types.h>
30
- #include <hip/amd_detail/ockl_image.h>
31
- #include <type_traits>
32
- #endif // !defined(__HIPCC_RTC__)
33
-
34
- #define TEXTURE_PARAMETERS_INIT \
35
- unsigned int ADDRESS_SPACE_CONSTANT* i = (unsigned int ADDRESS_SPACE_CONSTANT*)t.textureObject; \
36
- unsigned int ADDRESS_SPACE_CONSTANT* s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD;
37
-
38
- template<typename T>
39
- struct __hip_is_tex_surf_scalar_channel_type
40
- {
41
- static constexpr bool value =
42
- std::is_same<T, char>::value ||
43
- std::is_same<T, unsigned char>::value ||
44
- std::is_same<T, short>::value ||
45
- std::is_same<T, unsigned short>::value ||
46
- std::is_same<T, int>::value ||
47
- std::is_same<T, unsigned int>::value ||
48
- std::is_same<T, float>::value;
49
- };
50
-
51
- template<typename T>
52
- struct __hip_is_tex_surf_channel_type
53
- {
54
- static constexpr bool value =
55
- __hip_is_tex_surf_scalar_channel_type<T>::value;
56
- };
57
-
58
- template<
59
- typename T,
60
- unsigned int rank>
61
- struct __hip_is_tex_surf_channel_type<HIP_vector_type<T, rank>>
62
- {
63
- static constexpr bool value =
64
- __hip_is_tex_surf_scalar_channel_type<T>::value &&
65
- ((rank == 1) ||
66
- (rank == 2) ||
67
- (rank == 4));
68
- };
69
-
70
- template<typename T>
71
- struct __hip_is_tex_normalized_channel_type
72
- {
73
- static constexpr bool value =
74
- std::is_same<T, char>::value ||
75
- std::is_same<T, unsigned char>::value ||
76
- std::is_same<T, short>::value ||
77
- std::is_same<T, unsigned short>::value;
78
- };
79
-
80
- template<
81
- typename T,
82
- unsigned int rank>
83
- struct __hip_is_tex_normalized_channel_type<HIP_vector_type<T, rank>>
84
- {
85
- static constexpr bool value =
86
- __hip_is_tex_normalized_channel_type<T>::value &&
87
- ((rank == 1) ||
88
- (rank == 2) ||
89
- (rank == 4));
90
- };
91
-
92
- template <
93
- typename T,
94
- hipTextureReadMode readMode,
95
- typename Enable = void>
96
- struct __hip_tex_ret
97
- {
98
- static_assert(std::is_same<Enable, void>::value, "Invalid channel type!");
99
- };
100
-
101
- /*
102
- * Map from device function return U to scalar texture type T
103
- */
104
- template<typename T, typename U>
105
- __forceinline__ __device__
106
- typename std::enable_if<
107
- __hip_is_tex_surf_scalar_channel_type<T>::value, const T>::type
108
- __hipMapFrom(const U &u) {
109
- if constexpr (sizeof(T) < sizeof(float)) {
110
- union {
111
- U u;
112
- int i;
113
- } d = { u };
114
- return static_cast<T>(d.i);
115
- } else { // sizeof(T) == sizeof(float)
116
- union {
117
- U u;
118
- T t;
119
- } d = { u };
120
- return d.t;
121
- }
122
- }
123
-
124
- /*
125
- * Map from device function return U to vector texture type T
126
- */
127
- template<typename T, typename U>
128
- __forceinline__ __device__
129
- typename std::enable_if<
130
- __hip_is_tex_surf_scalar_channel_type<typename T::value_type>::value, const T>::type
131
- __hipMapFrom(const U &u) {
132
- if constexpr (sizeof(typename T::value_type) < sizeof(float)) {
133
- union {
134
- U u;
135
- int4 i4;
136
- } d = { u };
137
- return __hipMapVector<typename T::value_type, sizeof(T)/sizeof(typename T::value_type)>(d.i4);
138
- } else { // sizeof(typename T::value_type) == sizeof(float)
139
- union {
140
- U u;
141
- T t;
142
- } d = { u };
143
- return d.t;
144
- }
145
- }
146
-
147
- /*
148
- * Map from scalar texture type T to device function input U
149
- */
150
- template<typename U, typename T>
151
- __forceinline__ __device__
152
- typename std::enable_if<
153
- __hip_is_tex_surf_scalar_channel_type<T>::value, const U>::type
154
- __hipMapTo(const T &t) {
155
- if constexpr (sizeof(T) < sizeof(float)) {
156
- union {
157
- U u;
158
- int i;
159
- } d = { 0 };
160
- d.i = static_cast<int>(t);
161
- return d.u;
162
- } else { // sizeof(T) == sizeof(float)
163
- union {
164
- U u;
165
- T t;
166
- } d = { 0 };
167
- d.t = t;
168
- return d.u;
169
- }
170
- }
171
-
172
- /*
173
- * Map from vector texture type T to device function input U
174
- */
175
- template<typename U, typename T>
176
- __forceinline__ __device__
177
- typename std::enable_if<
178
- __hip_is_tex_surf_scalar_channel_type<typename T::value_type>::value, const U>::type
179
- __hipMapTo(const T &t) {
180
- if constexpr (sizeof(typename T::value_type) < sizeof(float)) {
181
- union {
182
- U u;
183
- int4 i4;
184
- } d = { 0 };
185
- d.i4 = __hipMapVector<int, 4>(t);
186
- return d.u;
187
- } else { // sizeof(typename T::value_type) == sizeof(float)
188
- union {
189
- U u;
190
- T t;
191
- } d = { 0 };
192
- d.t = t;
193
- return d.u;
194
- }
195
- }
196
-
197
- template <
198
- typename T,
199
- hipTextureReadMode readMode>
200
- using __hip_tex_ret_t = typename __hip_tex_ret<T, readMode, bool>::type;
201
-
202
- template <typename T>
203
- struct __hip_tex_ret<
204
- T,
205
- hipReadModeElementType,
206
- typename std::enable_if<__hip_is_tex_surf_channel_type<T>::value, bool>::type>
207
- {
208
- using type = T;
209
- };
210
-
211
- template<
212
- typename T,
213
- unsigned int rank>
214
- struct __hip_tex_ret<
215
- HIP_vector_type<T, rank>,
216
- hipReadModeElementType,
217
- typename std::enable_if<__hip_is_tex_surf_channel_type<HIP_vector_type<T, rank>>::value, bool>::type>
218
- {
219
- using type = HIP_vector_type<__hip_tex_ret_t<T, hipReadModeElementType>, rank>;
220
- };
221
-
222
- template<typename T>
223
- struct __hip_tex_ret<
224
- T,
225
- hipReadModeNormalizedFloat,
226
- typename std::enable_if<__hip_is_tex_normalized_channel_type<T>::value, bool>::type>
227
- {
228
- using type = float;
229
- };
230
-
231
- template<
232
- typename T,
233
- unsigned int rank>
234
- struct __hip_tex_ret<
235
- HIP_vector_type<T, rank>,
236
- hipReadModeNormalizedFloat,
237
- typename std::enable_if<__hip_is_tex_normalized_channel_type<HIP_vector_type<T, rank>>::value, bool>::type>
238
- {
239
- using type = HIP_vector_type<__hip_tex_ret_t<T, hipReadModeNormalizedFloat>, rank>;
240
- };
241
-
242
-
243
- template <typename T, hipTextureReadMode readMode>
244
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex1Dfetch(texture<T, hipTextureType1D, readMode> t, int x)
245
- {
246
- TEXTURE_PARAMETERS_INIT;
247
- auto tmp = __ockl_image_load_1Db(i, x);
248
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
249
- }
250
-
251
- template <typename T, hipTextureReadMode readMode>
252
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex1D(texture<T, hipTextureType1D, readMode> t, float x)
253
- {
254
- TEXTURE_PARAMETERS_INIT;
255
- auto tmp = __ockl_image_sample_1D(i, s, x);
256
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
257
- }
258
-
259
- template <typename T, hipTextureReadMode readMode>
260
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex2D(texture<T, hipTextureType2D, readMode> t, float x, float y)
261
- {
262
- TEXTURE_PARAMETERS_INIT;
263
- auto tmp = __ockl_image_sample_2D(i, s, float2(x, y).data);
264
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
265
- }
266
-
267
- template <typename T, hipTextureReadMode readMode>
268
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex1DLayered(texture<T, hipTextureType1DLayered, readMode> t, float x, int layer)
269
- {
270
- TEXTURE_PARAMETERS_INIT;
271
- auto tmp = __ockl_image_sample_1Da(i, s, float2(x, layer).data);
272
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
273
- }
274
-
275
- template <typename T, hipTextureReadMode readMode>
276
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex2DLayered(texture<T, hipTextureType2DLayered, readMode> t, float x, float y, int layer)
277
- {
278
- TEXTURE_PARAMETERS_INIT;
279
- auto tmp = __ockl_image_sample_2Da(i, s, float4(x, y, layer, 0.0f).data);
280
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
281
- }
282
-
283
- template <typename T, hipTextureReadMode readMode>
284
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex3D(texture<T, hipTextureType3D, readMode> t, float x, float y, float z)
285
- {
286
- TEXTURE_PARAMETERS_INIT;
287
- auto tmp = __ockl_image_sample_3D(i, s, float4(x, y, z, 0.0f).data);
288
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
289
- }
290
-
291
- template <typename T, hipTextureReadMode readMode>
292
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> texCubemap(texture<T, hipTextureTypeCubemap, readMode> t, float x, float y, float z)
293
- {
294
- TEXTURE_PARAMETERS_INIT;
295
- auto tmp = __ockl_image_sample_CM(i, s, float4(x, y, z, 0.0f).data);
296
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
297
- }
298
-
299
- template <typename T, hipTextureReadMode readMode>
300
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex1DLod(texture<T, hipTextureType1D, readMode> t, float x, float level)
301
- {
302
- TEXTURE_PARAMETERS_INIT;
303
- auto tmp = __ockl_image_sample_lod_1D(i, s, x, level);
304
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
305
- }
306
-
307
- template <typename T, hipTextureReadMode readMode>
308
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex2DLod(texture<T, hipTextureType2D, readMode> t, float x, float y, float level)
309
- {
310
- TEXTURE_PARAMETERS_INIT;
311
- auto tmp = __ockl_image_sample_lod_2D(i, s, float2(x, y).data, level);
312
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
313
- }
314
-
315
- template <typename T, hipTextureReadMode readMode>
316
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex1DLayeredLod(texture<T, hipTextureType1DLayered, readMode> t, float x, int layer, float level)
317
- {
318
- TEXTURE_PARAMETERS_INIT;
319
- auto tmp = __ockl_image_sample_lod_1Da(i, s, float2(x, layer).data, level);
320
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
321
- }
322
-
323
- template <typename T, hipTextureReadMode readMode>
324
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex2DLayeredLod(texture<T, hipTextureType2DLayered, readMode> t, float x, float y, int layer, float level)
325
- {
326
- TEXTURE_PARAMETERS_INIT;
327
- auto tmp = __ockl_image_sample_lod_2Da(i, s, float4(x, y, layer, 0.0f).data, level);
328
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
329
- }
330
-
331
- template <typename T, hipTextureReadMode readMode>
332
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex3DLod(texture<T, hipTextureType3D, readMode> t, float x, float y, float z, float level)
333
- {
334
- TEXTURE_PARAMETERS_INIT;
335
- auto tmp = __ockl_image_sample_lod_3D(i, s, float4(x, y, z, 0.0f).data, level);
336
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
337
- }
338
-
339
- template <typename T, hipTextureReadMode readMode>
340
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> texCubemapLod(texture<T, hipTextureTypeCubemap, readMode> t, float x, float y, float z, float level)
341
- {
342
- TEXTURE_PARAMETERS_INIT;
343
- auto tmp = __ockl_image_sample_lod_CM(i, s, float4(x, y, z, 0.0f).data, level);
344
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
345
- }
346
-
347
- template <typename T, hipTextureReadMode readMode>
348
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> texCubemapLayered(texture<T, hipTextureTypeCubemapLayered, readMode> t, float x, float y, float z, int layer)
349
- {
350
- TEXTURE_PARAMETERS_INIT;
351
- auto tmp = __ockl_image_sample_CMa(i, s, float4(x, y, z, layer).data);
352
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
353
- }
354
-
355
- template <typename T, hipTextureReadMode readMode>
356
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> texCubemapLayeredLod(texture<T, hipTextureTypeCubemapLayered, readMode> t, float x, float y, float z, int layer, float level)
357
- {
358
- TEXTURE_PARAMETERS_INIT;
359
- auto tmp = __ockl_image_sample_lod_CMa(i, s, float4(x, y, z, layer).data, level);
360
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
361
- }
362
-
363
- template <typename T, hipTextureReadMode readMode>
364
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> texCubemapGrad(texture<T, hipTextureTypeCubemap, readMode> t, float x, float y, float z, float4 dPdx, float4 dPdy)
365
- {
366
- TEXTURE_PARAMETERS_INIT;
367
- // TODO missing in device libs.
368
- // auto tmp = __ockl_image_sample_grad_CM(i, s, float4(x, y, z, 0.0f).data, float4(dPdx.x, dPdx.y, dPdx.z, 0.0f).data, float4(dPdy.x, dPdy.y, dPdy.z, 0.0f).data);
369
- // return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
370
- return {};
371
- }
372
-
373
- template <typename T, hipTextureReadMode readMode>
374
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> texCubemapLayeredGrad(texture<T, hipTextureTypeCubemapLayered, readMode> t, float x, float y, float z, int layer, float4 dPdx, float4 dPdy)
375
- {
376
- TEXTURE_PARAMETERS_INIT;
377
- // TODO missing in device libs.
378
- // auto tmp = __ockl_image_sample_grad_CMa(i, s, float4(x, y, z, layer).data, float4(dPdx.x, dPdx.y, dPdx.z, 0.0f).data, float4(dPdy.x, dPdy.y, dPdy.z, 0.0f).data);
379
- // return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
380
- return {};
381
- }
382
-
383
- template <typename T, hipTextureReadMode readMode>
384
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex1DGrad(texture<T, hipTextureType1D, readMode> t, float x, float dPdx, float dPdy)
385
- {
386
- TEXTURE_PARAMETERS_INIT;
387
- auto tmp = __ockl_image_sample_grad_1D(i, s, x, dPdx, dPdy);
388
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
389
- }
390
-
391
- template <typename T, hipTextureReadMode readMode>
392
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex2DGrad(texture<T, hipTextureType2D, readMode> t, float x, float y, float2 dPdx, float2 dPdy)
393
- {
394
- TEXTURE_PARAMETERS_INIT;
395
- auto tmp = __ockl_image_sample_grad_2D(i, s, float2(x, y).data, float2(dPdx.x, dPdx.y).data, float2(dPdy.x, dPdy.y).data);
396
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
397
- }
398
-
399
- template <typename T, hipTextureReadMode readMode>
400
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex1DLayeredGrad(texture<T, hipTextureType1DLayered, readMode> t, float x, int layer, float dPdx, float dPdy)
401
- {
402
- TEXTURE_PARAMETERS_INIT;
403
- auto tmp = __ockl_image_sample_grad_1Da(i, s, float2(x, layer).data, dPdx, dPdy);
404
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
405
- }
406
-
407
- template <typename T, hipTextureReadMode readMode>
408
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex2DLayeredGrad(texture<T, hipTextureType2DLayered, readMode> t, float x, float y, int layer, float2 dPdx, float2 dPdy)
409
- {
410
- TEXTURE_PARAMETERS_INIT;
411
- auto tmp = __ockl_image_sample_grad_2Da(i, s, float4(x, y, layer, 0.0f).data, float2(dPdx.x, dPdx.y).data, float2(dPdy.x, dPdy.y).data);
412
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
413
- }
414
-
415
- template <typename T, hipTextureReadMode readMode>
416
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex_ret_t<T, readMode> tex3DGrad(texture<T, hipTextureType3D, readMode> t, float x, float y, float z, float4 dPdx, float4 dPdy)
417
- {
418
- TEXTURE_PARAMETERS_INIT;
419
- auto tmp = __ockl_image_sample_grad_3D(i, s, float4(x, y, z, 0.0f).data, float4(dPdx.x, dPdx.y, dPdx.z, 0.0f).data, float4(dPdy.x, dPdy.y, dPdy.z, 0.0f).data);
420
- return __hipMapFrom<__hip_tex_ret_t<T, readMode>>(tmp);
421
- }
422
-
423
- template <
424
- typename T,
425
- hipTextureReadMode readMode,
426
- typename Enable = void>
427
- struct __hip_tex2dgather_ret
428
- {
429
- static_assert(std::is_same<Enable, void>::value, "Invalid channel type!");
430
- };
431
-
432
- template <
433
- typename T,
434
- hipTextureReadMode readMode>
435
- using __hip_tex2dgather_ret_t = typename __hip_tex2dgather_ret<T, readMode, bool>::type;
436
-
437
- template <typename T>
438
- struct __hip_tex2dgather_ret<
439
- T,
440
- hipReadModeElementType,
441
- typename std::enable_if<__hip_is_tex_surf_channel_type<T>::value, bool>::type>
442
- {
443
- using type = HIP_vector_type<T, 4>;
444
- };
445
-
446
- template<
447
- typename T,
448
- unsigned int rank>
449
- struct __hip_tex2dgather_ret<
450
- HIP_vector_type<T, rank>,
451
- hipReadModeElementType,
452
- typename std::enable_if<__hip_is_tex_surf_channel_type<HIP_vector_type<T, rank>>::value, bool>::type>
453
- {
454
- using type = HIP_vector_type<T, 4>;
455
- };
456
-
457
- template <typename T>
458
- struct __hip_tex2dgather_ret<
459
- T,
460
- hipReadModeNormalizedFloat,
461
- typename std::enable_if<__hip_is_tex_normalized_channel_type<T>::value, bool>::type>
462
- {
463
- using type = float4;
464
- };
465
-
466
- template <typename T, hipTextureReadMode readMode>
467
- static __forceinline__ __device__ __hip_img_chk__ __hip_tex2dgather_ret_t<T, readMode> tex2Dgather(texture<T, hipTextureType2D, readMode> t, float x, float y, int comp=0)
468
- {
469
- TEXTURE_PARAMETERS_INIT;
470
- switch (comp) {
471
- case 1: {
472
- auto tmp = __ockl_image_gather4g_2D(i, s, float2(x, y).data);
473
- return __hipMapFrom<__hip_tex2dgather_ret_t<T, readMode>>(tmp);
474
- }
475
- case 2: {
476
- auto tmp = __ockl_image_gather4b_2D(i, s, float2(x, y).data);
477
- return __hipMapFrom<__hip_tex2dgather_ret_t<T, readMode>>(tmp);
478
- }
479
- case 3: {
480
- auto tmp = __ockl_image_gather4a_2D(i, s, float2(x, y).data);
481
- return __hipMapFrom<__hip_tex2dgather_ret_t<T, readMode>>(tmp);
482
- }
483
- default: {
484
- auto tmp = __ockl_image_gather4r_2D(i, s, float2(x, y).data);
485
- return __hipMapFrom<__hip_tex2dgather_ret_t<T, readMode>>(tmp);
486
- }
487
- }
488
- return {};
489
- }
490
-
491
- #endif