mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
4020f51988
As the RuntimeDeviceTracker is a per thread construct we now make it explicit that you can only get a reference to the per-thread version and can't copy it.
31 lines
1.0 KiB
C++
31 lines
1.0 KiB
C++
//============================================================================
|
|
// Copyright (c) Kitware, Inc.
|
|
// All rights reserved.
|
|
// See LICENSE.txt for details.
|
|
//
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
//============================================================================
|
|
|
|
#include <vtkm/cont/RuntimeDeviceTracker.h>
|
|
#include <vtkm/cont/testing/TestingVirtualObjectHandle.h>
|
|
|
|
namespace
|
|
{
|
|
|
|
void TestVirtualObjectHandle()
|
|
{
|
|
using DeviceAdapterList = vtkm::ListTagBase<vtkm::cont::DeviceAdapterTagSerial>;
|
|
vtkm::cont::testing::TestingVirtualObjectHandle<DeviceAdapterList>::Run();
|
|
}
|
|
|
|
} // anonymous namespace
|
|
|
|
int UnitTestSerialVirtualObjectHandle(int argc, char* argv[])
|
|
{
|
|
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
|
|
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
|
|
return vtkm::cont::testing::Testing::Run(TestVirtualObjectHandle, argc, argv);
|
|
}
|