Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IR] Allow a maximum of 12 SNode indices #6901

Merged
merged 2 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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