ILGPU  0.9.0
ILGPU.Runtime.ScopedAcceleratorBinding Struct Reference

Represents a temporary binding of an accelerator object. The old binding can be recovered by either Recover or the Dispose method. More...

Inheritance diagram for ILGPU.Runtime.ScopedAcceleratorBinding:

Public Member Functions

void Recover ()
 Recovers the old accelerator and resets the internal state. More...
 
bool Equals (ScopedAcceleratorBinding other)
 Returns true if the given binding is equal to the current binding. More...
 
void Dispose ()
 Recovers the old accelerator and resets the internal state. More...
 
override bool Equals (object obj)
 Returns true if the given object is equal to the current binding. More...
 
override int GetHashCode ()
 Returns the hash code of this binding. More...
 
override string ToString ()
 Returns the string representation of this binding. More...
 

Static Public Member Functions

static bool operator== (ScopedAcceleratorBinding first, ScopedAcceleratorBinding second)
 Returns true if the first and second binding are the same. More...
 
static bool operator!= (ScopedAcceleratorBinding first, ScopedAcceleratorBinding second)
 Returns true if the first and second binding are not the same. More...
 

Public Attributes

bool IsRecoverable => OldAccelerator != null
 Returns true if an old accelerator has to be recovered. More...
 

Properties

Accelerator OldAccelerator [get]
 Returns the old accelerator that was the current one before the current binding operation (if any). More...
 

Detailed Description

Represents a temporary binding of an accelerator object. The old binding can be recovered by either Recover or the Dispose method.

The objects implements IDisposable in order to use it in the scope of using statements

Member Function Documentation

void ILGPU.Runtime.ScopedAcceleratorBinding.Dispose ( )

Recovers the old accelerator and resets the internal state.

The dispose method is useful in combination with using statements.

bool ILGPU.Runtime.ScopedAcceleratorBinding.Equals ( ScopedAcceleratorBinding  other)

Returns true if the given binding is equal to the current binding.

Parameters
otherThe other binding.
Returns
True, if the given binding is equal to the current binding.
override bool ILGPU.Runtime.ScopedAcceleratorBinding.Equals ( object  obj)

Returns true if the given object is equal to the current binding.

Parameters
objThe other object.
Returns
True, if the given object is equal to the current binding.
override int ILGPU.Runtime.ScopedAcceleratorBinding.GetHashCode ( )

Returns the hash code of this binding.

Returns
The hash code of this binding.
static bool ILGPU.Runtime.ScopedAcceleratorBinding.operator!= ( ScopedAcceleratorBinding  first,
ScopedAcceleratorBinding  second 
)
static

Returns true if the first and second binding are not the same.

Parameters
firstThe first binding.
secondThe second binding.
Returns
True, if the first and second binding are not the same.
static bool ILGPU.Runtime.ScopedAcceleratorBinding.operator== ( ScopedAcceleratorBinding  first,
ScopedAcceleratorBinding  second 
)
static

Returns true if the first and second binding are the same.

Parameters
firstThe first binding.
secondThe second binding.
Returns
True, if the first and second binding are the same.
void ILGPU.Runtime.ScopedAcceleratorBinding.Recover ( )

Recovers the old accelerator and resets the internal state.

override string ILGPU.Runtime.ScopedAcceleratorBinding.ToString ( )

Returns the string representation of this binding.

Returns
The string representation of this binding.

Member Data Documentation

bool ILGPU.Runtime.ScopedAcceleratorBinding.IsRecoverable => OldAccelerator != null

Returns true if an old accelerator has to be recovered.

Property Documentation

Accelerator ILGPU.Runtime.ScopedAcceleratorBinding.OldAccelerator
get

Returns the old accelerator that was the current one before the current binding operation (if any).


The documentation for this struct was generated from the following file: