-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fixed windows MSVC build compatibility #9
Conversation
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.
Can you check any other errors raised by the circle CI build and resolve them? Thank you!
https://circleci.com/gh/facebookresearch/pytorch3d/724?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
@@ -219,7 +219,7 @@ at::Tensor nn_points_idx_cuda(at::Tensor p1, at::Tensor p2) { | |||
const auto D = p1.size(2); | |||
|
|||
AT_ASSERTM(p2.size(2) == D, "Point sets must have same last dimension."); | |||
auto idx = at::empty({N, P1}, p1.options().dtype(at::kLong)); | |||
auto idx = at::empty({N, P1}, p1.options().dtype(at::kint64_t)); |
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.
The Circle CI build is failing as kint64_t
is not a valid torch variable. Was at::kLong
causing an issue?
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.
Ah. Sorry this should be kept as it is.
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.
Fixed the compiling error
@@ -219,7 +219,7 @@ at::Tensor nn_points_idx_cuda(at::Tensor p1, at::Tensor p2) { | |||
const auto D = p1.size(2); | |||
|
|||
AT_ASSERTM(p2.size(2) == D, "Point sets must have same last dimension."); | |||
auto idx = at::empty({N, P1}, p1.options().dtype(at::kLong)); | |||
auto idx = at::empty({N, P1}, p1.options().dtype(at::kint64_t)); |
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.
Ah. Sorry this should be kept as it is.
@yuanluxu Apologies for the delay in responding to this PR. We're working on windows support so stay tuned! |
Can I clarify the two preprocessor definitions? I think I think the problem for Thanks |
|
Thanks! Looks good to me. |
@yuanluxu it seems there are conflicts with master now (some files have been updated recently). Can you fix these conflicts and update the PR? Thank you! |
@nikhilaravi Fixed! |
Looks good! Thanks @yuanluxu for adding this! |
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.
@nikhilaravi has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@yuanluxu has updated the pull request. Re-import the pull request |
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.
@yuanluxu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@yuanluxu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@yuanluxu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@yuanluxu has updated the pull request. Re-import the pull request |
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.
@yuanluxu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@yuanluxu has updated the pull request. Re-import the pull request |
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.
@yuanluxu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@yuanluxu has updated the pull request. Re-import the pull request |
@yuanluxu has updated the pull request. Re-import the pull request |
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.
@yuanluxu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@yuanluxu has updated the pull request. Re-import the pull request |
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.
@yuanluxu has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Change the data type usage in the code to ensure cross-platform compatibility long -> int64_t <img width="628" alt="image" src="https://github.com/facebookresearch/pytorch3d/assets/6214316/40041f7f-3c09-4571-b9ff-676c625802e9"> Tested under Win 11 and Ubuntu 22.04 with CUDA 12.1.1 torch 2.1.1 Related issues & PR #9 #1679 Pull Request resolved: #1689 Reviewed By: MichaelRamamonjisoa Differential Revision: D51521562 Pulled By: bottler fbshipit-source-id: d8ea81e223c642e0e9fb283f5d7efc9d6ac00d93
Fixed a few MSVC compiler (visual studio 2019, MSVC 19.16.27034) compatibility issues
const auto kEpsilon = 1e-30;
MSVC does not compile this const into both host and device, change to a MACRO.
const float area2 = pow(area, 2.0);
2.0 is considered as double by MSVC and raised an error
std::tuple<torch::Tensor, torch::Tensor> RasterizePointsCoarseCpu() return type does not match the declaration in rasterize_points_cpu.h.