Skip to content

Conversation

zasdfgbnm
Copy link
Collaborator

No description provided.

@zasdfgbnm zasdfgbnm mentioned this pull request May 1, 2020
@zasdfgbnm zasdfgbnm changed the title Migrate unary complex kernel to c10::complex Migrate CUDA unary complex kernel to c10::complex May 1, 2020
@zasdfgbnm zasdfgbnm requested a review from anjali411 May 1, 2020 09:47
@zasdfgbnm
Copy link
Collaborator Author

@anjali411 This is ready

@dr-ci
Copy link

dr-ci bot commented May 1, 2020

💊 Build failures summary and remediations

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


💚 💚 Looks good so far! There are no failures yet. 💚 💚


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.

See how this bot performed.

This comment has been revised 3 times.

@anjali411 anjali411 added the module: complex Related to complex number support in PyTorch label May 1, 2020
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@anjali411 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@zasdfgbnm
Copy link
Collaborator Author

@anjali411 The fix for ROCm is

#ifdef __HIP_PLATFORM_HCC__
#define ROCm_Bug(x)
#else
#define ROCm_Bug(x) x
#endif

template<typename T>
C10_HOST_DEVICE T arg(const c10::complex<T>& z) {
  return ROCm_Bug(std)::atan2(std::imag(z), std::real(z));
}

#undef ROCm_Bug

I am being very explicit on all the compiler bugs I found so that people can have a good idea of why the code is written that way. That's why there were a CUDA92_Bug and ROCm_Bug. Hope we will be able to remove these macros one day in the future.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@anjali411 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@anjali411 merged this pull request in d7ccb4b.

@zasdfgbnm zasdfgbnm deleted the unary-complex-kernel branch May 5, 2020 17:02
bharatr21 pushed a commit to bharatr21/pytorch that referenced this pull request May 5, 2020
Summary: Pull Request resolved: pytorch#37647

Differential Revision: D21351018

Pulled By: anjali411

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

Labels

Merged module: complex Related to complex number support in PyTorch open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants