• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 
3 #include <ATen/cuda/CUDAContext.h>
4 #include <ATen/cuda/CUDADevice.h>
5 
TEST(CudaDeviceTest,getDeviceFromPtr_fails_with_host_memory)6 TEST(CudaDeviceTest, getDeviceFromPtr_fails_with_host_memory) {
7   if (!at::cuda::is_available()) {
8     return;
9   }
10 
11   int dummy = 0;
12 
13   ASSERT_THROW(at::cuda::getDeviceFromPtr(&dummy), c10::Error);
14 }
15