Skip to content

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
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