Viskores
1.0
|
A class to create a scoped runtime device tracker object. More...
#include <RuntimeDeviceTracker.h>
std::unique_ptr< detail::RuntimeDeviceTrackerInternals > | SavedState |
Construct a ScopedRuntimeDeviceTracker associated with the thread, associated with the provided tracker (defaults to current thread's tracker). More... | |
ScopedRuntimeDeviceTracker (const viskores::cont::RuntimeDeviceTracker &tracker=GetRuntimeDeviceTracker()) | |
Construct a ScopedRuntimeDeviceTracker associated with the thread, associated with the provided tracker (defaults to current thread's tracker). More... | |
ScopedRuntimeDeviceTracker (viskores::cont::DeviceAdapterId device, RuntimeDeviceTrackerMode mode=RuntimeDeviceTrackerMode::Force, const viskores::cont::RuntimeDeviceTracker &tracker=GetRuntimeDeviceTracker()) | |
Use this constructor to modify the state of the device adapters associated with the provided tracker. More... | |
ScopedRuntimeDeviceTracker (const std::function< bool()> &abortChecker, const viskores::cont::RuntimeDeviceTracker &tracker=GetRuntimeDeviceTracker()) | |
Use this constructor to set the abort checker functor for the provided tracker. More... | |
~ScopedRuntimeDeviceTracker () | |
Destructor is not thread safe. More... | |
Additional Inherited Members | |
![]() | |
~RuntimeDeviceTracker () | |
bool | CanRunOn (DeviceAdapterId deviceId) const |
Returns true if the given device adapter is supported on the current machine. More... | |
void | ReportAllocationFailure (viskores::cont::DeviceAdapterId deviceId, const viskores::cont::ErrorBadAllocation &) |
Report a failure to allocate memory on a device, this will flag the device as being unusable for all future invocations. More... | |
void | ReportBadDeviceFailure (viskores::cont::DeviceAdapterId deviceId, const viskores::cont::ErrorBadDevice &) |
Report a ErrorBadDevice failure and flag the device as unusable. More... | |
void | ResetDevice (viskores::cont::DeviceAdapterId deviceId) |
Reset the tracker for the given device. More... | |
void | Reset () |
Reset the tracker to its default state for default devices. More... | |
void | DisableDevice (DeviceAdapterId deviceId) |
Disable the given device. More... | |
void | ForceDevice (DeviceAdapterId deviceId) |
Disable all devices except the specified one. More... | |
bool | GetThreadFriendlyMemAlloc () const |
Get/Set use of thread-friendly memory allocation for a device. More... | |
void | SetThreadFriendlyMemAlloc (bool state) |
Get/Set use of thread-friendly memory allocation for a device. More... | |
void | CopyStateFrom (const viskores::cont::RuntimeDeviceTracker &tracker) |
Copies the state from the given device. More... | |
void | SetAbortChecker (const std::function< bool()> &func) |
Set/Clear the abort checker functor. More... | |
void | ClearAbortChecker () |
Set/Clear the abort checker functor. More... | |
bool | CheckForAbortRequest () const |
void | PrintSummary (std::ostream &out) const |
Produce a human-readable report on the state of the runtime device tracker. More... | |
A class to create a scoped runtime device tracker object.
This object captures the state of the per-thread device tracker and will revert any changes applied during its lifetime on destruction.
viskores::cont::ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker | ( | const viskores::cont::RuntimeDeviceTracker & | tracker = GetRuntimeDeviceTracker() | ) |
Construct a ScopedRuntimeDeviceTracker associated with the thread, associated with the provided tracker (defaults to current thread's tracker).
Any modifications to the ScopedRuntimeDeviceTracker will effect what ever thread the tracker
is associated with, which might not be the thread on which the ScopedRuntimeDeviceTracker was constructed.
Constructors are not thread safe
viskores::cont::ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker | ( | viskores::cont::DeviceAdapterId | device, |
RuntimeDeviceTrackerMode | mode = RuntimeDeviceTrackerMode::Force , |
||
const viskores::cont::RuntimeDeviceTracker & | tracker = GetRuntimeDeviceTracker() |
||
) |
Use this constructor to modify the state of the device adapters associated with the provided tracker.
Use mode
with device
as follows:
'Force' (default)
viskores::cont::ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker | ( | const std::function< bool()> & | abortChecker, |
const viskores::cont::RuntimeDeviceTracker & | tracker = GetRuntimeDeviceTracker() |
||
) |
Use this constructor to set the abort checker functor for the provided tracker.
viskores::cont::ScopedRuntimeDeviceTracker::~ScopedRuntimeDeviceTracker | ( | ) |
Destructor is not thread safe.
|
private |
Construct a ScopedRuntimeDeviceTracker associated with the thread, associated with the provided tracker (defaults to current thread's tracker).
Any modifications to the ScopedRuntimeDeviceTracker will effect what ever thread the tracker
is associated with, which might not be the thread on which the ScopedRuntimeDeviceTracker was constructed.
Constructors are not thread safe