-
Notifications
You must be signed in to change notification settings - Fork 218
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
base: features/run
Are you sure you want to change the base?
[features/run] Parse primitive types #2733
Conversation
-- primitive types TODO: Handle arrays (vector of results) * Naive way of parsing integer array log Signed-off-by: Pradnya Khalate <[email protected]>
Signed-off-by: Pradnya Khalate <[email protected]>
…ented for testing only * Addressing PR comment Signed-off-by: Pradnya Khalate <[email protected]>
Signed-off-by: Pradnya Khalate <[email protected]>
Signed-off-by: Pradnya Khalate <[email protected]>
Signed-off-by: Pradnya Khalate <[email protected]>
* Updated tests Signed-off-by: Pradnya Khalate <[email protected]>
Signed-off-by: Pradnya Khalate <[email protected]>
} else if ('f' == label[0]) | ||
return OutputType::DOUBLE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} 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)); |
There was a problem hiding this comment.
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
/// Simple decoder for translating QIR recorded results to a C++ binary data | ||
/// structure. | ||
class RecordLogDecoder { | ||
|
||
private: |
There was a problem hiding this comment.
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.
Not covered: arrays, tuples