Skip to content

Commit

Permalink
[IR] Allow a maximum of 12 SNode indices (taichi-dev#6901)
Browse files Browse the repository at this point in the history
  • Loading branch information
AmesingFlank authored and quadpixels committed May 13, 2023
1 parent f27a77c commit 146aa32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/lang/articles/internals/internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,5 @@ assert mapping_b == {0: 1, 1: 0}
# the virtual first index exposed to the user comes second in memory layout.
```

Taichi supports up to 8 (`constexpr int taichi_max_num_indices = 8`)
Taichi supports up to 12 (`constexpr int taichi_max_num_indices = 12`)
virtual indices and physical indices.
2 changes: 1 addition & 1 deletion taichi/inc/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <cstddef>

constexpr int taichi_max_num_indices = 8;
constexpr int taichi_max_num_indices = 12;
// legacy: only used in cc and opengl backends
constexpr int taichi_max_num_args = 8;
// used in llvm backend: only the first 32 arguments can be types.ndarray
Expand Down
4 changes: 2 additions & 2 deletions taichi/runtime/metal/shaders/runtime_structs.metal.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "taichi/inc/constants.h"

static_assert(taichi_max_num_indices == 8,
static_assert(taichi_max_num_indices == 12,
"Please update kTaichiMaxNumIndices");
static_assert(sizeof(char *) == 8, "Metal pointers are 64-bit.");
#define METAL_BEGIN_RUNTIME_STRUCTS_DEF
Expand All @@ -28,7 +28,7 @@ static_assert(sizeof(char *) == 8, "Metal pointers are 64-bit.");
// clang-format off
METAL_BEGIN_RUNTIME_STRUCTS_DEF
STR(
constant constexpr int kTaichiMaxNumIndices = 8;
constant constexpr int kTaichiMaxNumIndices = 12;
constant constexpr int kTaichiNumChunks = 1024;
constant constexpr int kAlignment = 8;
using PtrOffset = int32_t;
Expand Down

0 comments on commit 146aa32

Please sign in to comment.