push magma init into lazyInitCUDA (#18527)

Summary:
Tries to fix C++ API's usage of MAGMA-based functions.

Attempts to Fix https://github.com/pytorch/pytorch/issues/18074
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18527

Differential Revision: D14691694

Pulled By: soumith

fbshipit-source-id: dd04e74418e486d73ea4a92193ddf79352ed71ba
This commit is contained in:
Soumith Chintala
2019-04-03 12:27:19 -07:00
committed by Facebook Github Bot
parent ed9724f385
commit b5d8844bbe
3 changed files with 12 additions and 6 deletions

View File

@ -113,3 +113,11 @@ TEST(TensorTest, ToDeviceAndDtype_MultiCUDA) {
tensor = tensor.to(at::kCPU, at::kInt);
REQUIRE_TENSOR_OPTIONS(at::kCPU, -1, at::kInt, at::kStrided);
}
TEST(TensorTest, MagmaInitializesCorrectly_CUDA) {
auto tensor = at::arange(1, 17, at::TensorOptions(at::kFloat).device(at::Device("cuda")));
tensor = tensor.view({4, 4});
if (at::hasMAGMA()) {
at::inverse(tensor);
}
}