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

Fix bit math #46837

Closed
wants to merge 1 commit into from
Closed

Fix bit math #46837

wants to merge 1 commit into from

Conversation

r-barnes
Copy link
Contributor

Summary:
Formerly static_cast<StreamId>(bits) and static_cast<DeviceIndex>(bits) were and-ed against ull types resulting in an integer promotion which later raised a warning in downcasting passes to Stream and Device.

Moving the & operation inside the cast results in two uint64_t being operated on and then cast to the correct type, eliminating the warning.

Test Plan: Standard pre-commit test rig.

Differential Revision: D24481292

Summary:
Formerly `static_cast<StreamId>(bits)` and `static_cast<DeviceIndex>(bits)` were and-ed against `ull` types resulting in an integer promotion which later raised a warning in downcasting passes to  `Stream` and `Device`.

Moving the `&` operation inside the cast results in two `uint64_t` being operated on and then cast to the correct type, eliminating the warning.

Test Plan: Standard pre-commit test rig.

Differential Revision: D24481292

fbshipit-source-id: 16ba68690e58ce8b710bb082542c1a5451548742
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D24481292

@dr-ci
Copy link

dr-ci bot commented Oct 26, 2020

💊 CI failures summary and remediations

As of commit 02b1b02 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 1 time.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c3fc17b.

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c3fc17b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants