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

[opengl] Make sure ndarray arg bind indices are sorted. #4069

Merged
merged 1 commit into from
Jan 20, 2022
Merged
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
4 changes: 2 additions & 2 deletions taichi/backends/opengl/codegen_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class KernelGen : public IRVisitor {
bool is_top_level_{true};
CompiledTaichiKernel compiled_program_;
UsedFeature used; // TODO: is this actually per-offload?
int arr_bind_idx_ = static_cast<int>(GLBufId::Arr);

// per-offload variables:
LineAppender line_appender_;
Expand Down Expand Up @@ -866,7 +865,8 @@ class KernelGen : public IRVisitor {
const auto dt = opengl_data_type_name(stmt->element_type());
if (stmt->is_ptr) {
if (!used.arr_arg_to_bind_idx.count(stmt->arg_id)) {
used.arr_arg_to_bind_idx[stmt->arg_id] = arr_bind_idx_++;
used.arr_arg_to_bind_idx[stmt->arg_id] =
static_cast<int>(GLBufId::Arr) + stmt->arg_id;
}
} else {
used.buf_args = true;
Expand Down