Fix Windows build and test in CI (#11716)

Summary:
This PR adds Windows support for the C++ frontend. A lot of declarations were missing `TORCH_API` macros, and lots of code just did not compile on MSVC.

ebetica ezyang orionr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11716

Reviewed By: orionr

Differential Revision: D13038253

Pulled By: goldsborough

fbshipit-source-id: c8e5a45efd26117aeb99e768b56fcd5a89fcb9f8
This commit is contained in:
Peter Goldsborough
2018-11-13 16:30:05 -08:00
committed by Facebook Github Bot
parent f649d8b3a9
commit 8311bbee7f
52 changed files with 238 additions and 193 deletions

View File

@ -18,7 +18,7 @@ TEST(TensorTest, AllocatesTensorOnTheCorrectDevice_MultiCUDA) {
ASSERT_EQ(tensor.device().index(), 1);
}
TEST(TensorTest, ToDevice_CUDA) {
TEST(TensorTest, ToDevice_MultiCUDA) {
auto tensor = at::empty({3, 4});
REQUIRE_TENSOR_OPTIONS(at::kCPU, -1, at::kFloat, at::kStrided);
@ -59,7 +59,7 @@ TEST(TensorTest, ToDevice_CUDA) {
REQUIRE_TENSOR_OPTIONS(at::kCUDA, 0, at::kInt, at::kStrided);
}
TEST(TensorTest, ToTensorAndTensorAttributes_CUDA) {
TEST(TensorTest, ToTensorAndTensorAttributes_MultiCUDA) {
auto tensor = at::empty({3, 4});
REQUIRE_TENSOR_OPTIONS(at::kCPU, -1, at::kFloat, at::kStrided);
@ -97,7 +97,7 @@ TEST(TensorTest, ToDoesNotCopyWhenOptionsAreAllTheSame_CUDA) {
ASSERT_EQ(hopefully_not_copy.data<float>(), tensor.data<float>());
}
TEST(TensorTest, ToDeviceAndDtype_CUDA) {
TEST(TensorTest, ToDeviceAndDtype_MultiCUDA) {
auto tensor = at::empty({3, 4});
REQUIRE_TENSOR_OPTIONS(at::kCPU, -1, at::kFloat, at::kStrided);