diff --git a/docs/lang/articles/internals/internal.md b/docs/lang/articles/internals/internal.md index f3add13d46cf3..ba9241edcfa43 100644 --- a/docs/lang/articles/internals/internal.md +++ b/docs/lang/articles/internals/internal.md @@ -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. diff --git a/taichi/inc/constants.h b/taichi/inc/constants.h index e8cec7e6dc54e..275d892336daa 100644 --- a/taichi/inc/constants.h +++ b/taichi/inc/constants.h @@ -2,7 +2,7 @@ #include -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 diff --git a/taichi/runtime/metal/shaders/runtime_structs.metal.h b/taichi/runtime/metal/shaders/runtime_structs.metal.h index 4989c13ef8094..b5ced19070b1e 100644 --- a/taichi/runtime/metal/shaders/runtime_structs.metal.h +++ b/taichi/runtime/metal/shaders/runtime_structs.metal.h @@ -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 @@ -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;