Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[features/run] Parse primitive types #2733

Open
wants to merge 8 commits into
base: features/run
Choose a base branch
from

Conversation

khalatepradnya
Copy link
Collaborator

Not covered: arrays, tuples

  -- primitive types
TODO: Handle arrays (vector of results)

* Naive way of parsing integer array log

Signed-off-by: Pradnya Khalate <[email protected]>
…ented for

testing only
* Addressing PR comment

Signed-off-by: Pradnya Khalate <[email protected]>
* Updated tests

Signed-off-by: Pradnya Khalate <[email protected]>
github-actions bot pushed a commit that referenced this pull request Mar 13, 2025
github-actions bot pushed a commit that referenced this pull request Mar 13, 2025
Comment on lines +42 to +43
} else if ('f' == label[0])
return OutputType::DOUBLE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
} else if ('f' == label[0])
return OutputType::DOUBLE;
} else if ('f' == label[0]) {
return OutputType::DOUBLE;
}

nit: balanced braces with if part.

void addPrimitiveRecord(T value) {
/// ASKME: Is this efficient?
std::size_t position = buffer.size();
buffer.resize(position + sizeof(T));
Copy link
Collaborator

Choose a reason for hiding this comment

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

For efficiency it might be better to call resize with an overestimate. That way the vector would only be resized every $i$ calls instead of potentially every time.

/// Simple decoder for translating QIR recorded results to a C++ binary data
/// structure.
class RecordLogDecoder {

private:
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: class means these are already private. I prefer private data members and member functions to come last since they are not part of the interface of the class, but implementation details. Putting them up front means the reader has to wade through them to find the interface, which is where one should start reading to figure out what the class is for and does.

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