-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update on "[aot] Serialize built graph, deserialize and run."
related: #4786 This PR demonstrates a minimal example of serializing a built graph, deserializing and running it. [ghstack-poisoned]
- Loading branch information
Showing
9 changed files
with
60 additions
and
61 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
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
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