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,218 +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
- #include "concepts.hpp"
26
- #include "helpers.hpp"
27
- #include "program_state.hpp"
28
- #include "hip_runtime_api.h"
29
-
30
- #include <cstdint>
31
- #include <cstring>
32
- #include <stdexcept>
33
- #include <tuple>
34
- #include <type_traits>
35
- #include <utility>
36
-
37
- hipError_t ihipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList, int numDevices,
38
- unsigned int flags, hip_impl::program_state& ps);
39
-
40
- hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim,
41
- dim3 blockDim, void** args,
42
- size_t sharedMem, hipStream_t stream,
43
- hip_impl::program_state& ps);
44
-
45
- hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
46
- int numDevices,
47
- unsigned int flags,
48
- hip_impl::program_state& ps);
49
-
50
- #pragma GCC visibility push(hidden)
51
-
52
- namespace hip_impl {
53
- template <typename T, typename std::enable_if<std::is_integral<T>{}>::type* = nullptr>
54
- inline T round_up_to_next_multiple_nonnegative(T x, T y) {
55
- T tmp = x + y - 1;
56
- return tmp - tmp % y;
57
- }
58
-
59
- template <
60
- std::size_t n,
61
- typename... Ts,
62
- typename std::enable_if<n == sizeof...(Ts)>::type* = nullptr>
63
- inline hip_impl::kernarg make_kernarg(
64
- const std::tuple<Ts...>&,
65
- const kernargs_size_align&,
66
- hip_impl::kernarg kernarg) {
67
- return kernarg;
68
- }
69
-
70
- template <
71
- std::size_t n,
72
- typename... Ts,
73
- typename std::enable_if<n != sizeof...(Ts)>::type* = nullptr>
74
- inline hip_impl::kernarg make_kernarg(
75
- const std::tuple<Ts...>& formals,
76
- const kernargs_size_align& size_align,
77
- hip_impl::kernarg kernarg) {
78
- using T = typename std::tuple_element<n, std::tuple<Ts...>>::type;
79
-
80
- static_assert(
81
- !std::is_reference<T>{},
82
- "A __global__ function cannot have a reference as one of its "
83
- "arguments.");
84
- #if defined(HIP_STRICT)
85
- static_assert(
86
- std::is_trivially_copyable<T>{},
87
- "Only TriviallyCopyable types can be arguments to a __global__ "
88
- "function");
89
- #endif
90
-
91
- kernarg.resize(round_up_to_next_multiple_nonnegative(
92
- kernarg.size(), size_align.alignment(n)) + size_align.size(n));
93
-
94
- std::memcpy(
95
- kernarg.data() + kernarg.size() - size_align.size(n),
96
- &std::get<n>(formals),
97
- size_align.size(n));
98
- return make_kernarg<n + 1>(formals, size_align, std::move(kernarg));
99
- }
100
-
101
- template <typename... Formals, typename... Actuals>
102
- inline hip_impl::kernarg make_kernarg(
103
- void (*kernel)(Formals...), std::tuple<Actuals...> actuals) {
104
- static_assert(sizeof...(Formals) == sizeof...(Actuals),
105
- "The count of formal arguments must match the count of actuals.");
106
-
107
- if (sizeof...(Formals) == 0) return {};
108
-
109
- std::tuple<Formals...> to_formals{std::move(actuals)};
110
- hip_impl::kernarg kernarg;
111
- kernarg.reserve(sizeof(to_formals));
112
-
113
- auto& ps = hip_impl::get_program_state();
114
- return make_kernarg<0>(to_formals,
115
- ps.get_kernargs_size_align(
116
- reinterpret_cast<std::uintptr_t>(kernel)),
117
- std::move(kernarg));
118
- }
119
-
120
-
121
- HIP_INTERNAL_EXPORTED_API hsa_agent_t target_agent(hipStream_t stream);
122
-
123
- inline
124
- __attribute__((visibility("hidden")))
125
- void hipLaunchKernelGGLImpl(
126
- std::uintptr_t function_address,
127
- const dim3& numBlocks,
128
- const dim3& dimBlocks,
129
- std::uint32_t sharedMemBytes,
130
- hipStream_t stream,
131
- void** kernarg) {
132
-
133
- const auto& kd = hip_impl::get_program_state().kernel_descriptor(function_address,
134
- target_agent(stream));
135
-
136
- hipModuleLaunchKernel(kd, numBlocks.x, numBlocks.y, numBlocks.z,
137
- dimBlocks.x, dimBlocks.y, dimBlocks.z, sharedMemBytes,
138
- stream, nullptr, kernarg);
139
- }
140
- } // Namespace hip_impl.
141
-
142
-
143
- template <class T>
144
- inline
145
- hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
146
- T kernel, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0) {
147
-
148
- using namespace hip_impl;
149
-
150
- hip_impl::hip_init();
151
- auto f = get_program_state().kernel_descriptor(reinterpret_cast<std::uintptr_t>(kernel),
152
- target_agent(0));
153
-
154
- return hipModuleOccupancyMaxPotentialBlockSize(gridSize, blockSize, f,
155
- dynSharedMemPerBlk, blockSizeLimit);
156
- }
157
-
158
- template <class T>
159
- inline
160
- hipError_t hipOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
161
- T kernel, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0, unsigned int flags = 0 ) {
162
-
163
- using namespace hip_impl;
164
-
165
- hip_impl::hip_init();
166
- if(flags != hipOccupancyDefault) return hipErrorNotSupported;
167
- auto f = get_program_state().kernel_descriptor(reinterpret_cast<std::uintptr_t>(kernel),
168
- target_agent(0));
169
-
170
- return hipModuleOccupancyMaxPotentialBlockSize(gridSize, blockSize, f,
171
- dynSharedMemPerBlk, blockSizeLimit);
172
- }
173
-
174
- template <typename... Args, typename F = void (*)(Args...)>
175
- inline
176
- void hipLaunchKernelGGL(F kernel, const dim3& numBlocks, const dim3& dimBlocks,
177
- std::uint32_t sharedMemBytes, hipStream_t stream,
178
- Args... args) {
179
- hip_impl::hip_init();
180
- auto kernarg = hip_impl::make_kernarg(kernel, std::tuple<Args...>{std::move(args)...});
181
- std::size_t kernarg_size = kernarg.size();
182
-
183
- void* config[]{
184
- HIP_LAUNCH_PARAM_BUFFER_POINTER,
185
- kernarg.data(),
186
- HIP_LAUNCH_PARAM_BUFFER_SIZE,
187
- &kernarg_size,
188
- HIP_LAUNCH_PARAM_END};
189
-
190
- hip_impl::hipLaunchKernelGGLImpl(reinterpret_cast<std::uintptr_t>(kernel),
191
- numBlocks, dimBlocks, sharedMemBytes,
192
- stream, &config[0]);
193
- }
194
-
195
- template <typename F>
196
- inline
197
- __attribute__((visibility("hidden")))
198
- hipError_t hipLaunchCooperativeKernel(F f, dim3 gridDim, dim3 blockDim,
199
- void** args, size_t sharedMem,
200
- hipStream_t stream) {
201
- hip_impl::hip_init();
202
- auto& ps = hip_impl::get_program_state();
203
- return hipLaunchCooperativeKernel(reinterpret_cast<void*>(f), gridDim,
204
- blockDim, args, sharedMem, stream, ps);
205
- }
206
-
207
- inline
208
- __attribute__((visibility("hidden")))
209
- hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
210
- int numDevices,
211
- unsigned int flags) {
212
-
213
- hip_impl::hip_init();
214
- auto& ps = hip_impl::get_program_state();
215
- return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags, ps);
216
- }
217
-
218
- #pragma GCC visibility pop
@@ -1,67 +0,0 @@
1
- #pragma once
2
-
3
- #include <stdint.h>
4
-
5
- #include <hc_defines.h>
6
-
7
- #define GRID_LAUNCH_VERSION 20
8
-
9
- // Extern definitions
10
- namespace hc{
11
- class completion_future;
12
- class accelerator_view;
13
- }
14
-
15
-
16
- // 3 dim structure for groups and grids.
17
- typedef struct gl_dim3
18
- {
19
- int x,y,z;
20
- gl_dim3(uint32_t _x=1, uint32_t _y=1, uint32_t _z=1) : x(_x), y(_y), z(_z) {};
21
- } gl_dim3;
22
-
23
- typedef enum gl_barrier_bit {
24
- barrier_bit_queue_default,
25
- barrier_bit_none,
26
- barrier_bit_wait,
27
- } gl_barrier_bit;
28
-
29
-
30
- // grid_launch_parm contains information used to launch the kernel.
31
- typedef struct grid_launch_parm
32
- {
33
- //! Grid dimensions
34
- gl_dim3 grid_dim;
35
-
36
- //! Group dimensions
37
- gl_dim3 group_dim;
38
-
39
- //! Amount of dynamic group memory to use with the kernel launch.
40
- //! This memory is in addition to the amount used statically in the kernel.
41
- unsigned int dynamic_group_mem_bytes;
42
-
43
- //! Control setting of barrier bit on per-packet basis:
44
- //! See gl_barrier_bit description.
45
- //! Placeholder, is not used to control packet dispatch yet
46
- enum gl_barrier_bit barrier_bit;
47
-
48
- //! Value of packet fences to apply to launch.
49
- //! The correspond to the value of bits 9:14 in the AQL packet,
50
- //! see HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE and hsa_fence_scope_t.
51
- unsigned int launch_fence;
52
-
53
- //! Pointer to the accelerator_view where the kernel should execute.
54
- //! If NULL, the default view on the default accelerator is used.
55
- hc::accelerator_view *av;
56
-
57
- //! Pointer to the completion_future used to track the status of the command.
58
- //! If NULL, the command does not write status. In this case,
59
- //! synchronization can be enforced with queue-level waits or
60
- //! waiting on younger commands.
61
- hc::completion_future *cf;
62
-
63
- grid_launch_parm() = default;
64
- } grid_launch_parm;
65
-
66
-
67
- extern void init_grid_launch(grid_launch_parm *gl);
@@ -1,50 +0,0 @@
1
- #pragma once
2
-
3
- #include "grid_launch.h"
4
- #include "hc.hpp"
5
-
6
- class grid_launch_parm_cxx : public grid_launch_parm
7
- {
8
- public:
9
- grid_launch_parm_cxx() = default;
10
-
11
- // customized serialization: don't need av and cf in kernel
12
- __attribute__((annotate("serialize")))
13
- void __cxxamp_serialize(Kalmar::Serialize& s) const {
14
- s.Append(sizeof(int), &grid_dim.x);
15
- s.Append(sizeof(int), &grid_dim.y);
16
- s.Append(sizeof(int), &grid_dim.z);
17
- s.Append(sizeof(int), &group_dim.x);
18
- s.Append(sizeof(int), &group_dim.y);
19
- s.Append(sizeof(int), &group_dim.z);
20
- }
21
-
22
- __attribute__((annotate("user_deserialize")))
23
- grid_launch_parm_cxx(int grid_dim_x, int grid_dim_y, int grid_dim_z,
24
- int group_dim_x, int group_dim_y, int group_dim_z) {
25
- grid_dim.x = grid_dim_x;
26
- grid_dim.y = grid_dim_y;
27
- grid_dim.z = grid_dim_z;
28
- group_dim.x = group_dim_x;
29
- group_dim.y = group_dim_y;
30
- group_dim.z = group_dim_z;
31
- }
32
- };
33
-
34
-
35
- extern inline void grid_launch_init(grid_launch_parm *lp) {
36
- lp->grid_dim.x = lp->grid_dim.y = lp->grid_dim.z = 1;
37
-
38
- lp->group_dim.x = lp->group_dim.y = lp->group_dim.z = 1;
39
-
40
- lp->dynamic_group_mem_bytes = 0;
41
-
42
- lp->barrier_bit = barrier_bit_queue_default;
43
- lp->launch_fence = -1;
44
-
45
- // TODO - set to NULL?
46
- static hc::accelerator_view av = hc::accelerator().get_default_view();
47
- lp->av = &av;
48
- lp->cf = NULL;
49
- }
50
-
@@ -1,26 +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
- #pragma once
23
-
24
- #if GENERIC_GRID_LAUNCH == 1
25
- #include "macro_based_grid_launch.hpp"
26
- #endif // GENERIC_GRID_LAUNCH
@@ -1,137 +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
- #include "concepts.hpp"
25
-
26
- #include <type_traits> // For std::conditional, std::decay, std::enable_if,
27
- // std::false_type, std result_of and std::true_type.
28
- #include <utility> // For std::declval.
29
-
30
- #ifdef __has_include // Check if __has_include is present
31
- # if __has_include(<version>) // Check for version header
32
- # include <version>
33
- # if defined(__cpp_lib_is_invocable) && !defined(HIP_HAS_INVOCABLE)
34
- # define HIP_HAS_INVOCABLE __cpp_lib_is_invocable
35
- # endif
36
- # if defined(__cpp_lib_result_of_sfinae) && !defined(HIP_HAS_RESULT_OF_SFINAE)
37
- # define HIP_HAS_RESULT_OF_SFINAE __cpp_lib_result_of_sfinae
38
- # endif
39
- # endif
40
- #endif
41
-
42
- #ifndef HIP_HAS_INVOCABLE
43
- #define HIP_HAS_INVOCABLE 0
44
- #endif
45
-
46
- #ifndef HIP_HAS_RESULT_OF_SFINAE
47
- #define HIP_HAS_RESULT_OF_SFINAE 0
48
- #endif
49
-
50
- namespace std { // TODO: these should be removed as soon as possible.
51
- #if (__cplusplus < 201406L)
52
- #if (__cplusplus < 201402L)
53
- template <bool cond, typename T = void>
54
- using enable_if_t = typename enable_if<cond, T>::type;
55
- template <bool cond, typename T, typename U>
56
- using conditional_t = typename conditional<cond, T, U>::type;
57
- template <typename T>
58
- using decay_t = typename decay<T>::type;
59
- template <FunctionalProcedure F, typename... Ts>
60
- using result_of_t = typename result_of<F(Ts...)>::type;
61
- template <typename T>
62
- using remove_reference_t = typename remove_reference<T>::type;
63
- #endif
64
- #endif
65
- } // namespace std
66
-
67
- namespace hip_impl {
68
- template <typename...>
69
- using void_t_ = void;
70
-
71
- #if HIP_HAS_INVOCABLE
72
- template <typename, typename = void>
73
- struct is_callable_impl;
74
-
75
- template <FunctionalProcedure F, typename... Ts>
76
- struct is_callable_impl<F(Ts...)> : std::is_invocable<F, Ts...> {};
77
- #elif HIP_HAS_RESULT_OF_SFINAE
78
- template <typename, typename = void>
79
- struct is_callable_impl : std::false_type {};
80
-
81
- template <FunctionalProcedure F, typename... Ts>
82
- struct is_callable_impl<F(Ts...), void_t_<typename std::result_of<F(Ts...)>::type > > : std::true_type {};
83
- #else
84
- template <class Base, class T, class Derived>
85
- auto simple_invoke(T Base::*pmd, Derived&& ref)
86
- -> decltype(static_cast<Derived&&>(ref).*pmd);
87
-
88
- template <class PMD, class Pointer>
89
- auto simple_invoke(PMD&& pmd, Pointer&& ptr)
90
- -> decltype((*static_cast<Pointer&&>(ptr)).*static_cast<PMD&&>(pmd));
91
-
92
- template <class Base, class T, class Derived>
93
- auto simple_invoke(T Base::*pmd, const std::reference_wrapper<Derived>& ref)
94
- -> decltype(ref.get().*pmd);
95
-
96
- template <class Base, class T, class Derived, class... Args>
97
- auto simple_invoke(T Base::*pmf, Derived&& ref, Args&&... args)
98
- -> decltype((static_cast<Derived&&>(ref).*pmf)(static_cast<Args&&>(args)...));
99
-
100
- template <class PMF, class Pointer, class... Args>
101
- auto simple_invoke(PMF&& pmf, Pointer&& ptr, Args&&... args)
102
- -> decltype(((*static_cast<Pointer&&>(ptr)).*static_cast<PMF&&>(pmf))(static_cast<Args&&>(args)...));
103
-
104
- template <class Base, class T, class Derived, class... Args>
105
- auto simple_invoke(T Base::*pmf, const std::reference_wrapper<Derived>& ref, Args&&... args)
106
- -> decltype((ref.get().*pmf)(static_cast<Args&&>(args)...));
107
-
108
- template<class F, class... Ts>
109
- auto simple_invoke(F&& f, Ts&&... xs)
110
- -> decltype(f(static_cast<Ts&&>(xs)...));
111
-
112
- template <typename, typename = void>
113
- struct is_callable_impl : std::false_type {};
114
-
115
- template <FunctionalProcedure F, typename... Ts>
116
- struct is_callable_impl<F(Ts...), void_t_<decltype(simple_invoke(std::declval<F>(), std::declval<Ts>()...))> >
117
- : std::true_type {};
118
-
119
- #endif
120
-
121
- template <typename Call>
122
- struct is_callable : is_callable_impl<Call> {};
123
-
124
- #define count_macro_args_impl_hip_(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, \
125
- _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, \
126
- _26, _27, _28, _29, _30, _31, _n, ...) \
127
- _n
128
- #define count_macro_args_hip_(...) \
129
- count_macro_args_impl_hip_(, ##__VA_ARGS__, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, \
130
- 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, \
131
- 0)
132
-
133
- #define overloaded_macro_expand_hip_(macro, arg_cnt) macro##arg_cnt
134
- #define overload_macro_impl_hip_(macro, arg_cnt) overloaded_macro_expand_hip_(macro, arg_cnt)
135
- #define overload_macro_hip_(macro, ...) \
136
- overload_macro_impl_hip_(macro, count_macro_args_hip_(__VA_ARGS__))(__VA_ARGS__)
137
- } // namespace hip_impl