Skip to content

Commit

Permalink
tackle some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chhwang committed May 23, 2024
1 parent 1ca5c60 commit 1fbf38b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
10 changes: 8 additions & 2 deletions ark/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 << " ";
Expand Down
28 changes: 0 additions & 28 deletions ark/gpu/gpu_kernel_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(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;
}
6 changes: 0 additions & 6 deletions ark/model/model_node.cpp

This file was deleted.

0 comments on commit 1fbf38b

Please sign in to comment.