From 1fbf38b4dd839f97199ade30a90959c5145f1a86 Mon Sep 17 00:00:00 2001 From: Changho Hwang Date: Thu, 23 May 2024 22:42:51 +0000 Subject: [PATCH] tackle some comments --- ark/codegen.cpp | 10 ++++++++-- ark/gpu/gpu_kernel_test.cpp | 28 ---------------------------- ark/model/model_node.cpp | 6 ------ 3 files changed, 8 insertions(+), 36 deletions(-) delete mode 100644 ark/model/model_node.cpp diff --git a/ark/codegen.cpp b/ark/codegen.cpp index d2ae2d3d1..27fb00b4b 100644 --- a/ark/codegen.cpp +++ b/ark/codegen.cpp @@ -125,14 +125,21 @@ CodeGenerator::Impl::Impl(const Json &plan, it++; continue; } - // no need to sync if range is a part of proc_range. if (intersec.size() < range.size()) { + // range is not a part of proc_range, so we need to + // sync range here. size_t state_id = get_state_id(range); body_ss << sync_process_range(range, state_id); if (intersec.size() < proc_range.size()) { + // proc_range is not a part of range, so we need to + // sync proc_range later. need_sync = true; } } else { + // intersec.size() == range.size(), which means that + // range is a part of proc_range. In this case, we don't + // need to sync range here, because we will sync + // proc_range later by setting `need_sync` to true. need_sync = true; } it = unsynced.erase(it); @@ -373,7 +380,6 @@ std::string CodeGenerator::Impl::resource_group( // if (task_id >= task_e) break; // task_func(_buf, task_id, sram_per_warp); // } - // __syncthreads(); // } // ``` ss << " "; diff --git a/ark/gpu/gpu_kernel_test.cpp b/ark/gpu/gpu_kernel_test.cpp index 6dd3ed115..870ad7ab9 100644 --- a/ark/gpu/gpu_kernel_test.cpp +++ b/ark/gpu/gpu_kernel_test.cpp @@ -13,35 +13,7 @@ ark::unittest::State test_gpu_kernel() { return ark::unittest::SUCCESS; } -// -// const std::string test_kernel_loop_void = -// "__device__ void ark_loop_body(char *_buf, int _iter) {\n" -// " // Do nothing. Print iteration counter.\n" -// " if (threadIdx.x == 0 && blockIdx.x == 0) {\n" -// " if (_iter % 50 == 49) {\n" -// " printf(\".\\n\");\n" -// " } else {\n" -// " printf(\".\");\n" -// " }\n" -// " }\n" -// "}\n"; - -// ark::unittest::State test_gpu_loop_kernel() { -// int num_sm = ark::GpuManager::get_instance(0)->info().num_sm; -// ark::GpuLoopKernel glk(0, "test_kernel_loop_void", test_kernel_loop_void, -// static_cast(num_sm), 1, 0, 0); -// glk.compile(); -// glk.load(); - -// glk.launch(); -// glk.run(100); -// glk.stop(); - -// return ark::unittest::SUCCESS; -// } - int main() { UNITTEST(test_gpu_kernel); - // UNITTEST(test_gpu_loop_kernel); return 0; } diff --git a/ark/model/model_node.cpp b/ark/model/model_node.cpp deleted file mode 100644 index ef3a8158a..000000000 --- a/ark/model/model_node.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -#include "model_node.hpp" - -namespace ark {} // namespace ark