Skip to content

Compile time type names#26618

Closed
smessmer wants to merge 43 commits intogh/smessmer/59/basefrom
gh/smessmer/59/head
Closed

Compile time type names#26618
smessmer wants to merge 43 commits intogh/smessmer/59/basefrom
gh/smessmer/59/head

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Sep 22, 2019

Stack from ghstack:

Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: D17519253

Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
This was referenced Oct 22, 2019
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
@smessmer smessmer requested review from dzhulgakov and ezyang December 9, 2019 19:22
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
@smessmer smessmer changed the title [wip] Compile time type names Compile time type names Dec 9, 2019
Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.

Differential Revision: [D17519253](https://our.internmc.facebook.com/intern/diff/D17519253/)

[ghstack-poisoned]
string_view prefix,
string_view suffix,
string_view str) {
#if !defined(__CUDA_ARCH__) // CUDA doesn't like std::logic_error in device code
Copy link
Contributor

Choose a reason for hiding this comment

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

Umm, and why should this ever be run on device?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it shouldn't be but CUDA seems to want to compile it for device code just in case.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is what __host__ is for

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6e1e09f.

@facebook-github-bot facebook-github-bot deleted the gh/smessmer/59/head branch December 18, 2019 15:17
wuhuikx pushed a commit to wuhuikx/pytorch that referenced this pull request Jan 30, 2020
Summary:
Pull Request resolved: pytorch#26618

Implement a mechanism to get type names at compile time
In a future diff, I'm planning to introduce this to caffe2::TypeMeta and a few other places.
ghstack-source-id: 95337871

Test Plan: unit tests

Differential Revision: D17519253

fbshipit-source-id: e14017f962fd181d147accb3f53fa8d6ee42a3f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged 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