ILGPU  0.9.0
ILGPU.IR.Types.IRTypeContext Class Reference

Represents a context that manages IR types. More...

Inheritance diagram for ILGPU.IR.Types.IRTypeContext:
ILGPU.IR.Types.TypeInformationManager ILGPU.IR.Types.IIRTypeContext ILGPU.Util.DisposeBase ILGPU.ICache

Public Member Functions

 IRTypeContext (Context context)
 Constructs a new IR type context. More...
 
PrimitiveType GetPrimitiveType (BasicValueType basicValueType)
 Resolves the primitive type that corresponds to the given BasicValueType. More...
 
TypeNode GetIndexType (int dimension)
 Creates an intrinsic index type. More...
 
PointerType CreatePointerType (TypeNode elementType, MemoryAddressSpace addressSpace)
 Creates a pointer type. More...
 
ViewType CreateViewType (TypeNode elementType, MemoryAddressSpace addressSpace)
 Creates a view type. More...
 
StructureType.Builder CreateStructureType (int capacity)
 Creates a new structure type builder with the given capacity. More...
 
ArrayType CreateArrayType (TypeNode elementType, int dimension)
 Creates a new array type. More...
 
TypeNode CreateType (Type type)
 Creates a new type based on a type from the .Net world. More...
 
TypeNode CreateType (Type type, MemoryAddressSpace addressSpace)
 Creates a new type based on a type from the .Net world. More...
 
AddressSpaceType SpecializeAddressSpaceType (AddressSpaceType addressSpaceType, MemoryAddressSpace addressSpace)
 Specializes the address space of the given AddressSpaceType. More...
 
bool TrySpecializeAddressSpaceType (TypeNode type, MemoryAddressSpace addressSpace, out TypeNode specializedType)
 Tries to specialize a view or a pointer address space. More...
 
override void ClearCache (ClearCacheMode mode)
 Clears all internal caches. More...
 
- Public Member Functions inherited from ILGPU.IR.Types.TypeInformationManager
 TypeInformationManager ()
 Constructs a new type context. More...
 
TypeInformation GetTypeInfo (Type type)
 Resolves type information for the given type. More...
 
- Public Member Functions inherited from ILGPU.Util.DisposeBase
void Dispose ()
 Triggers the 'dispose' functionality of this object. More...
 

Public Attributes

TypeNode PaddingType => GetPrimitiveType(BasicValueType.Int8)
 Returns a custom padding type that is used to pad structure values. More...
 

Static Public Attributes

static readonly ImmutableArray< BasicValueTypeBasicValueTypes
 Contains all basic value types. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from ILGPU.IR.Types.TypeInformationManager
override void Dispose (bool disposing)
 

Properties

Context Context [get]
 Returns the associated context. More...
 
VoidType VoidType [get]
 Returns the void type. More...
 
StringType StringType [get]
 Returns the memory type. More...
 
HandleType HandleType [get]
 Returns the managed handle type. More...
 
StructureType RootType [get]
 Returns the root structure type. More...
 
- Properties inherited from ILGPU.IR.Types.IIRTypeContext
VoidType VoidType [get]
 Returns the void type. More...
 
StringType StringType [get]
 Returns the memory type. More...
 

Detailed Description

Represents a context that manages IR types.

Constructor & Destructor Documentation

ILGPU.IR.Types.IRTypeContext.IRTypeContext ( Context  context)

Constructs a new IR type context.

Parameters
contextThe associated main context.

Member Function Documentation

override void ILGPU.IR.Types.IRTypeContext.ClearCache ( ClearCacheMode  mode)
virtual

Clears all internal caches.

Parameters
modeThe clear mode.

Reimplemented from ILGPU.IR.Types.TypeInformationManager.

ArrayType ILGPU.IR.Types.IRTypeContext.CreateArrayType ( TypeNode  elementType,
int  dimension 
)

Creates a new array type.

Parameters
elementTypeThe element type.
dimensionThe array dimension.
Returns
The created array type.

Implements ILGPU.IR.Types.IIRTypeContext.

PointerType ILGPU.IR.Types.IRTypeContext.CreatePointerType ( TypeNode  elementType,
MemoryAddressSpace  addressSpace 
)

Creates a pointer type.

Parameters
elementTypeThe pointer element type.
addressSpaceThe address space.
Returns
The created pointer type.

Implements ILGPU.IR.Types.IIRTypeContext.

StructureType.Builder ILGPU.IR.Types.IRTypeContext.CreateStructureType ( int  capacity)

Creates a new structure type builder with the given capacity.

Parameters
capacityThe initial capacity.
Returns
The created structure builder.

Implements ILGPU.IR.Types.IIRTypeContext.

TypeNode ILGPU.IR.Types.IRTypeContext.CreateType ( Type  type)

Creates a new type based on a type from the .Net world.

Parameters
typeThe source type.
Returns
The IR type.

Implements ILGPU.IR.Types.IIRTypeContext.

TypeNode ILGPU.IR.Types.IRTypeContext.CreateType ( Type  type,
MemoryAddressSpace  addressSpace 
)

Creates a new type based on a type from the .Net world.

Parameters
typeThe source type.
addressSpaceThe address space for pointer types.
Returns
The IR type.

Implements ILGPU.IR.Types.IIRTypeContext.

ViewType ILGPU.IR.Types.IRTypeContext.CreateViewType ( TypeNode  elementType,
MemoryAddressSpace  addressSpace 
)

Creates a view type.

Parameters
elementTypeThe view element type.
addressSpaceThe address space.
Returns
The created view type.

Implements ILGPU.IR.Types.IIRTypeContext.

override void ILGPU.IR.Types.IRTypeContext.Dispose ( bool  disposing)
protectedvirtual

Reimplemented from ILGPU.Util.DisposeBase.

TypeNode ILGPU.IR.Types.IRTypeContext.GetIndexType ( int  dimension)

Creates an intrinsic index type.

Parameters
dimensionThe dimension of the index type.
Returns
The created index type.

Implements ILGPU.IR.Types.IIRTypeContext.

PrimitiveType ILGPU.IR.Types.IRTypeContext.GetPrimitiveType ( BasicValueType  basicValueType)

Resolves the primitive type that corresponds to the given BasicValueType.

Parameters
basicValueTypeThe basic value type.
Returns
The created primitive type.

Implements ILGPU.IR.Types.IIRTypeContext.

AddressSpaceType ILGPU.IR.Types.IRTypeContext.SpecializeAddressSpaceType ( AddressSpaceType  addressSpaceType,
MemoryAddressSpace  addressSpace 
)

Specializes the address space of the given AddressSpaceType.

Parameters
addressSpaceTypeThe source type.
addressSpaceThe new address space.
Returns
The created specialized AddressSpaceType.

Implements ILGPU.IR.Types.IIRTypeContext.

bool ILGPU.IR.Types.IRTypeContext.TrySpecializeAddressSpaceType ( TypeNode  type,
MemoryAddressSpace  addressSpace,
out TypeNode  specializedType 
)

Tries to specialize a view or a pointer address space.

Parameters
typeThe pointer or view type.
addressSpaceThe target address space.
specializedTypeThe specialized type.
Returns
True, if the type could be specialized.

Implements ILGPU.IR.Types.IIRTypeContext.

Member Data Documentation

readonly ImmutableArray<BasicValueType> ILGPU.IR.Types.IRTypeContext.BasicValueTypes
static
Initial value:
=
ImmutableArray.Create(
BasicValueType.Float16,
BasicValueType.Float32,
BasicValueType.Float64)

Contains all basic value types.

TypeNode ILGPU.IR.Types.IRTypeContext.PaddingType => GetPrimitiveType(BasicValueType.Int8)

Returns a custom padding type that is used to pad structure values.

Property Documentation

Context ILGPU.IR.Types.IRTypeContext.Context
get

Returns the associated context.

HandleType ILGPU.IR.Types.IRTypeContext.HandleType
get

Returns the managed handle type.

StructureType ILGPU.IR.Types.IRTypeContext.RootType
get

Returns the root structure type.

StringType ILGPU.IR.Types.IRTypeContext.StringType
get

Returns the memory type.

VoidType ILGPU.IR.Types.IRTypeContext.VoidType
get

Returns the void type.


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