-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add a bitwise NOT operator for integer and Boolean types (CUDA). #22320
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
Conversation
colesbury
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like it will work on non-contiguous Tensors. Use TensorIterator here, like you do for the CPU kernel. I think the only difference from the CPU version will be that you should call gpu_kernel instead of cpu_kernel
| - func: bitwise_not(Tensor self, *, Tensor(a!) out) -> Tensor(a!) | ||
| dispatch: | ||
| CPU: _bitwise_not_out_cpu | ||
| CPU: bitwise_not_out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to list them if the dispatch to the same function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other places like this, e.g.
pytorch/aten/src/ATen/native/native_functions.yaml
Lines 2753 to 2754 in d9e15bc
| CPU: dense_to_sparse | |
| CUDA: dense_to_sparse |
Summary: Pull Request resolved: pytorch/pytorch#22320 Test Plan: Imported from OSS Differential Revision: D16183578 Pulled By: colesbury fbshipit-source-id: 2f72cce5e10fd637be1ac87e1bbfe0937a661034
|
@colesbury merged this pull request in 574e808. |
Stack from ghstack:
Related to #20024, #22246, #22262
Differential Revision: D16183578