Commit 3a4bffe5 authored by Robert Maynard's avatar Robert Maynard
Browse files

Make sure methods that are used by multiple TU's are inline.

These methods need to be marked inline as they are used by multiple
TU's. When they aren't marked as inline we see random failures in
downstream VTK-m users generally when CUDA is enabled due to ODR
violations.
parent 7f487b1e
...@@ -139,9 +139,9 @@ void StorageVirtualImpl<T, S>::Shrink(vtkm::Id numberOfValues) ...@@ -139,9 +139,9 @@ void StorageVirtualImpl<T, S>::Shrink(vtkm::Id numberOfValues)
struct PortalWrapperToDevice struct PortalWrapperToDevice
{ {
template <typename DeviceAdapterTag, typename Handle> template <typename DeviceAdapterTag, typename Handle>
bool operator()(DeviceAdapterTag device, inline bool operator()(DeviceAdapterTag device,
Handle&& handle, Handle&& handle,
vtkm::cont::internal::TransferInfoArray& payload) const vtkm::cont::internal::TransferInfoArray& payload) const
{ {
auto portal = handle.PrepareForInput(device); auto portal = handle.PrepareForInput(device);
using DerivedPortal = vtkm::ArrayPortalWrapper<decltype(portal)>; using DerivedPortal = vtkm::ArrayPortalWrapper<decltype(portal)>;
...@@ -149,11 +149,11 @@ struct PortalWrapperToDevice ...@@ -149,11 +149,11 @@ struct PortalWrapperToDevice
return transfer(device, payload, portal); return transfer(device, payload, portal);
} }
template <typename DeviceAdapterTag, typename Handle> template <typename DeviceAdapterTag, typename Handle>
bool operator()(DeviceAdapterTag device, inline bool operator()(DeviceAdapterTag device,
Handle&& handle, Handle&& handle,
vtkm::Id numberOfValues, vtkm::Id numberOfValues,
vtkm::cont::internal::TransferInfoArray& payload, vtkm::cont::internal::TransferInfoArray& payload,
vtkm::cont::internal::detail::StorageVirtual::OutputMode mode) const vtkm::cont::internal::detail::StorageVirtual::OutputMode mode) const
{ {
using ACCESS_MODE = vtkm::cont::internal::detail::StorageVirtual::OutputMode; using ACCESS_MODE = vtkm::cont::internal::detail::StorageVirtual::OutputMode;
if (mode == ACCESS_MODE::WRITE) if (mode == ACCESS_MODE::WRITE)
...@@ -183,18 +183,18 @@ void StorageVirtualImpl<T, S>::ControlPortalForInput( ...@@ -183,18 +183,18 @@ void StorageVirtualImpl<T, S>::ControlPortalForInput(
} }
template <typename HandleType> template <typename HandleType>
void make_writableHostPortal(std::true_type, inline void make_writableHostPortal(std::true_type,
vtkm::cont::internal::TransferInfoArray& payload, vtkm::cont::internal::TransferInfoArray& payload,
HandleType& handle) HandleType& handle)
{ {
auto portal = handle.GetPortalControl(); auto portal = handle.GetPortalControl();
using DerivedPortal = vtkm::ArrayPortalWrapper<decltype(portal)>; using DerivedPortal = vtkm::ArrayPortalWrapper<decltype(portal)>;
vtkm::cont::make_hostPortal<DerivedPortal>(payload, portal); vtkm::cont::make_hostPortal<DerivedPortal>(payload, portal);
} }
template <typename HandleType> template <typename HandleType>
void make_writableHostPortal(std::false_type, inline void make_writableHostPortal(std::false_type,
vtkm::cont::internal::TransferInfoArray& payload, vtkm::cont::internal::TransferInfoArray& payload,
HandleType&) HandleType&)
{ {
payload.updateHost(nullptr); payload.updateHost(nullptr);
throw vtkm::cont::ErrorBadValue( throw vtkm::cont::ErrorBadValue(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment