Skip to content

Commit

Permalink
[build] Warning Suppression PR taichi-dev#4: Fixed Mac-specific warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jim19930609 committed May 7, 2022
1 parent 2d36391 commit 462c129
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion taichi/backends/metal/codegen_metal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class KernelCodegenImpl : public IRVisitor {

for (int i = 0; i < compiled_snode_trees_.size(); ++i) {
const auto &cst = compiled_snode_trees_[i];
for (const auto [node_id, _] : cst.snode_descriptors) {
for (const auto &[node_id, _] : cst.snode_descriptors) {
RootInfo ri{};
ri.snode_id = cst.root_id;
ri.index_in_cst = i;
Expand Down
4 changes: 4 additions & 0 deletions taichi/backends/metal/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,17 @@ class StreamImpl : public Stream {
const std::vector<StreamSemaphore> &wait_semaphores) override {
auto *cb = static_cast<CommandListImpl *>(cmdlist)->command_buffer();
commit_command_buffer(cb);

return nullptr;
}
StreamSemaphore submit_synced(
CommandList *cmdlist,
const std::vector<StreamSemaphore> &wait_semaphores) override {
auto *cb = static_cast<CommandListImpl *>(cmdlist)->command_buffer();
commit_command_buffer(cb);
wait_until_completed(cb);

return nullptr;
}

void command_sync() override {
Expand Down
4 changes: 2 additions & 2 deletions taichi/backends/metal/kernel_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class UserMtlKernel : public CompiledMtlKernelBase {
// 0 is valid for |num_threads|!
TI_ASSERT(kernel_attribs_.advisory_total_num_threads >= 0);
BindBuffers buffers;
for (const auto b : kernel_attribs_.buffers) {
for (const auto &b : kernel_attribs_.buffers) {
buffers.push_back({input_buffers.find(b)->second, b});
}
launch_if_not_empty(std::move(buffers), command_buffer);
Expand All @@ -215,7 +215,7 @@ class SparseRuntimeMtlKernelBase : public CompiledMtlKernelBase {
void launch(InputBuffersMap &input_buffers,
MTLCommandBuffer *command_buffer) override {
BindBuffers buffers;
for (const auto b : kernel_attribs_.buffers) {
for (const auto &b : kernel_attribs_.buffers) {
if (b.type() == BufferDescriptor::Type::Context) {
buffers.push_back({args_buffer_.get(), b});
} else {
Expand Down
2 changes: 1 addition & 1 deletion taichi/backends/metal/metal_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace {
std::unordered_set<const SNode *> find_all_dense_snodes(
const metal::SNodeDescriptorsMap &snodes_map) {
std::unordered_set<const SNode *> res;
for (const auto [_, desc] : snodes_map) {
for (const auto &[_, desc] : snodes_map) {
const auto *sn = desc.snode;
if (sn->type == SNodeType::dense) {
res.insert(sn);
Expand Down
2 changes: 1 addition & 1 deletion taichi/backends/opengl/codegen_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class KernelGen : public IRVisitor {
kernel_header += shaders::kOpenGlAtomicF32Source_gtmp;
}
std::unordered_set<int> arr_ids;
for ([[maybe_unused]] const auto [arr_id, bind_idx] :
for ([[maybe_unused]] const auto &[arr_id, bind_idx] :
used.arr_arg_to_bind_idx) {
arr_ids.insert(arr_id);
}
Expand Down
2 changes: 1 addition & 1 deletion taichi/transforms/make_mesh_block_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ MakeMeshBlockLocal::MakeMeshBlockLocal(OffloadedStmt *offload,
TI_TRACE("available cache attributes bytes = {}", available_bytes);
TI_TRACE("caches size = {}", caches->caches.size());
std::vector<MeshBLSCache> priority_caches;
for (const auto [snode, cache] : caches->caches) {
for (const auto &[snode, cache] : caches->caches) {
priority_caches.push_back(cache);
}
std::sort(priority_caches.begin(), priority_caches.end(),
Expand Down

0 comments on commit 462c129

Please sign in to comment.