ILGPU  0.9.0
ILGPU.Backends.OpenCL.CLTypeGenerator Class Reference

Generates internal OpenCL type structures that are used inside kernels. More...

Inheritance diagram for ILGPU.Backends.OpenCL.CLTypeGenerator:
ILGPU.Util.DisposeBase ILGPU.Backends.OpenCL.ICLTypeGenerator

Public Member Functions

void GenerateTypeDeclarations (StringBuilder builder)
 Generate all forward type declarations. More...
 
void GenerateTypeDefinitions (StringBuilder builder)
 Generate all type definitions. More...
 
void GenerateStructureDefinition (StructureType structureType, string typeName, StringBuilder builder)
 Generates a new structure definition in OpenCL format. More...
 
- Public Member Functions inherited from ILGPU.Util.DisposeBase
void Dispose ()
 Triggers the 'dispose' functionality of this object. More...
 

Static Public Member Functions

static string GetBasicValueType (BasicValueType basicValueType)
 Resolves the given basic-value type to an OpenCL type name. More...
 
static string GetBasicValueType (ArithmeticBasicValueType basicValueType)
 Resolves the given basic-value type to an OpenCL type name. More...
 
static string GetAtomicType (ArithmeticBasicValueType basicValueType)
 Resolves the given basic-value type to an atomic OpenCL type name. More...
 
static string GetTypeName (TypeNode typeNode)
 Resolves a unique type name for the given node. More...
 
static string GetFieldName (int fieldIndex)
 Resolves a unique field name for the field index. More...
 

Public Attributes

string this[Type type] => this[TypeContext.CreateType(type)]
 Returns the associated OpenCL type name. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 

Properties

IRTypeContext TypeContext [get]
 Returns the underlying type context. More...
 
string this[TypeNode typeNode] [get]
 Returns the associated OpenCL type name. More...
 

Detailed Description

Generates internal OpenCL type structures that are used inside kernels.

Member Function Documentation

override void ILGPU.Backends.OpenCL.CLTypeGenerator.Dispose ( bool  disposing)
protectedvirtual

Reimplemented from ILGPU.Util.DisposeBase.

void ILGPU.Backends.OpenCL.CLTypeGenerator.GenerateStructureDefinition ( StructureType  structureType,
string  typeName,
StringBuilder  builder 
)

Generates a new structure definition in OpenCL format.

Parameters
structureTypeThe structure type.
typeNameThe type name.
builderThe target builder to write to.
void ILGPU.Backends.OpenCL.CLTypeGenerator.GenerateTypeDeclarations ( StringBuilder  builder)

Generate all forward type declarations.

Parameters
builderThe target builder.

Implements ILGPU.Backends.OpenCL.ICLTypeGenerator.

void ILGPU.Backends.OpenCL.CLTypeGenerator.GenerateTypeDefinitions ( StringBuilder  builder)

Generate all type definitions.

Parameters
builderThe target builder.

Implements ILGPU.Backends.OpenCL.ICLTypeGenerator.

static string ILGPU.Backends.OpenCL.CLTypeGenerator.GetAtomicType ( ArithmeticBasicValueType  basicValueType)
static

Resolves the given basic-value type to an atomic OpenCL type name.

Parameters
basicValueTypeThe basic-value type to resolve.
Returns
The resolved atomic OpenCL type name.
static string ILGPU.Backends.OpenCL.CLTypeGenerator.GetBasicValueType ( BasicValueType  basicValueType)
static

Resolves the given basic-value type to an OpenCL type name.

Parameters
basicValueTypeThe basic-value type to resolve.
Returns
The resolved OpenCL type name.
static string ILGPU.Backends.OpenCL.CLTypeGenerator.GetBasicValueType ( ArithmeticBasicValueType  basicValueType)
static

Resolves the given basic-value type to an OpenCL type name.

Parameters
basicValueTypeThe basic-value type to resolve.
Returns
The resolved OpenCL type name.
static string ILGPU.Backends.OpenCL.CLTypeGenerator.GetFieldName ( int  fieldIndex)
static

Resolves a unique field name for the field index.

Parameters
fieldIndexThe field index.
Returns
The unique field name.
static string ILGPU.Backends.OpenCL.CLTypeGenerator.GetTypeName ( TypeNode  typeNode)
static

Resolves a unique type name for the given node.

Parameters
typeNodeThe type node.
Returns
The unique type name.

Member Data Documentation

string ILGPU.Backends.OpenCL.CLTypeGenerator.this[Type type] => this[TypeContext.CreateType(type)]

Returns the associated OpenCL type name.

Parameters
typeThe managed type to use.
Returns
The resolved OpenCL type name.

Property Documentation

string ILGPU.Backends.OpenCL.CLTypeGenerator.this[TypeNode typeNode]
get

Returns the associated OpenCL type name.

Parameters
typeNodeThe internal IR type node.
Returns
The resolved OpenCL type name.
IRTypeContext ILGPU.Backends.OpenCL.CLTypeGenerator.TypeContext
get

Returns the underlying type context.


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