Commit Graph

18 Commits

Author SHA1 Message Date
Kenneth Moreland
ef58bd9c4a Fix intermittent UnitTestTimer failures with CUDA
We have been noticing occasional failures of UnitTestTimer on the
dashboard for CUDA devices. The timer seems to be recording less time
than is actually elapsed.

The problem might be that the CUDA timer actually inserts fences to the
CUDA stream rather than record the current time. Thus, the actual time
might start after some pending operations complete.

To attempt to match the UnitTestTimer measurements closer to wall-clock
time, add a synchronize before starting the timer.
2022-07-12 08:52:12 -06:00
Li-Ta Lo
5448ffb28b decouple Timer.h from device compiler 2021-10-13 12:11:23 -06:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Robert Maynard
64e3e8f344 VTK-m Timer now handles when devices fail at runtime
A device can fail during startup of vtk-m or mid execution
due to issues such as OOM. Timer needs to be able to handle
these situations gracefully
2019-12-12 09:13:23 -05:00
Kenneth Moreland
92db376236 Convert uses of ListTagBase to List 2019-12-06 15:37:46 -07:00
Kenneth Moreland
827613263a Avoid touching ListTag internals
Currently, ListTags are implemented by having a subtype name list set to
a brigand::list. However, there is always a chance this will change. To
make things more explicit, create a vtkm::internal::ListTagToBrigandList
to make it clear what the resulting type should be (and provide some
potential future-proofing).

Also add a convenient vtkm::ListTagApply that allows you to  easily
instantiate a template with the list of types in a ListTag.
2019-07-22 08:36:28 -06:00
Robert Maynard
8d4611387a Simplify Timer now that RuntimeDeviceTracker handles 'any' device. 2019-06-19 10:50:44 -04:00
Robert Maynard
2c026508b3 Merge topic 'correct_openmp_timeouts'
9c2920072 UnitTestBoundingIntervalHierarchy handles systems under load better
671c1df5c Timer logs the proper device name when called with an invalid device
d3d66a331 GameOfLife example always uses the proper device adapter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1645
2019-04-18 08:05:12 -04:00
Robert Maynard
671c1df5c9 Timer logs the proper device name when called with an invalid device 2019-04-17 16:01:15 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
2d477fd531 Remove ability to pass a runtime device tracker to TryExecute
Since runtime device trackers are single instance per thread
the ability to pass them around to other functions is unneeded.
2019-04-02 10:44:30 -04:00
Robert Maynard
838cb43375 Redesign RuntimeDeviceTracker and RuntimeDeviceInformation
The RuntimeDeviceTracker had grown organically to handle multiple
different roles inside VTK-m. Now that we have device tags
that can be passed around at runtime, large portions of
the RuntimeDeviceTracker API aren't needed.

Additionally the RuntimeDeviceTracker had a dependency on knowing
the names of each device, and this wasn't possible
as that information was part of its self. Now we have moved that
information into RuntimeDeviceInformation and have broken
the recursion.
2019-03-26 08:36:18 -04:00
Robert Maynard
ae11e115a0 RuntimeDeviceTracker: Remove Global from names 2019-03-22 08:53:26 -07:00
Kenneth Moreland
6797c6e336 Specify return type for GetTimerImpl
The internal function GetTimerImpl has a rather complex expression for
its return type. Prevously this was derived using declspec, but one of
the versions of Visual Studio barfed on that for some reason. So now
declare the return type explicitly.
2019-02-28 15:36:55 -07:00
Kenneth Moreland
85265a9c84 Add const correctness to Timer
It should be possible to query a vtkm::cont::Timer without modifying it.
As such, its query functions (such as Stopped and GetElapsedTime) should
be const.
2019-02-28 15:08:16 -07:00
Kenneth Moreland
4655089934 Allow resetting Timer with a new device
Previously, in order to specify a device with the timer, it had to be
specified in the timer's construction or had to be specified every time
GetElapsedTime was called. The first method was inconvienient in the
case where there are multiple code paths to define the device and the
latter method was inconvienient because you would have to pass around a
device id.

Both these techniques still exist, but we have also added a new form of
Reset that allows you to change the device the timer is used on.
2019-02-27 15:38:32 -07:00
Kenneth Moreland
dd4a939525 Enable initializing Timer with a DeviceAdapterId
Previously, a vtkm::cont::Timer had to be initialized with either no
device or with a device adapter tag. However, this precluded
initializing the timer with a DeviceAdapterId, which made it difficult
to create a timer at runtime. Instead, just accept a DeviceAdapterId
(which all device adapter tags inherit from) and do runtime checks.
2019-02-27 15:36:46 -07:00
Haocheng LIU
415252c662 Introduce asynchronous and device independent timer
The timer class now is asynchronous and device independent. it's using an
similiar API as vtkOpenGLRenderTimer with Start(), Stop(), Reset(), Ready(),
and GetElapsedTime() function. For convenience and backward compability, Each
Start() function call will call Reset() internally and each GetElapsedTime()
function call will call Stop() function if it hasn't been called yet for keeping
backward compatibility purpose.

Bascially it can be used in two modes:

* Create a Timer without any device info. vtkm::cont::Timer time;

  * It would enable timers for all enabled devices on the machine. Users can get a
specific elapsed time by passing a device id into the GetElapsedtime function.
If no device is provided, it would pick the maximum of all timer results - the
logic behind this decision is that if cuda is disabled, openmp, serial and tbb
roughly give the same results; if cuda is enabled it's safe to return the
maximum elapsed time since users are more interested in the device execution
time rather than the kernal launch time. The Ready function can be handy here
to query the status of the timer.

* Create a Timer with a device id. vtkm::cont::Timer time((vtkm::cont::DeviceAdapterTagCuda()));

  * It works as the old timer that times for a specific device id.
2019-02-05 12:01:56 -05:00