Skip to content

Commit 45f4045

Browse files
authored
[IR] Allow a maximum of 12 SNode indices (#6901)
Fixes #6900
1 parent dec9c87 commit 45f4045

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/lang/articles/internals/internal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,5 +343,5 @@ assert mapping_b == {0: 1, 1: 0}
343343
# the virtual first index exposed to the user comes second in memory layout.
344344
```
345345

346-
Taichi supports up to 8 (`constexpr int taichi_max_num_indices = 8`)
346+
Taichi supports up to 12 (`constexpr int taichi_max_num_indices = 12`)
347347
virtual indices and physical indices.

taichi/inc/constants.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <cstddef>
44

5-
constexpr int taichi_max_num_indices = 8;
5+
constexpr int taichi_max_num_indices = 12;
66
// legacy: only used in cc and opengl backends
77
constexpr int taichi_max_num_args = 8;
88
// used in llvm backend: only the first 32 arguments can be types.ndarray

taichi/runtime/metal/shaders/runtime_structs.metal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "taichi/inc/constants.h"
1919

20-
static_assert(taichi_max_num_indices == 8,
20+
static_assert(taichi_max_num_indices == 12,
2121
"Please update kTaichiMaxNumIndices");
2222
static_assert(sizeof(char *) == 8, "Metal pointers are 64-bit.");
2323
#define METAL_BEGIN_RUNTIME_STRUCTS_DEF
@@ -28,7 +28,7 @@ static_assert(sizeof(char *) == 8, "Metal pointers are 64-bit.");
2828
// clang-format off
2929
METAL_BEGIN_RUNTIME_STRUCTS_DEF
3030
STR(
31-
constant constexpr int kTaichiMaxNumIndices = 8;
31+
constant constexpr int kTaichiMaxNumIndices = 12;
3232
constant constexpr int kTaichiNumChunks = 1024;
3333
constant constexpr int kAlignment = 8;
3434
using PtrOffset = int32_t;

0 commit comments

Comments
 (0)