forked from taichi-dev/taichi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aot] Serialize built graph, deserialize and run.
related: taichi-dev#4786 This PR demonstrates a minimal example of serializing a built graph, deserializing and running it. ghstack-source-id: e369b326734b3cffaf91262ed84806044e121c3c Pull Request resolved: taichi-dev#5016
- Loading branch information
Ailing Zhang
authored and
Ailing Zhang
committed
May 22, 2022
1 parent
fba92cf
commit 303525b
Showing
10 changed files
with
193 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
#include "taichi/runtime/vulkan/runtime.h" | ||
|
||
namespace taichi { | ||
namespace lang { | ||
namespace vulkan { | ||
class KernelImpl : public aot::Kernel { | ||
public: | ||
explicit KernelImpl(VkRuntime *runtime, VkRuntime::RegisterParams &¶ms) | ||
: runtime_(runtime), params_(std::move(params)) { | ||
} | ||
|
||
void launch(RuntimeContext *ctx) override { | ||
auto handle = runtime_->register_taichi_kernel(params_); | ||
runtime_->launch_kernel(handle, ctx); | ||
} | ||
|
||
const VkRuntime::RegisterParams ¶ms() { | ||
return params_; | ||
} | ||
|
||
private: | ||
VkRuntime *const runtime_; | ||
const VkRuntime::RegisterParams params_; | ||
}; | ||
} // namespace vulkan | ||
} // namespace lang | ||
} // namespace taichi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters