Skip to content

ffi: Extract some serialization methods for use in other files.#444

Merged
LinZhihao-723 merged 4 commits into
y-scope:mainfrom
LinZhihao-723:ffi_utils
Jun 16, 2024
Merged

ffi: Extract some serialization methods for use in other files.#444
LinZhihao-723 merged 4 commits into
y-scope:mainfrom
LinZhihao-723:ffi_utils

Conversation

@LinZhihao-723

Copy link
Copy Markdown
Member

Description

In the current IR stream implementation, serialization methods are made as local methods so they cannot be reused in other files. However, some methods are reuseable when we implement the next IR format. This PR moves some of the general methods to util files to make them reusable. Methods moved including:

  • serialie_metadata: This general method serializes a JSON object as the IR stream metadata. It can be reused when creating a new format IR stream.
  • serialize_int: This general integer sterilization method will be wildly used in integer value encoding in the coming format.

Notice that minor refactoring is also introduced to meet our latest coding standard when moving these methods.

Validation performed

Ensured the code can be successfully built with all unit tests passed.

Comment thread components/core/src/clp/ffi/ir_stream/utils.hpp Outdated
Comment thread components/core/src/clp/ffi/ir_stream/utils.inc Outdated

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the PR title, how about:

ffi: Extract some serialization methods for use in other files.

@LinZhihao-723

Copy link
Copy Markdown
Member Author

For the PR title, how about:

ffi: Extract some serialization methods for use in other files.

lgtm

@LinZhihao-723 LinZhihao-723 changed the title ffi: Generailize helper methods for IR streaming serialization. ffi: Extract some serialization methods for use in other files. Jun 16, 2024
@LinZhihao-723 LinZhihao-723 merged commit c9c9548 into y-scope:main Jun 16, 2024
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants