vtk-m/vtkm/cont/DeviceAdapterTag.cxx
Robert Maynard ff687016ee For VTK-m libs all includes of DeviceAdapterTagCuda happen from cuda files
It is very easy to cause ODR violations with DeviceAdapterTagCuda.
If you include that header from a C++ file and a CUDA file inside
the same program we an ODR violation. The reasons is that the C++
versions will say the tag is invalid, and the CUDA will say the
tag is valid.

The solution to this is that any compilation unit that includes
DeviceAdapterTagCuda from a version of VTK-m that has CUDA enabled
must be invoked by the cuda compiler.
2019-04-22 10:39:54 -04:00

33 lines
899 B
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/DeviceAdapterTag.h>
#include <vtkm/cont/RuntimeDeviceInformation.h>
namespace vtkm
{
namespace cont
{
DeviceAdapterNameType DeviceAdapterId::GetName() const
{
vtkm::cont::RuntimeDeviceInformation info;
return info.GetName(*this);
}
DeviceAdapterId make_DeviceAdapterId(const DeviceAdapterNameType& name)
{
vtkm::cont::RuntimeDeviceInformation info;
return info.GetId(name);
}
}
} // end namespace vtkm::cont