-
Notifications
You must be signed in to change notification settings - Fork 70
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
reformated device_api and host_api benchmark to include engine, distribution, mode, throughput gigabytes per second, lambda columns #536
reformated device_api and host_api benchmark to include engine, distribution, mode, throughput gigabytes per second, lambda columns #536
Conversation
…stribution column
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.
Hi Di, I think this looks great - just one quick question though.
I noticed that I do not see the new columns show up when I run with:
./benchmark/benchmark_rocrand_device_api --benchmnark_format=csv
Is there anything special I'd need to do to show them?
Hi @umfranzw, you are right, google benchmark distinguishes between --benchmark_format and --benchmark_out_format. |
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.
This looks good to me.
As per @RobsonRLemos , we have decided to add 3 more columns, Mode, gigabytes per second and Lambda for consistency with legacy benchmarks. @umfranzw could you review these changes? |
sorry @umfranzw miss clicked |
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.
The columns included in the benchmark output are looking good. Thanks.
std::string disName = std::string(temp.begin(), temp.begin() + temp.find(">")); | ||
|
||
Out << engineName << ","; | ||
Out << disName << ","; | ||
std::string lambda = ""; |
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.
This is probably not significant enough to require a change, but just for future reference, I believe C++ strings have a constructor that initializes them to the empty string, so you don't need to set them like this.
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.
okay, thank you
size_t ePos = disName.find("="); | ||
if(ePos <= disName.size()) | ||
{ | ||
lambda = std::string(disName.begin() + (ePos + 1), disName.end() - 1); |
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.
I think the string parsing in this function is fine for this task, because we're expecting things to always be present and always be in the same order. However, just for future reference, using a regular expression with capture groups can be really useful in situations where you need to pull out a bunch of sub-strings like this. You can create a regex pattern that contains all the delimiters ('<', ','), apply it to the original temp string, and then iterate through the captured text in a single loop.
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.
okay thank you, sounds good
No worries, I took a look at the new changes, and I think everything still looks good. |
No description provided.