Skip to content

[MOD-6775] introduce fp16 type! #462

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

Merged
merged 16 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/flow-temp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ name: temporary testing

on:
push:
branches-ignore: ['**'] # ignore all branches. Comment this line to run your workflow below on every push.
# branches-ignore: ['**'] # ignore all branches. Comment this line to run your workflow below on every push.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Uncomment


jobs:
check-if-docs-only:
uses: ./.github/workflows/task-check-docs.yml
macos:
focal:
needs: [check-if-docs-only]
if: ${{ needs.check-if-docs-only.outputs.only-docs-changed == 'false' }}
uses: ./.github/workflows/task-unit-test.yml
with:
env: macos-latest
run-valgrind: false
container: ubuntu:focal
2 changes: 1 addition & 1 deletion src/VecSim/types/bfloat16.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace vecsim_types {
struct bfloat16 {
uint16_t val;
constexpr bfloat16() = default;
bfloat16() = default;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a compiler version issue? How come it works with fp16? Can we try this option?

Suggested change
bfloat16() = default;
constexpr bfloat16() noexcept {}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

declaring a default ctor as constexpr is allowed as of c++20, and this feature in particular is supported as of gcc10
fp16 worked because it didn't have constexpr at first place.
Anyway, since we have another ctor that is constexpr, it doesn't matter.

constexpr bfloat16(uint16_t val) : val(val) {}
operator uint16_t() const { return val; }
};
Expand Down
Loading