Merge topic 'dont_launch_zero_size_cuda_tasks'

1ea386222 cuda copy functions don't launch on length zero arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1708
This commit is contained in:
Robert Maynard 2019-06-21 12:40:25 +00:00 committed by Kitware Robot
commit 83bc8d7596

@ -987,6 +987,11 @@ public:
VTKM_LOG_SCOPE_FUNCTION(vtkm::cont::LogLevel::Perf);
const vtkm::Id inSize = input.GetNumberOfValues();
if (inSize <= 0)
{
output.Shrink(inSize);
return;
}
CopyPortal(input.PrepareForInput(DeviceAdapterTagCuda()),
output.PrepareForOutput(inSize, DeviceAdapterTagCuda()));
}
@ -999,6 +1004,12 @@ public:
VTKM_LOG_SCOPE_FUNCTION(vtkm::cont::LogLevel::Perf);
vtkm::Id size = stencil.GetNumberOfValues();
if (size <= 0)
{
output.Shrink(size);
return;
}
vtkm::Id newSize = CopyIfPortal(input.PrepareForInput(DeviceAdapterTagCuda()),
stencil.PrepareForInput(DeviceAdapterTagCuda()),
output.PrepareForOutput(size, DeviceAdapterTagCuda()),
@ -1015,6 +1026,11 @@ public:
VTKM_LOG_SCOPE_FUNCTION(vtkm::cont::LogLevel::Perf);
vtkm::Id size = stencil.GetNumberOfValues();
if (size <= 0)
{
output.Shrink(size);
return;
}
vtkm::Id newSize = CopyIfPortal(input.PrepareForInput(DeviceAdapterTagCuda()),
stencil.PrepareForInput(DeviceAdapterTagCuda()),
output.PrepareForOutput(size, DeviceAdapterTagCuda()),