mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
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:
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()),
|
||||
|
Loading…
Reference in New Issue
Block a user