ILGPU  0.9.0
ILGPU.Runtime.CPU.CPUAccelerator Class Reference

Represents a general CPU-based runtime for kernels. More...

Inheritance diagram for ILGPU.Runtime.CPU.CPUAccelerator:
ILGPU.Runtime.Accelerator

Public Member Functions

 CPUAccelerator (Context context)
 Constructs a new CPU runtime. More...
 
 CPUAccelerator (Context context, int numThreads)
 Constructs a new CPU runtime. More...
 
 CPUAccelerator (Context context, int numThreads, ThreadPriority threadPriority)
 Constructs a new CPU runtime. More...
 
override TExtension CreateExtension< TExtension, TExtensionProvider > (TExtensionProvider provider)
 
- Public Member Functions inherited from ILGPU.Runtime.Accelerator
MemoryBuffer< T, TIndex > Allocate< T, TIndex > (TIndex extent)
 Allocates a buffer with the specified number of elements on this accelerator. More...
 
MemoryBuffer< T > Allocate< T > (long extent)
 Allocates a 1D buffer with the specified number of elements on this accelerator. More...
 
MemoryBuffer2D< T > Allocate< T > (LongIndex2 extent)
 Allocates a 2D buffer with the specified number of elements on this accelerator. More...
 
MemoryBuffer2D< T > Allocate< T > (long width, long height)
 Allocates a 2D buffer with the specified number of elements on this accelerator. More...
 
MemoryBuffer3D< T > Allocate< T > (LongIndex3 extent)
 Allocates a 3D buffer with the specified number of elements on this accelerator. More...
 
MemoryBuffer3D< T > Allocate< T > (long width, long height, long depth)
 Allocates a 2D buffer with the specified number of elements on this accelerator. More...
 
AcceleratorStream CreateStream ()
 Creates a new accelerator stream. More...
 
void Synchronize ()
 Synchronizes pending operations. More...
 
override void ClearCache (ClearCacheMode mode)
 Clears all internal caches. More...
 
float EstimateOccupancyPerMultiprocessor< TIndex > (Kernel kernel, TIndex groupDim)
 Estimates the occupancy of the given kernel with the given group size of a single multiprocessor. More...
 
float EstimateOccupancyPerMultiprocessor (Kernel kernel, int groupSize)
 Estimates the occupancy of the given kernel with the given group size of a single multiprocessor. More...
 
float EstimateOccupancyPerMultiprocessor (Kernel kernel, int groupSize, int dynamicSharedMemorySizeInBytes)
 Estimates the occupancy of the given kernel with the given group size of a single multiprocessor. More...
 
int EstimateMaxActiveGroupsPerMultiprocessor< TIndex > (Kernel kernel, TIndex groupDim)
 Estimates the maximum number of active groups per multiprocessor for the given kernel. More...
 
int EstimateMaxActiveGroupsPerMultiprocessor (Kernel kernel, int groupSize)
 Estimates the maximum number of active groups per multiprocessor for the given kernel. More...
 
int EstimateMaxActiveGroupsPerMultiprocessor (Kernel kernel, int groupSize, int dynamicSharedMemorySizeInBytes)
 Estimates the maximum number of active groups per multiprocessor for the given kernel. More...
 
int EstimateGroupSize (Kernel kernel)
 Estimates a group size to gain maximum occupancy on this device. More...
 
int EstimateGroupSize (Kernel kernel, out int minGridSize)
 Estimates a group size to gain maximum occupancy on this device. More...
 
int EstimateGroupSize (Kernel kernel, int dynamicSharedMemorySizeInBytes, out int minGridSize)
 Estimates a group size to gain maximum occupancy on this device. More...
 
int EstimateGroupSize (Kernel kernel, Func< int, int > computeSharedMemorySize, out int minGridSize)
 Estimates a group size to gain maximum occupancy on this device. More...
 
int EstimateGroupSize (Kernel kernel, Func< int, int > computeSharedMemorySize, int maxGroupSize, out int minGridSize)
 Estimates a group size to gain maximum occupancy on this device. More...
 
int EstimateGroupSize (Kernel kernel, int dynamicSharedMemorySizeInBytes, int maxGroupSize, out int minGridSize)
 Estimates a group size to gain maximum occupancy on this device. More...
 
override string ToString ()
 Returns the string representation of this accelerator. More...
 
void MakeCurrent ()
 Makes this accelerator the current one for this thread. More...
 
void Bind ()
 Makes this accelerator the current one for this thread. More...
 
ScopedAcceleratorBinding BindScoped ()
 Makes this accelerator the current one for this thread and returns a ScopedAcceleratorBinding object that allows to easily recover the old binding. More...
 
CompiledKernel CompileKernel (in EntryPointDescription entry)
 Compiles the given method into a CompiledKernel. More...
 
CompiledKernel CompileKernel (in EntryPointDescription entry, in KernelSpecialization specialization)
 Compiles the given method into a CompiledKernel using the given kernel specialization. More...
 
Kernel LoadKernel (CompiledKernel kernel)
 Loads the given explicitly grouped kernel. More...
 
Kernel LoadImplicitlyGroupedKernel (CompiledKernel kernel, int customGroupSize)
 Loads the given implicitly-grouped kernel. More...
 
Kernel LoadImplicitlyGroupedKernel (CompiledKernel kernel, int customGroupSize, out KernelInfo kernelInfo)
 Loads the given implicitly-grouped kernel. More...
 
Kernel LoadAutoGroupedKernel (CompiledKernel kernel)
 Loads the given implicitly-grouped kernel while using an automatically computed grouping configuration. More...
 
Kernel LoadAutoGroupedKernel (CompiledKernel kernel, out KernelInfo kernelInfo)
 Loads the given implicitly-grouped kernel while using an automatically computed grouping configuration. More...
 
Kernel LoadKernel (MethodInfo method)
 Loads the given explicitly grouped kernel. Implicitly-grouped kernels are not supported. More...
 
Kernel LoadKernel (MethodInfo method, KernelSpecialization specialization)
 Loads the given explicitly grouped kernel. Implicitly-grouped kernels are not supported. More...
 
Kernel LoadKernel (MethodInfo method, KernelSpecialization specialization, out KernelInfo kernelInfo)
 Loads the given explicitly grouped kernel. Implicitly-grouped kernels are not supported. More...
 
Kernel LoadImplicitlyGroupedKernel (MethodInfo method, int customGroupSize)
 Loads the given implicitly-grouped kernel. Implicitly-grouped kernel will be launched with the given group size. More...
 
Kernel LoadAutoGroupedKernel (MethodInfo method)
 Loads the given implicitly-grouped kernel while using an automatically computed grouping configuration. More...
 
Kernel LoadAutoGroupedKernel (MethodInfo method, out KernelInfo kernelInfo)
 Loads the given implicitly-grouped kernel while using an automatically computed grouping configuration. More...
 
TDelegate LoadKernel< TDelegate > (MethodInfo method)
 Loads the given explicitly grouped kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadKernel< TDelegate > (MethodInfo method, KernelSpecialization specialization)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadKernel< TDelegate > (MethodInfo method, KernelSpecialization specialization, out KernelInfo kernelInfo)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadImplicitlyGroupedKernel< TDelegate > (MethodInfo method, int customGroupSize)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadImplicitlyGroupedKernel< TDelegate > (MethodInfo method, int customGroupSize, out KernelInfo kernelInfo)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadAutoGroupedKernel< TDelegate > (MethodInfo method)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadAutoGroupedKernel< TDelegate > (MethodInfo method, out KernelInfo kernelInfo)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadKernel< TDelegate, TSourceDelegate > (TSourceDelegate methodDelegate, out KernelInfo kernelInfo)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadKernel< TDelegate, TSourceDelegate > (TSourceDelegate methodDelegate, KernelSpecialization specialization, out KernelInfo kernelInfo)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadImplicitlyGroupedKernel< TDelegate, TSourceDelegate > (TSourceDelegate methodDelegate, int customGroupSize)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadImplicitlyGroupedKernel< TDelegate, TSourceDelegate > (TSourceDelegate methodDelegate, int customGroupSize, out KernelInfo kernelInfo)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadAutoGroupedKernel< TDelegate, TSourceDelegate > (TSourceDelegate methodDelegate, out KernelInfo kernelInfo)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
TDelegate LoadAutoGroupedKernel< TDelegate, TSourceDelegate > (TSourceDelegate methodDelegate)
 Loads the given kernel and returns a launcher delegate that can receive arbitrary accelerator streams (first parameter). More...
 
bool HasPeerAccess (Accelerator otherAccelerator)
 Returns true if peer access between the current and the given accelerator has been enabled. More...
 
bool CanAccessPeer (Accelerator otherAccelerator)
 Returns true if the current accelerator can directly access the memory of the given accelerator. More...
 
bool EnablePeerAccess (Accelerator otherAccelerator)
 Enables peer access to the given accelerator. More...
 
bool DisablePeerAccess (Accelerator otherAccelerator)
 Disables peer access to the given accelerator. More...
 

Static Public Attributes

static CPUAcceleratorId CPUAcceleratorId => CPUAcceleratorId.Instance
 Represents the main CPU accelerator. More...
 

Protected Member Functions

override MemoryBuffer< T, TIndex > AllocateInternal< T, TIndex > (TIndex extent)
 
override Kernel LoadKernelInternal (CompiledKernel kernel)
 Loads a default kernel. More...
 
override Kernel LoadImplicitlyGroupedKernelInternal (CompiledKernel kernel, int customGroupSize, out KernelInfo kernelInfo)
 Loads an implicitly grouped kernel. More...
 
override Kernel LoadAutoGroupedKernelInternal (CompiledKernel kernel, out KernelInfo kernelInfo)
 Loads an auto grouped kernel. More...
 
override AcceleratorStream CreateStreamInternal ()
 
override void SynchronizeInternal ()
 
override void OnBind ()
 
override void OnUnbind ()
 
override bool CanAccessPeerInternal (Accelerator otherAccelerator)
 
override void EnablePeerAccessInternal (Accelerator otherAccelerator)
 
override void DisablePeerAccessInternal (Accelerator otherAccelerator)
 
override int EstimateMaxActiveGroupsPerMultiprocessorInternal (Kernel kernel, int groupSize, int dynamicSharedMemorySizeInBytes)
 
override int EstimateGroupSizeInternal (Kernel kernel, Func< int, int > computeSharedMemorySize, int maxGroupSize, out int minGridSize)
 
override int EstimateGroupSizeInternal (Kernel kernel, int dynamicSharedMemorySizeInBytes, int maxGroupSize, out int minGridSize)
 
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from ILGPU.Runtime.Accelerator
void Init (Backend backend)
 Initializes the current accelerator instance. More...
 
void OnAcceleratorCreated ()
 Invoked when the accelerator instance has been created. More...
 
override void Dispose (bool disposing)
 

Properties

static ImmutableArray< CPUAcceleratorIdCPUAccelerators [get]
 Represents all available CPU accelerators. More...
 
int NumThreads [get]
 Returns the number of threads. More...
 
- Properties inherited from ILGPU.Runtime.Accelerator
static ImmutableArray< AcceleratorIdAccelerators [get]
 Represents all available accelerators. More...
 
static AcceleratorType CurrentType [get]
 Returns the current accelerator type. More...
 
Context Context [get]
 Returns the associated ILGPU context. More...
 
AcceleratorStream DefaultStream [get, protected set]
 Returns the default stream of this accelerator. More...
 
AcceleratorType AcceleratorType [get]
 Returns the type of the accelerator. More...
 
long MemorySize [get, protected set]
 Returns the memory size in bytes. More...
 
string Name [get, protected set]
 Returns the name of the device. More...
 
Index3 MaxGridSize [get, protected set]
 Returns the max grid size. More...
 
int MaxNumThreadsPerGroup [get, protected set]
 Returns the maximum number of threads in a group. More...
 
int MaxSharedMemoryPerGroup [get, protected set]
 Returns the maximum number of shared memory per thread group in bytes. More...
 
int MaxConstantMemory [get, protected set]
 Returns the maximum number of constant memory in bytes. More...
 
int WarpSize [get, protected set]
 Return the warp size. More...
 
int NumMultiprocessors [get, protected set]
 Returns the number of available multiprocessors. More...
 
int MaxNumThreadsPerMultiprocessor [get, protected set]
 Returns the maximum number of threads per multiprocessor. More...
 
Backend Backend [get]
 Returns the primary backend of this accelerator. More...
 
int NumberChildObjects [get]
 Returns the number of the registered child objects that depend on this accelerator object. More...
 
static Accelerator Current [get]
 Returns the current group runtime context. More...
 
IReadOnlyCollection< AcceleratorPeerAccelerators [get]
 Returns the accelerators for which the peer access has been enabled. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ILGPU.Runtime.Accelerator
static Accelerator Create (Context context, AcceleratorId acceleratorId)
 Creates the specified accelerator using the provided accelerator id. More...
 
- Public Attributes inherited from ILGPU.Runtime.Accelerator
int MaxThreadsPerGroup => MaxNumThreadsPerGroup
 Returns the maximum number of threads in a group. More...
 
int MaxNumThreads => NumMultiprocessors * MaxNumThreadsPerMultiprocessor
 Returns the maximum number of threads of this accelerator. More...
 
 Index1
 Returns a kernel extent (a grouped index) with the maximum number of groups using the maximum number of threads per group to launch common grid-stride loop kernels. More...
 
MemoryBufferCache MemoryCache => memoryCache
 Returns the default memory-buffer cache that can be used by several operations. More...
 
- Events inherited from ILGPU.Runtime.Accelerator
EventHandler Disposed
 Will be raised if the accelerator is disposed. More...
 

Detailed Description

Represents a general CPU-based runtime for kernels.

Constructor & Destructor Documentation

ILGPU.Runtime.CPU.CPUAccelerator.CPUAccelerator ( Context  context)

Constructs a new CPU runtime.

Parameters
contextThe ILGPU context.
ILGPU.Runtime.CPU.CPUAccelerator.CPUAccelerator ( Context  context,
int  numThreads 
)

Constructs a new CPU runtime.

Parameters
contextThe ILGPU context.
numThreadsThe number of threads for parallel processing.
ILGPU.Runtime.CPU.CPUAccelerator.CPUAccelerator ( Context  context,
int  numThreads,
ThreadPriority  threadPriority 
)

Constructs a new CPU runtime.

Parameters
contextThe ILGPU context.
numThreadsThe number of threads for parallel processing.
threadPriorityThe thread priority of the execution threads.

Member Function Documentation

override MemoryBuffer<T, TIndex> ILGPU.Runtime.CPU.CPUAccelerator.AllocateInternal< T, TIndex > ( TIndex  extent)
protectedvirtual
override bool ILGPU.Runtime.CPU.CPUAccelerator.CanAccessPeerInternal ( Accelerator  otherAccelerator)
protectedvirtual
override TExtension ILGPU.Runtime.CPU.CPUAccelerator.CreateExtension< TExtension, TExtensionProvider > ( TExtensionProvider  provider)
virtual
override AcceleratorStream ILGPU.Runtime.CPU.CPUAccelerator.CreateStreamInternal ( )
protectedvirtual
override void ILGPU.Runtime.CPU.CPUAccelerator.DisablePeerAccessInternal ( Accelerator  otherAccelerator)
protectedvirtual
override void ILGPU.Runtime.CPU.CPUAccelerator.Dispose ( bool  disposing)
protected

override void ILGPU.Runtime.CPU.CPUAccelerator.EnablePeerAccessInternal ( Accelerator  otherAccelerator)
protectedvirtual
override int ILGPU.Runtime.CPU.CPUAccelerator.EstimateGroupSizeInternal ( Kernel  kernel,
Func< int, int >  computeSharedMemorySize,
int  maxGroupSize,
out int  minGridSize 
)
protectedvirtual
override int ILGPU.Runtime.CPU.CPUAccelerator.EstimateGroupSizeInternal ( Kernel  kernel,
int  dynamicSharedMemorySizeInBytes,
int  maxGroupSize,
out int  minGridSize 
)
protectedvirtual
override int ILGPU.Runtime.CPU.CPUAccelerator.EstimateMaxActiveGroupsPerMultiprocessorInternal ( Kernel  kernel,
int  groupSize,
int  dynamicSharedMemorySizeInBytes 
)
protectedvirtual
override Kernel ILGPU.Runtime.CPU.CPUAccelerator.LoadAutoGroupedKernelInternal ( CompiledKernel  kernel,
out KernelInfo  kernelInfo 
)
protectedvirtual

Loads an auto grouped kernel.

Implements ILGPU.Runtime.Accelerator.

override Kernel ILGPU.Runtime.CPU.CPUAccelerator.LoadImplicitlyGroupedKernelInternal ( CompiledKernel  kernel,
int  customGroupSize,
out KernelInfo  kernelInfo 
)
protectedvirtual

Loads an implicitly grouped kernel.

Implements ILGPU.Runtime.Accelerator.

override Kernel ILGPU.Runtime.CPU.CPUAccelerator.LoadKernelInternal ( CompiledKernel  kernel)
protectedvirtual

Loads a default kernel.

Implements ILGPU.Runtime.Accelerator.

override void ILGPU.Runtime.CPU.CPUAccelerator.OnBind ( )
protectedvirtual
override void ILGPU.Runtime.CPU.CPUAccelerator.OnUnbind ( )
protectedvirtual
override void ILGPU.Runtime.CPU.CPUAccelerator.SynchronizeInternal ( )
protectedvirtual

Member Data Documentation

CPUAcceleratorId ILGPU.Runtime.CPU.CPUAccelerator.CPUAcceleratorId => CPUAcceleratorId.Instance
static

Represents the main CPU accelerator.

Property Documentation

ImmutableArray<CPUAcceleratorId> ILGPU.Runtime.CPU.CPUAccelerator.CPUAccelerators
staticget

Represents all available CPU accelerators.

int ILGPU.Runtime.CPU.CPUAccelerator.NumThreads
get

Returns the number of threads.


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