Skip to content

Commit

Permalink
[aot] Add JSON serde (taichi-dev#6470)
Browse files Browse the repository at this point in the history
  • Loading branch information
PENGUINLIONG authored and quadpixels committed May 13, 2023
1 parent 2e42a07 commit d291004
Show file tree
Hide file tree
Showing 11 changed files with 1,261 additions and 58 deletions.
8 changes: 6 additions & 2 deletions taichi/cache/gfx/cache_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
namespace taichi::lang {
namespace gfx {

struct OfflineCacheKernelMetadata : public offline_cache::KernelMetadataBase {
struct OfflineCacheKernelMetadata {
std::string kernel_key;
std::size_t size{0}; // byte
std::time_t created_at{0}; // sec
std::time_t last_used_at{0}; // sec
std::size_t num_files{0};

TI_IO_DEF_WITH_BASECLASS(offline_cache::KernelMetadataBase, num_files);
TI_IO_DEF(kernel_key, size, created_at, last_used_at, num_files);
};

class CacheManager {
Expand Down
9 changes: 6 additions & 3 deletions taichi/cache/metal/cache_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
namespace taichi::lang {
namespace metal {

struct OfflineCacheKernelMetadata : public offline_cache::KernelMetadataBase {
struct OfflineCacheKernelMetadata {
std::string kernel_key;
std::size_t size{0}; // byte
std::time_t created_at{0}; // sec
std::time_t last_used_at{0}; // sec
CompiledKernelData compiled_kernel_data;

TI_IO_DEF_WITH_BASECLASS(offline_cache::KernelMetadataBase,
compiled_kernel_data);
TI_IO_DEF(kernel_key, size, created_at, last_used_at, compiled_kernel_data);
};

class CacheManager {
Expand Down
1 change: 1 addition & 0 deletions taichi/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target_sources(taichi_common
PRIVATE
cleanup.cpp
core.cpp
json.cpp
logging.cpp
symbol_version.cpp
)
Expand Down
Loading

0 comments on commit d291004

Please sign in to comment.