Skip to content

Align AT_FORALL macros with AT_DISPATCH macros. #23339

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

Closed
wants to merge 10 commits into from

Conversation

gchanan
Copy link
Contributor

@gchanan gchanan commented Jul 24, 2019

Stack from ghstack:

e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

I verified via godbolt that in -O2 the Scalar.h changes generates identical code.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: D16467983

e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.
gchanan added 8 commits July 25, 2019 11:39
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
gchanan added a commit that referenced this pull request Aug 9, 2019
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

Still to come: get rid of the now-unused tag parameter.

ghstack-source-id: f9b0fc1
Pull Request resolved: #23339
@gchanan gchanan changed the title [WIP] Align AT_FORALL macros with AT_DISPATCH macros. Align AT_FORALL macros with AT_DISPATCH macros. Aug 9, 2019
@gchanan
Copy link
Contributor Author

gchanan commented Aug 9, 2019

clang tidy failures are bogus.

@gchanan gchanan requested a review from ezyang August 9, 2019 22:21
e.g. previously, AT_FORALL_SCALAR_TYPES consisted of different ScalarTypes than those dispatched from AT_DISPATCH_ALL_TYPES.

This also defines at::Scalar constructors a little differently; the FORALL macros no longer contain the tag information,
this is done internally to at::Scalar (otherwise, it made defining AND macros difficult, because the user had to provide the tag.

I verified via godbolt that in -O2 the Scalar.h changes generates identical code.

Still to come: get rid of the now-unused tag parameter.

Differential Revision: [D16467983](https://our.internmc.facebook.com/intern/diff/D16467983)
@zou3519 zou3519 deleted the gh/gchanan/35/head branch August 12, 2019 21:46
zdevito pushed a commit to zdevito/ATen that referenced this pull request Aug 12, 2019
Summary: Pull Request resolved: pytorch/pytorch#23339

Test Plan: Imported from OSS

Differential Revision: D16467983

Pulled By: gchanan

fbshipit-source-id: 84a29a03d3ec9c6416cad254a9ff1005fdc6324f
@facebook-github-bot
Copy link
Contributor

@gchanan merged this pull request in f5fefd6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
caffe2 Merged module: cpu CPU specific problem (e.g., perf, algorithm) module: internals Related to internal abstractions in c10 and ATen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants