We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe281f4 commit 12785beCopy full SHA for 12785be
include/triton_jit/triton_kernel.h
@@ -13,12 +13,7 @@ class TritonJITFunction;
13
14
template <typename T>
15
T get_next_multiple_of(T pos, T step) {
16
- if (pos % step == 0) return pos;
17
-
18
- while (pos % step) {
19
- pos++;
20
- }
21
- return pos;
+ return ((pos + step - 1) / step) * step;
22
}
23
24
struct ParameterBuffer {
@@ -34,6 +29,7 @@ struct ParameterBuffer {
34
29
35
30
36
31
void push_arg(T &&v) {
32
+ static_assert(std::is_trivially_copyable_v<std::remove_reference_t<T>>, "Non trivially copyable type");
37
33
size_t align = alignof(T);
38
size_t offset = get_next_multiple_of(this->cursor_, align);
39
this->offsets_.push_back(offset);
0 commit comments