Skip to content

Commit

Permalink
[Only Test] Try repro-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PGZXB committed Nov 22, 2022
1 parent ca5449f commit f711286
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
6 changes: 0 additions & 6 deletions taichi/codegen/cuda/codegen_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,6 @@ FunctionType CUDAModuleToFunctionConverter::convert(
auto &mod = data.module;
auto &tasks = data.tasks;
#ifdef TI_WITH_CUDA
for (const auto &task : tasks) {
llvm::Function *func = mod->getFunction(task.name);
TI_ASSERT(func);
tlctx_->mark_function_as_cuda_kernel(func, task.block_dim);
}

auto jit = tlctx_->jit.get();
auto cuda_module =
jit->add_module(std::move(mod), executor_->get_config()->gpu_max_reg);
Expand Down
16 changes: 8 additions & 8 deletions taichi/codegen/llvm/codegen_llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2638,14 +2638,14 @@ LLVMCompiledTask TaskCodeGenLLVM::run_compilation() {
emit_to_module();
eliminate_unused_functions();

// if (config.arch == Arch::cuda) {
// // CUDA specific metadata
// for (const auto &task : offloaded_tasks) {
// llvm::Function *func = module->getFunction(task.name);
// TI_ASSERT(func);
// tlctx->mark_function_as_cuda_kernel(func, task.block_dim);
// }
// }
if (config.arch == Arch::cuda) {
// CUDA specific metadata
for (const auto &task : offloaded_tasks) {
llvm::Function *func = module->getFunction(task.name);
TI_ASSERT(func);
tlctx->mark_function_as_cuda_kernel(func, task.block_dim);
}
}

return {std::move(offloaded_tasks), std::move(module),
std::move(used_tree_ids), std::move(struct_for_tls_sizes)};
Expand Down

0 comments on commit f711286

Please sign in to comment.