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

[Layer] Convert static MMHelper class to instance Class in DecoderContext. #225

Merged
merged 5 commits into from
Feb 20, 2024

Conversation

changqi1
Copy link
Contributor

No description provided.

Copy link
Contributor

@pujiang2018 pujiang2018 left a comment

Choose a reason for hiding this comment

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

Guess the performance and accuracy not impacted, but let's confirm it before merge.

float sumVal[batchSize * numBeams] = {0};
float sumVal[batchSize * numBeams];
for (int i = 0; i < batchSize * numBeams; ++i) {
sumVal[i] = 0.0f;
Copy link
Contributor

Choose a reason for hiding this comment

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

Original float "sumVal[batchSize * numBeams] = {0};" should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, original code could work, but this is c++20 standard. If we want to build w/ ICX, it should be c++17 standard.

float maxVal[batchSize * numBeams] = {std::numeric_limits<float>::lowest()};
float maxVal[batchSize * numBeams];
for (int i = 0; i < batchSize * numBeams; ++i) {
maxVal[i] = std::numeric_limits<float>::lowest();
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the author intended to set all values to lowest float. good fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, original code could work, but this is c++20 standard. If we want to build w/ ICX, it should be c++17 standard.

@changqi1 changqi1 merged commit b17b89a into intel:main Feb 20, 2024
1 check passed
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