CLRX  1
An unofficial OpenCL extensions designed for Radeon GPUs
Classes | Typedefs | Enumerations | Functions
CLRX Namespace Reference

main namespace More...

Classes

struct  AmdCL2DisasmInput
 whole disassembler input (for AMD Catalyst driver GPU binaries) More...
 
struct  AmdCL2DisasmKernelInput
 single kernel input for disassembler More...
 
class  AmdCL2GPUBinGenerator
 main AMD OpenCL2.0 GPU Binary generator More...
 
struct  AmdCL2GPUKernel
 AMD OpenCL 2.0 GPU metadata for kernel. More...
 
struct  AmdCL2GPUKernelArgEntry32
 GPU kernel argument entry. More...
 
struct  AmdCL2GPUKernelArgEntry64
 GPU kernel argument entry. More...
 
struct  AmdCL2GPUKernelMetadata
 AMD OpenCL 2.0 GPU metadata for kernel. More...
 
struct  AmdCL2GPUKernelStub
 AMD OpenCL 2.0 GPU kernel stub. More...
 
struct  AmdCL2GPUMetadataHeader32
 header for metadata More...
 
struct  AmdCL2GPUMetadataHeader64
 header for metadata More...
 
class  AmdCL2InnerGPUBinary
 AMD OpenCL 2.0 inner binary for GPU binaries that represent a single kernel. More...
 
class  AmdCL2InnerGPUBinaryBase
 AMD OpenCL 2.0 inner binary base class. More...
 
struct  AmdCL2Input
 main Input for AmdCL2GPUBinGenerator More...
 
struct  AmdCL2KernelConfig
 kernel configuration More...
 
struct  AmdCL2KernelInput
 AMD kernel input. More...
 
class  AmdCL2MainGPUBinary32
 AMD OpenCL 2.0 main binary for GPU for 32-bit mode. More...
 
class  AmdCL2MainGPUBinary64
 AMD OpenCL 2.0 main binary for GPU for 64-bit mode. More...
 
class  AmdCL2MainGPUBinaryBase
 base class of AMD OpenCL 2.0 binaries More...
 
class  AmdCL2OldInnerGPUBinary
 AMD OpenCL 2.0 old inner binary for GPU binaries that represent a single kernel. More...
 
struct  AmdCL2RelaEntry
 relocation with addend More...
 
struct  AmdCL2RelInput
 AMD CL2 Relocation entry input. More...
 
struct  AmdDisasmInput
 whole disassembler input (for AMD Catalyst driver GPU binaries) More...
 
struct  AmdDisasmKernelInput
 single kernel input for disassembler More...
 
struct  AMDGPUArchVersion
 structure helper for AMDGPU architecture version More...
 
class  AmdGPUBinGenerator
 main AMD GPU Binary generator More...
 
struct  AmdGPUKernelHeader
 AMD GPU header for kernel. More...
 
struct  AmdGPUKernelMetadata
 AMD GPU metadata for kernel. More...
 
struct  AmdHsaKernelConfig
 AMD HSA kernel configuration structure. More...
 
class  AmdInnerGPUBinary32
 AMD inner binary for GPU binaries that represent a single kernel. More...
 
class  AmdInnerX86Binary32
 AMD inner X86 binary. More...
 
class  AmdInnerX86Binary64
 AMD inner binary for X86-64 binaries. More...
 
struct  AmdInput
 main Input for AmdGPUBinGenerator More...
 
struct  AmdKernelArg
 kernel argument info structure More...
 
struct  AmdKernelArgInput
 AMD OpenCL kernel argument description. More...
 
struct  AmdKernelConfig
 kernel configuration More...
 
struct  AmdKernelInput
 AMD kernel input. More...
 
class  AmdMainBinaryBase
 main AMD binary base class More...
 
class  AmdMainGPUBinary32
 AMD main binary for GPU for 32-bit mode. More...
 
class  AmdMainGPUBinary64
 AMD main binary for GPU for 64-bit mode. More...
 
class  AmdMainGPUBinaryBase
 main AMD GPU binary base class More...
 
class  AmdMainX86Binary32
 AMD main binary for X86 systems. More...
 
class  AmdMainX86Binary64
 AMD main binary for X86-64 systems. More...
 
struct  AmdUserData
 user data for in CAL PROGINFO More...
 
class  Array
 an array class More...
 
class  ArrayIOStream
 specialized input/output stream that holds external array for memory saving More...
 
class  ArrayIStream
 specialized input stream that holds external array for memory saving More...
 
class  ArrayOStream
 specialized output stream that holds external array for memory saving More...
 
class  ArrayStreamBuf
 array stream buffer that holds external static array for memory saving More...
 
class  AsmAmdCL2Handler
 handles AMD OpenCL 2.0 binary format More...
 
class  AsmAmdHandler
 handles AMD Catalyst format More...
 
struct  AsmAmdHsaKernelConfig
 Asm AMD HSA kernel configuration. More...
 
struct  AsmClause
 assembler's clause (if,else,macro,rept) More...
 
struct  AsmCodeFlowEntry
 code flow entry More...
 
class  AsmException
 Assembler exception class. More...
 
union  AsmExprArg
 assembler expression argument More...
 
class  AsmExpression
 assembler expression class More...
 
struct  AsmExprSymbolOccurrence
 assembler symbol occurrence in expression More...
 
struct  AsmExprTarget
 target for assembler expression More...
 
struct  AsmFile
 descriptor of file inclusion More...
 
class  AsmFormatException
 assembler format exception More...
 
class  AsmFormatHandler
 assdembler format handler More...
 
class  AsmGalliumHandler
 handles GalliumCompute format More...
 
class  AsmInputFilter
 assembler input filter for reading lines More...
 
class  AsmIRP
 assembler IRP More...
 
class  AsmIRPInputFilter
 assembler IRP pseudo-op input filter More...
 
struct  AsmKernel
 kernel entry structure More...
 
class  AsmMacro
 assembler macro More...
 
struct  AsmMacroArg
 assembler macro aegument More...
 
class  AsmMacroInputFilter
 assembler macro input filter (for macro filtering) More...
 
struct  AsmMacroSource
 descriptor of macro source (used in source fields) More...
 
struct  AsmMacroSubst
 descriptor assembler macro substitution More...
 
class  AsmRawCodeHandler
 handles raw code format More...
 
class  AsmRegAllocator
 
struct  AsmRegUsage2Int
 internal structure for regusage More...
 
struct  AsmRegUsageInt
 internal structure for regusage More...
 
struct  AsmRegVar
 Regvar info structure. More...
 
struct  AsmRegVarUsage
 regvar usage in code More...
 
struct  AsmRegVarUsageInt
 regvar usage (internal) More...
 
struct  AsmRelocation
 assembler relocation More...
 
class  AsmRepeat
 assembler repeat More...
 
class  AsmRepeatInputFilter
 assembler repeat input filter More...
 
struct  AsmRepeatSource
 descriptor of assembler repetition More...
 
class  AsmROCmHandler
 handles ROCM binary format More...
 
struct  AsmScope
 assembler scope for symbol, macros, regvars More...
 
struct  AsmSection
 assembler section More...
 
struct  AsmSingleVReg
 single regvar id More...
 
struct  AsmSource
 descriptor of assembler source for source position More...
 
struct  AsmSourcePos
 assembler source position More...
 
class  AsmStreamInputFilter
 assembler input layout filter More...
 
struct  AsmSymbol
 assembler symbol structure More...
 
class  Assembler
 main class of assembler More...
 
class  BinException
 Bin exception class. More...
 
class  BinGenException
 Binary generator exception class. More...
 
struct  BinSection
 section structure to external usage (for example in the binary generator input) More...
 
struct  BinSymbol
 symbol structure to external usage (fo example in the binary generator input) More...
 
struct  CALConstantBufferMask
 There are not copied (ULEV must be used) More...
 
struct  CALDataSegmentEntry
 There are not copied (ULEV must be used) More...
 
struct  CALEncodingEntry
 CALEncodingEntry. There are not copied (ULEV must be used) More...
 
struct  CALNote
 ATI CAL note. There are not copied (ULEV must be used) More...
 
struct  CALNoteHeader
 ATI CAL Note header. There are not copied (ULEV must be used) More...
 
struct  CALNoteInput
 ATI CAL note input. More...
 
struct  CALProgramInfoEntry
 CAL program info entry. There are not copied (ULEV must be used) More...
 
struct  CALSamplerMapEntry
 There are not copied (ULEV must be used) More...
 
struct  CALUAVEntry
 There are not copied (ULEV must be used) More...
 
struct  CLAsmSetup
 structure that holds assembler setup for OpenCL programs More...
 
class  CLError
 error class based on std::exception More...
 
class  CLIException
 CLI exception class. More...
 
struct  CLIOption
 Command line option description. More...
 
class  CLIParser
 The Command Line Parser (parses options and their arguments) More...
 
class  CString
 simple C-string container More...
 
struct  CStringCaseLess
 function class that returns true if first C string is less than second (ignore case) More...
 
struct  CStringEqual
 function class that returns true if C strings are equal More...
 
struct  CStringHash
 generate hash function for C string More...
 
struct  CStringLess
 function class that returns true if first C string is less than second More...
 
class  DisasmException
 Disassembler exception class. More...
 
class  Disassembler
 disassembler class More...
 
class  DynLibrary
 dynamic library class More...
 
struct  Elf32Types
 ELF 32-bit types. More...
 
struct  Elf64Types
 ELF 32-bit types. More...
 
class  ElfBinaryGenTemplate
 ELF binary generator. More...
 
class  ElfBinaryTemplate
 ELF binary class. More...
 
struct  ElfHeaderTemplate
 elf header template More...
 
struct  ElfNote
 ELF note structure. More...
 
struct  ElfProgramHeaderTemplate
 template of ELF program header More...
 
class  ElfRegionContent
 elf region content generator for elf region More...
 
struct  ElfRegionTemplate
 template of ElfRegion More...
 
struct  ElfSymbolTemplate
 ELF symbol template. More...
 
class  Exception
 exception class More...
 
class  FastInputBuffer
 fast input buffer adapter More...
 
class  FastOutputBuffer
 fast and direct output buffer More...
 
class  FastRefCountable
 reference countable object (only for single threading usage) More...
 
struct  GalliumArgInfo
 kernel argument (Gallium binaries) More...
 
class  GalliumBinary
 
class  GalliumBinGenerator
 gallium code binary generator More...
 
struct  GalliumDisasmInput
 whole disassembler input (for Gallium driver GPU binaries) More...
 
struct  GalliumDisasmKernelInput
 disasm kernel info structure (Gallium binaries) More...
 
class  GalliumElfBinary32
 32-bit Gallium ELF binary More...
 
class  GalliumElfBinary64
 64-bit Gallium ELF binary More...
 
class  GalliumElfBinaryBase
 Gallium elf binary base (for 32-bit and 64-bit) More...
 
struct  GalliumInput
 Gallium input. More...
 
struct  GalliumKernel
 kernel info structure (Gallium binaries) More...
 
struct  GalliumKernelConfig
 kernel config More...
 
struct  GalliumKernelInput
 kernel info structure (Gallium binaries) More...
 
struct  GalliumProgInfoEntry
 kernel program info entry for Gallium binaries More...
 
struct  GalliumSection
 Gallium binarie's Section. More...
 
class  GCNAssembler
 GCN arch assembler. More...
 
class  GCNDisassembler
 GCN architectur dissassembler. More...
 
class  GCNUsageHandler
 GCN (register and regvar) Usage handler. More...
 
class  GPUIdException
 GPUId exception class. More...
 
class  ISAAssembler
 ISA assembler class. More...
 
class  ISADisassembler
 main class for More...
 
class  ISAUsageHandler
 ISA (register and regvar) Usage handler. More...
 
struct  KernelInfo
 kernel informations More...
 
struct  LineCol
 line and column More...
 
struct  LineTrans
 line translations More...
 
class  MemoryStreamBuf
 memory stream buffer More...
 
struct  NonCopyableAndNonMovable
 non copyable and non movable base structure (class) More...
 
class  ParseException
 parse exception class More...
 
struct  RawCodeInput
 disassembler input for raw code More...
 
class  RefCountable
 reference countable object More...
 
class  RefPtr
 reference pointer based on Glibmm refptr More...
 
class  ROCmBinary
 ROCm main binary for GPU for 64-bit mode. More...
 
class  ROCmBinGenerator
 ROCm binary generator. More...
 
struct  ROCmDisasmInput
 disasm ROCm input More...
 
struct  ROCmDisasmKernelInput
 disasm ROCm kernel input More...
 
struct  ROCmDisasmRegionInput
 disasm ROCm region More...
 
struct  ROCmInput
 ROCm binary input structure. More...
 
struct  ROCmRegion
 ROCm data region. More...
 
struct  ROCmSymbolInput
 ROCm binary symbol input. More...
 
class  StringIOStream
 specialized input/output stream that holds external string for memory saving More...
 
class  StringIStream
 specialized input stream that holds external string for memory saving More...
 
class  StringOStream
 specialized output stream that holds external string for memory saving More...
 
class  StringStreamBuf
 string stream buffer that holds external string for memory saving More...
 
struct  UInt128
 Unsigned 128-bit integer. More...
 
class  VectorIOStream
 specialized input/output stream that holds external char-vector for memory saving More...
 
class  VectorIStream
 specialized input stream that holds external char-vector for memory saving More...
 
class  VectorOStream
 specialized output stream that holds external char-vector for memory saving More...
 
class  VectorStreamBuf
 vector char stream buffer external char-vector for memory saving More...
 
struct  X86_64KernelArgSym
 X86_64 kernel argument symbol. More...
 
struct  X86KernelArgSym
 X86_64 kernel argument symbol. More...
 

Typedefs

typedef cxbyte AsmExprTargetType
 expression target type (one byte)
 
typedef std::unordered_map< CString, AsmSymbolAsmSymbolMap
 assembler symbol map
 
typedef AsmSymbolMap::value_type AsmSymbolEntry
 assembler symbol entry
 
typedef cxbyte AsmRegField
 type of register field
 
typedef std::unordered_map< CString, AsmRegVarAsmRegVarMap
 regvar map
 
typedef AsmRegVarMap::value_type AsmRegVarEntry
 regvar entry
 
typedef std::unordered_map< CString, RefPtr< const AsmMacro > > AsmMacroMap
 assembler macro map
 
typedef std::unordered_map< CString, AsmScope * > AsmScopeMap
 type definition of scope's map
 
typedef AsmAmdHsaKernelConfig AsmROCmKernelConfig
 
typedef cxuint RelocType
 relocation type
 
typedef class ElfBinaryTemplate< Elf32TypesElfBinary32
 type for 32-bit ELF binary
 
typedef class ElfBinaryTemplate< Elf64TypesElfBinary64
 type for 64-bit ELF binary
 
typedef ElfHeaderTemplate< Elf32TypesElfHeader32
 32-bit elf header
 
typedef ElfHeaderTemplate< Elf64TypesElfHeader64
 64-bit elf header
 
typedef ElfRegionTemplate< Elf32TypesElfRegion32
 32-bit region (for 32-bit elf)
 
typedef ElfRegionTemplate< Elf64TypesElfRegion64
 64-bit region (for 64-bit elf)
 
typedef ElfProgramHeaderTemplate< Elf32TypesElfProgramHeader32
 32-bit elf program header
 
typedef ElfProgramHeaderTemplate< Elf64TypesElfProgramHeader64
 64-bit elf program header
 
typedef ElfSymbolTemplate< Elf32TypesElfSymbol32
 32-bit elf symbol
 
typedef ElfSymbolTemplate< Elf64TypesElfSymbol64
 64-bit elf symbol
 
typedef class ElfBinaryGenTemplate< Elf32TypesElfBinaryGen32
 type for 32-bit ELF binary generator
 
typedef class ElfBinaryGenTemplate< Elf64TypesElfBinaryGen64
 type for 64-bit ELF binary generator
 
typedef AmdHsaKernelConfig ROCmKernelConfig
 ROCm kernel configuration structure.
 
typedef uint64_t LineNo
 line number type
 
typedef size_t ColNo
 column number type
 
typedef uint32_t Flags
 type for declaring various flags
 
typedef std::once_flag OnceFlag
 Once flag type (wrapper for std::once_flag)
 

Enumerations

enum  : cxbyte { WS_UNSIGNED = 0, WS_BOTH = 1 }
 
enum  : AsmExprTargetType {
  ASMXTGT_SYMBOL = 0, ASMXTGT_DATA8, ASMXTGT_DATA16, ASMXTGT_DATA32,
  ASMXTGT_DATA64, ASMXTGT_CODEFLOW, GCNTGT_LITIMM = 16, GCNTGT_SOPKSIMM16,
  GCNTGT_SOPJMP, GCNTGT_SMRDOFFSET, GCNTGT_DSOFFSET16, GCNTGT_DSOFFSET8_0,
  GCNTGT_DSOFFSET8_1, GCNTGT_MXBUFOFFSET, GCNTGT_SMEMOFFSET, GCNTGT_SOPCIMM8,
  GCNTGT_SMEMIMM, GCNTGT_SMEMOFFSETVEGA, GCNTGT_INSTOFFSET, GCNTGT_INSTOFFSET_S
}
 
enum  AsmExprOp : cxbyte {
  AsmExprOp::ARG_VALUE = 0, AsmExprOp::ARG_SYMBOL = 1, AsmExprOp::NEGATE = 2, AsmExprOp::BIT_NOT,
  AsmExprOp::LOGICAL_NOT, AsmExprOp::PLUS, AsmExprOp::ADDITION, AsmExprOp::SUBTRACT,
  AsmExprOp::MULTIPLY, AsmExprOp::DIVISION, AsmExprOp::SIGNED_DIVISION, AsmExprOp::MODULO,
  AsmExprOp::SIGNED_MODULO, AsmExprOp::BIT_AND, BIT_OR, AsmExprOp::BIT_XOR,
  AsmExprOp::BIT_ORNOT, AsmExprOp::SHIFT_LEFT, AsmExprOp::SHIFT_RIGHT, AsmExprOp::SIGNED_SHIFT_RIGHT,
  AsmExprOp::LOGICAL_AND, AsmExprOp::LOGICAL_OR, AsmExprOp::EQUAL, AsmExprOp::NOT_EQUAL,
  AsmExprOp::LESS, AsmExprOp::LESS_EQ, AsmExprOp::GREATER, AsmExprOp::GREATER_EQ,
  AsmExprOp::BELOW, AsmExprOp::BELOW_EQ, AsmExprOp::ABOVE, AsmExprOp::ABOVE_EQ,
  AsmExprOp::CHOICE, AsmExprOp::CHOICE_START, FIRST_ARG = ARG_VALUE, LAST_ARG = ARG_SYMBOL,
  AsmExprOp::FIRST_UNARY = NEGATE, AsmExprOp::LAST_UNARY = PLUS, AsmExprOp::FIRST_BINARY = ADDITION, AsmExprOp::LAST_BINARY = ABOVE_EQ,
  AsmExprOp::NONE = 0xff
}
 assembler expression operator More...
 
enum  : AsmRegField {
  ASMFIELD_NONE = 0, GCNFIELD_SSRC0, GCNFIELD_SSRC1, GCNFIELD_SDST,
  GCNFIELD_SMRD_SBASE, GCNFIELD_SMRD_SDST, GCNFIELD_SMRD_SDSTH, GCNFIELD_SMRD_SOFFSET,
  GCNFIELD_VOP_SRC0, GCNFIELD_VOP_VSRC1, GCNFIELD_VOP_SSRC1, GCNFIELD_VOP_VDST,
  GCNFIELD_VOP_SDST, GCNFIELD_VOP3_SRC0, GCNFIELD_VOP3_SRC1, GCNFIELD_VOP3_SRC2,
  GCNFIELD_VOP3_VDST, GCNFIELD_VOP3_SDST0, GCNFIELD_VOP3_SSRC, GCNFIELD_VOP3_SDST1,
  GCNFIELD_VINTRP_VSRC0, GCNFIELD_VINTRP_VDST, GCNFIELD_DS_ADDR, GCNFIELD_DS_DATA0,
  GCNFIELD_DS_DATA1, GCNFIELD_DS_VDST, GCNFIELD_M_VADDR, GCNFIELD_M_VDATA,
  GCNFIELD_M_VDATAH, GCNFIELD_M_VDATALAST, GCNFIELD_M_SRSRC, GCNFIELD_MIMG_SSAMP,
  GCNFIELD_M_SOFFSET, GCNFIELD_EXP_VSRC0, GCNFIELD_EXP_VSRC1, GCNFIELD_EXP_VSRC2,
  GCNFIELD_EXP_VSRC3, GCNFIELD_FLAT_ADDR, GCNFIELD_FLAT_DATA, GCNFIELD_FLAT_VDST,
  GCNFIELD_FLAT_VDSTLAST, GCNFIELD_DPPSDWA_SRC0, GCNFIELD_DPPSDWA_SSRC0, GCNFIELD_FLAT_SADDR
}
 
enum  : cxbyte {
  ASMRVU_READ = 1, ASMRVU_WRITE = 2, ASMRVU_ACCESS_MASK = 3, ASMRVU_REGTYPE_MASK = 4,
  ASMRVU_REGSIZE_SHIFT = 3, ASMRVU_REGSIZE_MASK = 0x78
}
 
enum  AsmCodeFlowType {
  JUMP = 0, CJUMP, CALL, RETURN,
  START, END
}
 code flow type More...
 
enum  AsmSectionType : cxbyte {
  DATA = 0, AsmSectionType::CODE, AsmSectionType::CONFIG, AsmSectionType::LAST_COMMON = CONFIG,
  AsmSectionType::AMD_HEADER = LAST_COMMON+1, AsmSectionType::AMD_METADATA, AsmSectionType::AMD_CALNOTE, AMDCL2_RWDATA = LAST_COMMON+1,
  AMDCL2_BSS, AMDCL2_SAMPLERINIT, AMDCL2_SETUP, AMDCL2_STUB,
  AMDCL2_METADATA, AMDCL2_ISAMETADATA, AMDCL2_CONFIG_CTRL_DIRECTIVE, AsmSectionType::GALLIUM_COMMENT = LAST_COMMON+1,
  GALLIUM_CONFIG_CTRL_DIRECTIVE, AsmSectionType::ROCM_COMMENT = LAST_COMMON+1, ROCM_CONFIG_CTRL_DIRECTIVE, EXTRA_FIRST = 0xfc,
  EXTRA_PROGBITS = 0xfc, EXTRA_NOBITS = 0xfd, EXTRA_NOTE = 0xfe, EXTRA_SECTION = 0xff
}
 assembler section type More...
 
enum  : cxuint { ASMSECT_ABS = UINT_MAX, ASMSECT_NONE = UINT_MAX, ASMKERN_GLOBAL = UINT_MAX, ASMKERN_INNER = UINT_MAX-1 }
 
enum  : Flags {
  ASMSECT_WRITEABLE = 1, ASMSECT_ADDRESSABLE = 2, ASMSECT_ABS_ADDRESSABLE = 4, ASMSECT_UNRESOLVABLE = 8,
  ASMELFSECT_ALLOCATABLE = 0x10, ASMELFSECT_WRITEABLE = 0x20, ASMELFSECT_EXECUTABLE = 0x40
}
 
enum  AsmSourceType : cxbyte { AsmSourceType::FILE, AsmSourceType::MACRO, AsmSourceType::REPT }
 source type More...
 
enum  AsmInputFilterType { AsmInputFilterType::STREAM = 0, AsmInputFilterType::REPEAT, AsmInputFilterType::MACROSUBST }
 type of AsmInputFilter More...
 
enum  : Flags {
  ASM_WARNINGS = 1, ASM_FORCE_ADD_SYMBOLS = 2, ASM_ALTMACRO = 4, ASM_BUGGYFPLIT = 8,
  ASM_MACRONOCASE = 16, ASM_OLDMODPARAM = 32, ASM_TESTRUN = (1U<<31), ASM_ALL
}
 
enum  AsmClauseType {
  AsmClauseType::IF, AsmClauseType::ELSEIF, AsmClauseType::ELSE, AsmClauseType::REPEAT,
  AsmClauseType::MACRO
}
 type of clause More...
 
enum  BinaryFormat {
  BinaryFormat::AMD = 0, BinaryFormat::GALLIUM, BinaryFormat::RAWCODE, BinaryFormat::AMDCL2,
  BinaryFormat::ROCM
}
 binary for Disassembler More...
 
enum  : Flags {
  DISASM_DUMPCODE = 1, DISASM_METADATA = 2, DISASM_DUMPDATA = 4, DISASM_CALNOTES = 8,
  DISASM_FLOATLITS = 16, DISASM_HEXCODE = 32, DISASM_SETUP = 64, DISASM_CONFIG = 128,
  DISASM_BUGGYFPLIT = 0x100, DISASM_CODEPOS = 0x200, DISASM_HSACONFIG = 0x400, DISASM_ALL = FLAGS_ALL&(~(DISASM_CONFIG|DISASM_BUGGYFPLIT|DISASM_HSACONFIG))
}
 
enum  : Flags {
  AMDBIN_INNER_INT_CREATE_ALL = 0xff, AMDBIN_CREATE_CALNOTES = 0x10, AMDBIN_CREATE_KERNELINFO = 0x10, AMDBIN_CREATE_KERNELINFOMAP = 0x20,
  AMDBIN_CREATE_INNERBINMAP = 0x40, AMDBIN_CREATE_INFOSTRINGS = 0x80, AMDBIN_CREATE_KERNELHEADERS = 0x100, AMDBIN_CREATE_KERNELHEADERMAP = 0x200,
  AMDBIN_INNER_CREATE_SECTIONMAP = 0x1000, AMDBIN_INNER_CREATE_SYMBOLMAP = 0x2000, AMDBIN_INNER_CREATE_DYNSYMMAP = 0x4000, AMDBIN_INNER_CREATE_CALNOTES = 0x10000,
  AMDBIN_CREATE_ALL = ELF_CREATE_ALL | 0xffff0, AMDBIN_INNER_SHIFT = 12
}
 
enum  : cxuint { ELF_M_X86 = 0x7d4 }
 
enum  KernelArgType : cxbyte {
  VOID = 0, UCHAR, CHAR, USHORT,
  SHORT, UINT, INT, ULONG,
  LONG, FLOAT, DOUBLE, POINTER,
  IMAGE, IMAGE1D, IMAGE1D_ARRAY, IMAGE1D_BUFFER,
  IMAGE2D, IMAGE2D_ARRAY, IMAGE3D, UCHAR2,
  UCHAR3, UCHAR4, UCHAR8, UCHAR16,
  CHAR2, CHAR3, CHAR4, CHAR8,
  CHAR16, USHORT2, USHORT3, USHORT4,
  USHORT8, USHORT16, SHORT2, SHORT3,
  SHORT4, SHORT8, SHORT16, UINT2,
  UINT3, UINT4, UINT8, UINT16,
  INT2, INT3, INT4, INT8,
  INT16, ULONG2, ULONG3, ULONG4,
  ULONG8, ULONG16, LONG2, LONG3,
  LONG4, LONG8, LONG16, FLOAT2,
  FLOAT3, FLOAT4, FLOAT8, FLOAT16,
  DOUBLE2, DOUBLE3, DOUBLE4, DOUBLE8,
  DOUBLE16, SAMPLER, STRUCTURE, COUNTER32,
  COUNTER64, PIPE, CMDQUEUE, CLKEVENT,
  MAX_VALUE = COUNTER64, MAX_VALUE_CL2 = CLKEVENT, MIN_IMAGE = IMAGE, MAX_IMAGE = IMAGE3D
}
 kernel argument type
 
enum  KernelPtrSpace : cxbyte {
  KernelPtrSpace::NONE = 0, KernelPtrSpace::LOCAL, KernelPtrSpace::CONSTANT, KernelPtrSpace::GLOBAL,
  MAX_VALUE = GLOBAL
}
 kernel pointer type of argument More...
 
enum  : cxbyte {
  KARG_PTR_NORMAL = 0, KARG_PTR_READ_ONLY = 1, KARG_PTR_WRITE_ONLY = 2, KARG_PTR_READ_WRITE = 3,
  KARG_PTR_ACCESS_MASK = 3, KARG_PTR_CONST = 4, KARG_PTR_RESTRICT = 8, KARG_PTR_VOLATILE = 16
}
 
enum  : uint32_t {
  CALNOTE_ATI_PROGINFO = 1, CALNOTE_ATI_INPUTS = 2, CALNOTE_ATI_OUTPUTS = 3, CALNOTE_ATI_CONDOUT = 4,
  CALNOTE_ATI_FLOAT32CONSTS = 5, CALNOTE_ATI_INT32CONSTS = 6, CALNOTE_ATI_BOOL32CONSTS = 7, CALNOTE_ATI_EARLYEXIT = 8,
  CALNOTE_ATI_GLOBAL_BUFFERS = 9, CALNOTE_ATI_CONSTANT_BUFFERS = 10, CALNOTE_ATI_INPUT_SAMPLERS = 11, CALNOTE_ATI_PERSISTENT_BUFFERS = 12,
  CALNOTE_ATI_SCRATCH_BUFFERS = 13, CALNOTE_ATI_SUB_CONSTANT_BUFFERS = 14, CALNOTE_ATI_UAV_MAILBOX_SIZE = 15, CALNOTE_ATI_UAV = 16,
  CALNOTE_ATI_UAV_OP_MASK = 17, CALNOTE_ATI_MAXTYPE = CALNOTE_ATI_UAV_OP_MASK
}
 
enum  AmdMainType {
  AmdMainType::GPU_BINARY, AmdMainType::GPU_64_BINARY, AmdMainType::X86_BINARY, AmdMainType::X86_64_BINARY,
  AmdMainType::GPU_CL2_BINARY, AmdMainType::GPU_CL2_64_BINARY
}
 AMD main binary type. More...
 
enum  : Flags {
  AMDCL2BIN_CREATE_KERNELDATA = 0x10, AMDCL2BIN_CREATE_KERNELDATAMAP = 0x20, AMDCL2BIN_CREATE_KERNELSTUBS = 0x40, AMDCL2BIN_INNER_CREATE_KERNELDATA = 0x10000,
  AMDCL2BIN_INNER_CREATE_KERNELDATAMAP = 0x20000, AMDCL2BIN_INNER_CREATE_KERNELSTUBS = 0x40000
}
 
enum  : cxbyte { AMDCL2_ARGUSED_NOTUSED = 0, AMDCL2_ARGUSED_READ = 1, AMDCL2_ARGUSED_WRITE = 2, AMDCL2_ARGUSED_READ_WRITE = 3 }
 
enum  : cxuint {
  AMDCL2SECTID_SAMPLERINIT = ELFSECTID_OTHER_BUILTIN, AMDCL2SECTID_TEXTRELA, AMDCL2SECTID_RODATARELA, AMDCL2SECTID_NOTE,
  AMDCL2SECTID_MAX = AMDCL2SECTID_NOTE
}
 
enum  { RELTYPE_VALUE = 0, RELTYPE_LOW_32BIT, RELTYPE_HIGH_32BIT }
 
enum  {
  AMDHSAFLAG_USE_PRIVATE_SEGMENT_BUFFER = 1, AMDHSAFLAG_USE_DISPATCH_PTR = 2, AMDHSAFLAG_USE_QUEUE_PTR = 4, AMDHSAFLAG_USE_KERNARG_SEGMENT_PTR = 8,
  AMDHSAFLAG_USE_DISPATCH_ID = 16, AMDHSAFLAG_USE_FLAT_SCRATCH_INIT = 32, AMDHSAFLAG_USE_PRIVATE_SEGMENT_SIZE = 64, AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_BIT = 7,
  AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_X = 128, AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Y = 256, AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Z = 512, AMDHSAFLAG_USE_ORDERED_APPEND_GDS = 1,
  AMDHSAFLAG_PRIVATE_ELEM_SIZE_BIT = 1, AMDHSAFLAG_USE_PTR64 = 8, AMDHSAFLAG_USE_DYNAMIC_CALL_STACK = 16, AMDHSAFLAG_USE_DEBUG_ENABLED = 32,
  AMDHSAFLAG_USE_XNACK_ENABLED = 64
}
 
enum  : cxuint { BINGEN_DEFAULT = UINT_MAX, BINGEN_NOTSUPPLIED = UINT_MAX-1 }
 
enum  : uint64_t { BINGEN64_DEFAULT = UINT64_MAX, BINGEN64_NOTSUPPLIED = UINT64_MAX-1 }
 
enum  : uint16_t { BINGEN16_DEFAULT = UINT16_MAX, BINGEN16_NOTSUPPLIED = UINT16_MAX-1 }
 
enum  : uint8_t { BINGEN8_DEFAULT = UINT8_MAX, BINGEN8_NOTSUPPLIED = UINT8_MAX-1 }
 
enum  : Flags { ELF_CREATE_SECTIONMAP = 1, ELF_CREATE_SYMBOLMAP = 2, ELF_CREATE_DYNSYMMAP = 4, ELF_CREATE_ALL = 0xf }
 
enum  ElfRegionType : cxbyte { ElfRegionType::PHDR_TABLE, ElfRegionType::SHDR_TABLE, ElfRegionType::SECTION, ElfRegionType::USER }
 type of Elf region More...
 
enum  : cxuint {
  ELFSECTID_START = UINT_MAX-255, ELFSECTID_SHSTRTAB = ELFSECTID_START, ELFSECTID_STRTAB, ELFSECTID_SYMTAB,
  ELFSECTID_DYNSTR, ELFSECTID_DYNSYM, ELFSECTID_TEXT, ELFSECTID_RODATA,
  ELFSECTID_DATA, ELFSECTID_BSS, ELFSECTID_COMMENT, ELFSECTID_STD_MAX = ELFSECTID_COMMENT,
  ELFSECTID_OTHER_BUILTIN = ELFSECTID_STD_MAX+1, ELFSECTID_NULL = UINT_MAX-2, ELFSECTID_ABS = UINT_MAX-1, ELFSECTID_UNDEF = UINT_MAX
}
 
enum  : cxuint { PHREGION_FILESTART = UINT_MAX }
 
enum  : Flags {
  GALLIUM_INNER_CREATE_SECTIONMAP = 0x10, GALLIUM_INNER_CREATE_SYMBOLMAP = 0x20, GALLIUM_INNER_CREATE_DYNSYMMAP = 0x40, GALLIUM_INNER_CREATE_PROGINFOMAP = 0x100,
  GALLIUM_ELF_CREATE_PROGINFOMAP = 0x10, GALLIUM_CREATE_ALL = ELF_CREATE_ALL | 0xfff0, GALLIUM_INNER_SHIFT = 4
}
 
enum  GalliumArgType : cxbyte {
  GalliumArgType::SCALAR = 0, GalliumArgType::CONSTANT, GalliumArgType::GLOBAL, GalliumArgType::LOCAL,
  GalliumArgType::IMAGE2D_RDONLY, GalliumArgType::IMAGE2D_WRONLY, GalliumArgType::IMAGE3D_RDONLY, GalliumArgType::IMAGE3D_WRONLY,
  GalliumArgType::SAMPLER, GalliumArgType::MAX_VALUE = SAMPLER
}
 GalliumCompute Kernel Arg type. More...
 
enum  GalliumArgSemantic : cxbyte {
  GalliumArgSemantic::GENERAL = 0, GalliumArgSemantic::GRID_DIMENSION, GalliumArgSemantic::GRID_OFFSET, GalliumArgSemantic::IMAGE_SIZE,
  GalliumArgSemantic::IMAGE_FORMAT, GalliumArgSemantic::MAX_VALUE = IMAGE_FORMAT
}
 Gallium semantic field type. More...
 
enum  GalliumSectionType : cxbyte {
  GalliumSectionType::TEXT = 0, GalliumSectionType::DATA_CONSTANT, GalliumSectionType::DATA_GLOBAL, GalliumSectionType::DATA_LOCAL,
  GalliumSectionType::DATA_PRIVATE, TEXT_INTERMEDIATE_170 = 0, TEXT_LIBRARY_170, TEXT_EXECUTABLE_170,
  DATA_CONSTANT_170, DATA_GLOBAL_170, DATA_LOCAL_170, DATA_PRIVATE_170,
  GalliumSectionType::MAX_VALUE = DATA_PRIVATE_170
}
 Gallium format section type. More...
 
enum  : cxuint { GALLIUMSECTID_GPUCONFIG = ELFSECTID_OTHER_BUILTIN, GALLIUMSECTID_NOTEGNUSTACK, GALLIUMSECTID_MAX = GALLIUMSECTID_NOTEGNUSTACK }
 
enum  : Flags { ROCMBIN_CREATE_REGIONMAP = 0x10, ROCMBIN_CREATE_ALL = ELF_CREATE_ALL | 0xfff0 }
 
enum  ROCmRegionType : uint8_t { DATA, DATA = 0, FKERNEL, KERNEL }
 ROCm region/symbol type. More...
 
enum  {
  ROCMFLAG_USE_PRIVATE_SEGMENT_BUFFER = AMDHSAFLAG_USE_PRIVATE_SEGMENT_BUFFER, ROCMFLAG_USE_DISPATCH_PTR = AMDHSAFLAG_USE_DISPATCH_PTR, ROCMFLAG_USE_QUEUE_PTR = AMDHSAFLAG_USE_QUEUE_PTR, ROCMFLAG_USE_KERNARG_SEGMENT_PTR = AMDHSAFLAG_USE_KERNARG_SEGMENT_PTR,
  ROCMFLAG_USE_DISPATCH_ID = AMDHSAFLAG_USE_DISPATCH_ID, ROCMFLAG_USE_FLAT_SCRATCH_INIT = AMDHSAFLAG_USE_FLAT_SCRATCH_INIT, ROCMFLAG_USE_PRIVATE_SEGMENT_SIZE = AMDHSAFLAG_USE_PRIVATE_SEGMENT_SIZE, ROCMFLAG_USE_GRID_WORKGROUP_COUNT_BIT = AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_BIT,
  ROCMFLAG_USE_GRID_WORKGROUP_COUNT_X = AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_X, ROCMFLAG_USE_GRID_WORKGROUP_COUNT_Y = AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Y, ROCMFLAG_USE_GRID_WORKGROUP_COUNT_Z = AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Z, ROCMFLAG_USE_ORDERED_APPEND_GDS = AMDHSAFLAG_USE_ORDERED_APPEND_GDS,
  ROCMFLAG_PRIVATE_ELEM_SIZE_BIT = AMDHSAFLAG_PRIVATE_ELEM_SIZE_BIT, ROCMFLAG_USE_PTR64 = AMDHSAFLAG_USE_PTR64, ROCMFLAG_USE_DYNAMIC_CALL_STACK = AMDHSAFLAG_USE_DYNAMIC_CALL_STACK, ROCMFLAG_USE_DEBUG_ENABLED = AMDHSAFLAG_USE_DEBUG_ENABLED,
  ROCMFLAG_USE_XNACK_ENABLED = AMDHSAFLAG_USE_XNACK_ENABLED
}
 
enum  : cxuint {
  ROCMSECTID_HASH = ELFSECTID_OTHER_BUILTIN, ROCMSECTID_DYNAMIC, ROCMSECTID_NOTE, ROCMSECTID_GPUCONFIG,
  ROCMSECTID_MAX = ROCMSECTID_GPUCONFIG
}
 
enum  : Flags { CLHELPER_USEAMDCL2 = 1, CLHELPER_USEAMDLEGACY = 2 }
 
enum  CLIArgType : cxuchar {
  CLIArgType::NONE = 0, BOOL, UINT, INT,
  UINT64, INT64, SIZE, FLOAT,
  DOUBLE, STRING, CLIArgType::TRIMMED_STRING, SINGLE_MAX = TRIMMED_STRING,
  BOOL_ARRAY = 32, UINT_ARRAY, INT_ARRAY, UINT64_ARRAY,
  INT64_ARRAY, SIZE_ARRAY, FLOAT_ARRAY, DOUBLE_ARRAY,
  STRING_ARRAY, CLIArgType::TRIMMED_STRING_ARRAY, ARRAY_MAX = TRIMMED_STRING_ARRAY
}
 type of argument of the option More...
 
enum  GPUDeviceType : cxbyte {
  GPUDeviceType::CAPE_VERDE = 0, GPUDeviceType::PITCAIRN, GPUDeviceType::TAHITI, GPUDeviceType::OLAND,
  GPUDeviceType::BONAIRE, GPUDeviceType::SPECTRE, GPUDeviceType::SPOOKY, GPUDeviceType::KALINDI,
  GPUDeviceType::HAINAN, GPUDeviceType::HAWAII, GPUDeviceType::ICELAND, GPUDeviceType::TONGA,
  GPUDeviceType::MULLINS, GPUDeviceType::FIJI, GPUDeviceType::CARRIZO, DUMMY,
  GOOSE, HORSE, STONEY, ELLESMERE,
  BAFFIN, GFX804, GFX900, GFX901,
  GPUDeviceType::GPUDEVICE_MAX = GFX901, GPUDeviceType::RADEON_HD7700 = CAPE_VERDE, GPUDeviceType::RADEON_HD7800 = PITCAIRN, GPUDeviceType::RADEON_HD7900 = TAHITI,
  GPUDeviceType::RADEON_R7_250 = OLAND, GPUDeviceType::RADEON_R7_260 = BONAIRE, GPUDeviceType::RADEON_R9_290 = HAWAII
}
 type of GPU device More...
 
enum  GPUArchitecture : cxbyte {
  GPUArchitecture::GCN1_0 = 0, GPUArchitecture::GCN1_1, GPUArchitecture::GCN1_2, GPUArchitecture::GCN1_4,
  GPUARCH_MAX = GCN1_4
}
 GPU architecture. More...
 
enum  : Flags { REGCOUNT_NO_VCC = 1, REGCOUNT_NO_FLAT = 2, REGCOUNT_NO_XNACK = 4, REGCOUNT_NO_EXTRA = 0xffff }
 
enum  : cxuint { REGTYPE_SGPR = 0, REGTYPE_VGPR }
 
enum  : Flags { GCN_VCC = 1, GCN_FLAT = 2, GCN_XNACK = 4 }
 
enum  : Flags { GPUSETUP_TGSIZE_EN = 1, GPUSETUP_SCRATCH_EN = 2 }
 
enum  : cxuint { MAX_REGTYPES_NUM = 4 }
 
enum  GPUArchVersionTable : cxuint { GPUArchVersionTable::AMDCL2 = 0, GPUArchVersionTable::OPENSOURCE }
 ADMGPUArchValues table type. More...
 
enum  : Flags { FLAGS_ALL = 0xffffffffU }
 
enum  : Flags {
  DYNLIB_LOCAL = 0, DYNLIB_LAZY = 1, DYNLIB_NOW = 2, DYNLIB_MODE1_MASK = 7,
  DYNLIB_GLOBAL = 8
}
 

Functions

bool isKernelArgImage (KernelArgType argType)
 return true if argType is image
 
bool isAmdBinary (size_t binaryCodeSize, const cxbyte *binaryCode)
 check whether binary code is Amd Catalyst binary
 
AmdMainBinaryBasecreateAmdBinaryFromCode (size_t binaryCodeSize, cxbyte *binaryCode, Flags creationFlags=AMDBIN_CREATE_ALL)
 create AMD binary object from binary code More...
 
uint32_t detectAmdDriverVersion ()
 detect driver version in the system
 
AmdCL2MainGPUBinaryBasecreateAmdCL2BinaryFromCode (size_t binaryCodeSize, cxbyte *binaryCode, Flags creationFlags=AMDBIN_CREATE_ALL)
 create AMD binary object from binary code More...
 
bool isAmdCL2Binary (size_t binarySize, const cxbyte *binary)
 check whether is Amd OpenCL 2.0 binary
 
bool isElfBinary (size_t binarySize, const cxbyte *binary)
 check whether binary data is is ELF binary
 
uint16_t convertSectionId (cxuint sectionIndex, const uint16_t *builtinSections, cxuint maxBuiltinSection, cxuint extraSectionIndex)
 convert section id to elf section id
 
uint32_t detectMesaDriverVersion ()
 detect driver version in the system
 
uint32_t detectLLVMCompilerVersion ()
 detect LLVM compiler version in the system
 
bool isROCmBinary (size_t binarySize, const cxbyte *binary)
 check whether is Amd OpenCL 2.0 binary
 
cl_platform_id chooseCLPlatformForCLRX ()
 choose suitable OpenCL platform for CLRX assembler programs
 
CLAsmSetup assemblerSetupForCLDevice (cl_device_id clDevice, Flags flags=0, Flags asmFlags=0)
 get assembler setup(compile assembler code) binary for OpenCL device
 
Array< cxbytecreateBinaryForOpenCL (const CLAsmSetup &asmSetup, const char *sourceCode, size_t sourceCodeLen=0)
 create program binary for OpenCL
 
Array< cxbytecreateBinaryForOpenCL (const CLAsmSetup &asmSetup, const std::vector< std::pair< CString, uint64_t > > &defSymbols, const char *sourceCode, size_t sourceCodeLen=0)
 create program binary for OpenCL
 
cl_program createProgramForCLDevice (cl_context clContext, cl_device_id clDevice, const CLAsmSetup &asmSetup, const Array< cxbyte > &binary, CString *buildLog=nullptr)
 create (build program) binary for OpenCL device
 
cl_program createProgramForCLDevice (cl_context clContext, cl_device_id clDevice, const CLAsmSetup &asmSetup, const char *sourceCode, size_t sourceCodeLen=0, CString *buildLog=nullptr)
 create (compile assembler code and build program) binary for OpenCL device
 
cl_program createProgramForCLDevice (cl_context clContext, cl_device_id clDevice, const CLAsmSetup &asmSetup, const std::vector< std::pair< CString, uint64_t > > &defSymbols, const char *sourceCode, size_t sourceCodeLen=0, CString *buildLog=nullptr)
 create (compile assembler code and build program) binary for OpenCL device
 
template<typename Iter >
Iter binaryFind (Iter begin, Iter end, const typename std::iterator_traits< Iter >::value_type &v)
 binary find helper More...
 
template<typename Iter , typename Comp = std::less<typename std::iterator_traits<Iter>::value_type>>
Iter binaryFind (Iter begin, Iter end, const typename std::iterator_traits< Iter >::value_type &v, Comp comp)
 binary find helper More...
 
template<typename Iter >
Iter binaryMapFind (Iter begin, Iter end, const typename std::iterator_traits< Iter >::value_type::first_type &k)
 binary find helper for array-map More...
 
template<typename Iter , typename Comp = std::less<typename std::iterator_traits<Iter>::value_type::first_type>>
Iter binaryMapFind (Iter begin, Iter end, const typename std::iterator_traits< Iter >::value_type::first_type &k, Comp comp)
 binary find helper for array-map More...
 
template<typename Iter >
void mapSort (Iter begin, Iter end)
 map range of iterators More...
 
template<typename Iter , typename Comp = std::less<typename std::iterator_traits<Iter>::value_type::first_type>>
void mapSort (Iter begin, Iter end, Comp comp)
 map range of iterators More...
 
bool operator== (const CLRX::CString &s1, const CLRX::CString &s2)
 equal operator
 
bool operator!= (const CLRX::CString &s1, const CLRX::CString &s2)
 not-equal operator
 
bool operator< (const CLRX::CString &s1, const CLRX::CString &s2)
 less operator
 
bool operator> (const CLRX::CString &s1, const CLRX::CString &s2)
 greater operator
 
bool operator<= (const CLRX::CString &s1, const CLRX::CString &s2)
 less or equal operator
 
bool operator>= (const CLRX::CString &s1, const CLRX::CString &s2)
 greater or equal operator
 
GPUDeviceType getGPUDeviceTypeFromName (const char *name)
 get GPU device type from name
 
const char * getGPUDeviceTypeName (GPUDeviceType deviceType)
 get GPU device type name
 
GPUArchitecture getGPUArchitectureFromName (const char *name)
 get GPU architecture from name
 
GPUArchitecture getGPUArchitectureFromDeviceType (GPUDeviceType deviceType)
 get GPUArchitecture from GPU device type
 
GPUDeviceType getLowestGPUDeviceTypeFromArchitecture (GPUArchitecture arch)
 get lowest GPU device for architecture
 
const char * getGPUArchitectureName (GPUArchitecture architecture)
 get GPU architecture name
 
cxuint getGPUMaxRegistersNum (GPUArchitecture architecture, cxuint regType, Flags flags=0)
 get maximum available registers for GPU (type: 0 - scalar, 1 - vector)
 
cxuint getGPUMaxRegsNumByArchMask (uint16_t archMask, cxuint regType)
 get maximum available registers for GPU (type: 0 - scalar, 1 - vector)
 
void getGPUSetupMinRegistersNum (GPUArchitecture architecture, cxuint dimMask, cxuint userDataNum, Flags flags, cxuint *gprsOut)
 get minimal number of required registers
 
size_t getGPUMaxLocalSize (GPUArchitecture architecture)
 get maximum local size for GPU architecture
 
size_t getGPUMaxGDSSize (GPUArchitecture architecture)
 get maximum GDS size for GPU architecture
 
cxuint getGPUExtraRegsNum (GPUArchitecture architecture, cxuint regType, Flags flags)
 get extra registers (like VCC,FLAT_SCRATCH)
 
uint32_t calculatePgmRSrc1 (GPUArchitecture arch, cxuint vgprsNum, cxuint sgprsNum, cxuint priority, cxuint floatMode, bool privMode, bool dx10clamp, bool debugMode, bool ieeeMode)
 calculate PGMRSRC1 register value
 
uint32_t calculatePgmRSrc2 (GPUArchitecture arch, bool scratchEn, cxuint userDataNum, bool trapPresent, cxuint dimMask, cxuint defDimValues, bool tgSizeEn, cxuint ldsSize, cxuint exceptions)
 calculate PGMRSRC2 register value
 
AMDGPUArchVersion getGPUArchVersion (GPUDeviceType deviceType, GPUArchVersionTable table)
 get AMD GPU architecture version for specific device type and driver
 
GPUDeviceType getGPUDeviceTypeFromArchVersion (cxuint archMajor, cxuint archMinor, cxuint archStepping)
 
uint8_t BEV (uint8_t t)
 convert from/to big endian value
 
int8_t BEV (int8_t t)
 convert from/to big endian value
 
uint16_t BEV (uint16_t t)
 convert from/to big endian value
 
int16_t BEV (int16_t t)
 convert from/to big endian value
 
uint32_t BEV (uint32_t t)
 convert from/to big endian value
 
int32_t BEV (int32_t t)
 convert from/to big endian value
 
uint64_t BEV (uint64_t t)
 convert from/to big endian value
 
int64_t BEV (int64_t t)
 convert from/to big endian value
 
uint8_t UBEV (const uint8_t &t)
 convert from/to big endian value from unaligned memory
 
int8_t UBEV (const int8_t &t)
 convert from/to big endian value from unaligned memory
 
uint16_t UBEV (const uint16_t &t)
 convert from/to big endian value from unaligned memory
 
int16_t UBEV (const int16_t &t)
 convert from/to big endian value from unaligned memory
 
uint32_t UBEV (const uint32_t &t)
 convert from/to big endian value from unaligned memory
 
int32_t UBEV (const int32_t &t)
 convert from/to big endian value from unaligned memory
 
uint64_t UBEV (const uint64_t &t)
 convert from/to big endian value from unaligned memory
 
int64_t UBEV (const int64_t &t)
 convert from/to big endian value from unaligned memory
 
uint8_t LEV (uint8_t t)
 convert from/to little endian value
 
int8_t LEV (int8_t t)
 convert from/to little endian value
 
uint16_t LEV (uint16_t t)
 convert from/to little endian value
 
int16_t LEV (int16_t t)
 convert from/to little endian value
 
uint32_t LEV (uint32_t t)
 convert from/to little endian value
 
int32_t LEV (int32_t t)
 convert from/to little endian value
 
uint64_t LEV (uint64_t t)
 convert from/to little endian value
 
int64_t LEV (int64_t t)
 convert from/to little endian value
 
uint8_t ULEV (const uint8_t &t)
 convert from/to little endian value from unaligned memory
 
int8_t ULEV (const int8_t &t)
 convert from/to little endian value from unaligned memory
 
uint16_t ULEV (const uint16_t &t)
 convert from/to little endian value from unaligned memory
 
int16_t ULEV (const int16_t &t)
 convert from/to little endian value from unaligned memory
 
uint32_t ULEV (const uint32_t &t)
 convert from/to little endian value from unaligned memory
 
int32_t ULEV (const int32_t &t)
 convert from/to little endian value from unaligned memory
 
uint64_t ULEV (const uint64_t &t)
 convert from/to little endian value from unaligned memory
 
int64_t ULEV (const int64_t &t)
 convert from/to little endian value from unaligned memory
 
void SBEV (uint8_t &r, uint8_t v)
 save from/to big endian value
 
void SBEV (int8_t &r, int8_t v)
 save from/to big endian value
 
void SBEV (uint16_t &r, uint16_t v)
 save from/to big endian value
 
void SBEV (int16_t &r, int16_t v)
 save from/to big endian value
 
void SBEV (uint32_t &r, uint32_t v)
 save from/to big endian value
 
void SBEV (int32_t &r, int32_t v)
 save from/to big endian value
 
void SBEV (uint64_t &r, uint64_t v)
 save from/to big endian value
 
void SBEV (int64_t &r, int64_t v)
 save from/to big endian value
 
void SUBEV (uint16_t &r, uint16_t v)
 save from/to big endian value to unaligned memory
 
void SUBEV (int16_t &r, int16_t v)
 save from/to big endian value to unaligned memory
 
void SUBEV (uint32_t &r, uint32_t v)
 save from/to big endian value to unaligned memory
 
void SUBEV (int32_t &r, int32_t v)
 save from/to big endian value to unaligned memory
 
void SUBEV (uint64_t &r, uint64_t v)
 save from/to big endian value to unaligned memory
 
void SUBEV (int64_t &r, int64_t v)
 save from/to big endian value to unaligned memory
 
void SLEV (uint8_t &r, uint8_t v)
 save from/to little endian value
 
void SLEV (int8_t &r, int8_t v)
 save from/to little endian value
 
void SLEV (uint16_t &r, uint16_t v)
 save from/to little endian value
 
void SLEV (int16_t &r, int16_t v)
 save from/to little endian value
 
void SLEV (uint32_t &r, uint32_t v)
 save from/to little endian value
 
void SLEV (int32_t &r, int32_t v)
 save from/to little endian value
 
void SLEV (uint64_t &r, uint64_t v)
 save from/to little endian value
 
void SLEV (int64_t &r, int64_t v)
 save from/to little endian value
 
void SULEV (uint8_t &r, uint8_t v)
 save from/to little endian value to unaligned memory
 
void SULEV (int8_t &r, int8_t v)
 save from/to little endian value to unaligned memory
 
void SULEV (uint16_t &r, uint16_t v)
 save from/to little endian value to unaligned memory
 
void SULEV (int16_t &r, int16_t v)
 save from/to little endian value to unaligned memory
 
void SULEV (uint32_t &r, uint32_t v)
 save from/to little endian value to unaligned memory
 
void SULEV (int32_t &r, int32_t v)
 save from/to little endian value to unaligned memory
 
void SULEV (uint64_t &r, uint64_t v)
 save from/to little endian value to unaligned memory
 
void SULEV (int64_t &r, int64_t v)
 save from/to little endian value to unaligned memory
 
uint16_t BSWAP16 (uint16_t v)
 BSWAP 16-bit.
 
uint32_t BSWAP32 (uint32_t v)
 BSWAP 32-bit.
 
uint64_t BSWAP64 (uint64_t v)
 BSWAP 64-bit.
 
uint8_t UBEV (uint8_t t)
 convert from/to big endian value from unaligned memory
 
int8_t UBEV (int8_t t)
 convert from/to big endian value from unaligned memory
 
uint8_t ULEV (uint8_t t)
 convert from/to little endian value from unaligned memory
 
int8_t ULEV (int8_t t)
 convert from/to little endian value from unaligned memory
 
void SUBEV (uint8_t &r, uint8_t v)
 save from/to big endian value to unaligned memory
 
void SUBEV (int8_t &r, int8_t v)
 save from/to bif endian value to unaligned memory
 
bool isSpace (unsigned char c)
 check whether character is space
 
bool isODigit (unsigned char c)
 check whether character is digit
 
bool isDigit (unsigned char c)
 check whether character is digit
 
bool isXDigit (unsigned char c)
 check whether character is hexadecimal digit
 
bool isAlpha (unsigned char c)
 check whether character is digit
 
bool isAlnum (unsigned char c)
 check whether character is digit
 
const char * skipSpaces (const char *s)
 skip spaces from cString
 
const char * skipSpacesAtEnd (const char *s, size_t length)
 skip spaces from cString
 
template<typename T >
cstrtovCStyle (const char *str, const char *inend, const char *&outend)
 parses integer or float point formatted looks like C-style More...
 
template<typename T >
parseEnvVariable (const char *envVar, const T &defaultValue=T())
 parse environment variable More...
 
template cxuchar parseEnvVariable< cxuchar > (const char *envVar, const cxuchar &defaultValue)
 parse environment variable of cxuchar type
 
template cxchar parseEnvVariable< cxchar > (const char *envVar, const cxchar &defaultValue)
 parse environment variable of cxchar type
 
template cxuint parseEnvVariable< cxuint > (const char *envVar, const cxuint &defaultValue)
 parse environment variable of cxuint type
 
template cxint parseEnvVariable< cxint > (const char *envVar, const cxint &defaultValue)
 parse environment variable of cxint type
 
template cxushort parseEnvVariable< cxushort > (const char *envVar, const cxushort &defaultValue)
 parse environment variable of cxushort type
 
template cxshort parseEnvVariable< cxshort > (const char *envVar, const cxshort &defaultValue)
 parse environment variable of cxshort type
 
template cxulong parseEnvVariable< cxulong > (const char *envVar, const cxulong &defaultValue)
 parse environment variable of cxulong type
 
template cxlong parseEnvVariable< cxlong > (const char *envVar, const cxlong &defaultValue)
 parse environment variable of cxlong type
 
template cxullong parseEnvVariable< cxullong > (const char *envVar, const cxullong &defaultValue)
 parse environment variable of cxullong type
 
template cxllong parseEnvVariable< cxllong > (const char *envVar, const cxllong &defaultValue)
 parse environment variable of cxllong type
 
template float parseEnvVariable< float > (const char *envVar, const float &defaultValue)
 parse environment variable of float type
 
template double parseEnvVariable< double > (const char *envVar, const double &defaultValue)
 parse environment variable of double type
 
template std::string parseEnvVariable< std::string > (const char *envVar, const std::string &defaultValue)
 parse environment variable of string type
 
template bool parseEnvVariable< bool > (const char *envVar, const bool &defaultValue)
 parse environment variable of boolean type
 
cxuint CLZ32 (uint32_t v)
 counts leading zeroes for 32-bit unsigned integer. For zero behavior is undefined
 
cxuint CLZ64 (uint64_t v)
 counts leading zeroes for 64-bit unsigned integer. For zero behavior is undefined
 
template<typename T , typename T2 >
bool usumGt (T a, T b, T2 c)
 safely compares sum of two unsigned integers with other unsigned integer
 
template<typename T , typename T2 >
bool usumGe (T a, T b, T2 c)
 safely compares sum of two unsigned integers with other unsigned integer
 
std::string escapeStringCStyle (size_t strSize, const char *str)
 escapes string into C-style string
 
std::string escapeStringCStyle (const std::string &str)
 escape string into C-style string
 
std::string escapeStringCStyle (const CString &str)
 escape string into C-style string
 
size_t escapeStringCStyle (size_t strSize, const char *str, size_t outMaxSize, char *outStr, size_t &outSize)
 escapes string into C-style string More...
 
cxuint cstrtoui (const char *str, const char *inend, const char *&outend)
 parses unsigned integer regardless locales More...
 
int64_t cstrtoiXCStyle (const char *str, const char *inend, const char *&outend, cxuint bits)
 parse 64-bit signed integer
 
uint64_t cstrtouXCStyle (const char *str, const char *inend, const char *&outend, cxuint bits)
 parse 64-bit unsigned integer
 
uint64_t cstrtofXCStyle (const char *str, const char *inend, const char *&outend, cxuint expBits, cxuint mantisaBits)
 parse 64-bit float value
 
UInt128 cstrtou128CStyle (const char *str, const char *inend, const char *&outend)
 parse 128-bit unsigned integer
 
template<>
cxuchar cstrtovCStyle< cxuchar > (const char *str, const char *inend, const char *&outend)
 parse cxuchar value from string
 
template<>
cxchar cstrtovCStyle< cxchar > (const char *str, const char *inend, const char *&outend)
 parse cxchar value from string
 
template<>
cxuint cstrtovCStyle< cxuint > (const char *str, const char *inend, const char *&outend)
 parse cxuint value from string
 
template<>
cxint cstrtovCStyle< cxint > (const char *str, const char *inend, const char *&outend)
 parse cxint value from string
 
template<>
cxushort cstrtovCStyle< cxushort > (const char *str, const char *inend, const char *&outend)
 parse cxushort value from string
 
template<>
cxshort cstrtovCStyle< cxshort > (const char *str, const char *inend, const char *&outend)
 parse cxshort value from string
 
template<>
cxulong cstrtovCStyle< cxulong > (const char *str, const char *inend, const char *&outend)
 parse cxulong value from string
 
template<>
cxlong cstrtovCStyle< cxlong > (const char *str, const char *inend, const char *&outend)
 parse cxlong value from string
 
template<>
cxullong cstrtovCStyle< cxullong > (const char *str, const char *inend, const char *&outend)
 parse cxullong value from string
 
template<>
cxllong cstrtovCStyle< cxllong > (const char *str, const char *inend, const char *&outend)
 parse cxllong value from string
 
template<>
UInt128 cstrtovCStyle< UInt128 > (const char *str, const char *inend, const char *&outend)
 parse UInt128 value from string
 
template<>
float cstrtovCStyle< float > (const char *str, const char *inend, const char *&outend)
 parse float value from string
 
template<>
double cstrtovCStyle< double > (const char *str, const char *inend, const char *&outend)
 parse double value from string
 
cxushort cstrtohCStyle (const char *str, const char *inend, const char *&outend)
 parses half float formatted looks like C-style More...
 
size_t uXtocstrCStyle (uint64_t value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format unsigned value to string
 
size_t iXtocstrCStyle (int64_t value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 formast signed value to string
 
template<typename T >
size_t itocstrCStyle (T value, char *str, size_t maxSize, cxuint radix=10, cxuint width=0, bool prefix=true)
 formats an integer More...
 
template<>
size_t itocstrCStyle< cxuchar > (cxuchar value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxuchar value to string
 
template<>
size_t itocstrCStyle< cxchar > (cxchar value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxchar value to string
 
template<>
size_t itocstrCStyle< cxushort > (cxushort value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxushort value to string
 
template<>
size_t itocstrCStyle< cxshort > (cxshort value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxshort value to string
 
template<>
size_t itocstrCStyle< cxuint > (cxuint value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxuint value to string
 
template<>
size_t itocstrCStyle< cxint > (cxint value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxint value to string
 
template<>
size_t itocstrCStyle< cxulong > (cxulong value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxulong value to string
 
template<>
size_t itocstrCStyle< cxlong > (cxlong value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxlong value to string
 
template<>
size_t itocstrCStyle< cxullong > (cxullong value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxullong value to string
 
template<>
size_t itocstrCStyle< cxllong > (cxllong value, char *str, size_t maxSize, cxuint radix, cxuint width, bool prefix)
 format cxllong value to string
 
size_t fXtocstrCStyle (uint64_t value, char *str, size_t maxSize, bool scientific, cxuint expBits, cxuint mantisaBits)
 format float value to string
 
size_t htocstrCStyle (cxushort value, char *str, size_t maxSize, bool scientific=false)
 formats half float in C-style More...
 
size_t ftocstrCStyle (float value, char *str, size_t maxSize, bool scientific=false)
 formats single float in C-style More...
 
size_t dtocstrCStyle (double value, char *str, size_t maxSize, bool scientific=false)
 formats double float in C-style More...
 
bool isDirectory (const char *path)
 returns true if path refers to directory
 
bool isFileExists (const char *path)
 returns true if file exists
 
Array< cxbyteloadDataFromFile (const char *filename)
 load data from file (any regular or pipe or device) More...
 
void filesystemPath (char *path)
 convert to filesystem from unified path (with slashes)
 
void filesystemPath (std::string &path)
 convert to filesystem from unified path (with slashes)
 
std::string joinPaths (const std::string &path1, const std::string &path2)
 join two paths
 
uint64_t getFileTimestamp (const char *filename)
 get file timestamp in nanosecond since Unix epoch
 
std::string getHomeDir ()
 get user's home directory
 
void makeDir (const char *dirname)
 create directory
 
Array< cxbyterunExecWithOutput (const char *program, const char **argv)
 run executable with output, returns array of output
 
std::string findAmdOCL ()
 find amdocl library, returns path if found, otherwise returns empty string
 
std::string findMesaOCL ()
 find Mesa OpenCL library, returns path if found, otherwise returns empty string
 
std::string findLLVMConfig ()
 find LLVM config, returns path if found, otherwise returns empty string
 
char toLower (char c)
 convert character to lowercase
 
void toLowerString (std::string &string)
 convert string to lowercase
 
void toLowerString (char *cstr)
 convert string to lowercase
 
void toLowerString (CString &string)
 convert string to lowercase
 
char toUpper (char c)
 convert character to uppercase
 
void toUpperString (std::string &string)
 convert string to uppercase
 
void toUpperString (char *cstr)
 convert string to uppercase
 
void toUpperString (CString &string)
 convert string to uppercase
 
template<class Callable , class... Args>
void callOnce (std::once_flag &flag, Callable &&f, Args &&...args)
 callOnce - portable wrapper for std::call_once
 

Detailed Description

main namespace

Enumeration Type Documentation

anonymous enum : AsmExprTargetType
Enumerator
ASMXTGT_SYMBOL 

target is symbol

ASMXTGT_DATA8 

target is byte

ASMXTGT_DATA16 

target is 16-bit word

ASMXTGT_DATA32 

target is 32-bit word

ASMXTGT_DATA64 

target is 64-bit word

ASMXTGT_CODEFLOW 

code flow entry

enum CLRX::AsmExprOp : cxbyte
strong

assembler expression operator

Enumerator
ARG_VALUE 

absolute value

ARG_SYMBOL 

absolute symbol without defined value

NEGATE 

negation

BIT_NOT 

binary negation

LOGICAL_NOT 

logical negation

PLUS 

plus (nothing)

ADDITION 

addition

SUBTRACT 

subtraction

MULTIPLY 

multiplication

DIVISION 

unsigned division

SIGNED_DIVISION 

signed division

MODULO 

unsigned modulo

SIGNED_MODULO 

signed modulo

BIT_AND 

bitwise AND

BIT_XOR 

bitwise XOR

BIT_ORNOT 

bitwise OR-not

SHIFT_LEFT 

shift left

SHIFT_RIGHT 

logical shift irght

SIGNED_SHIFT_RIGHT 

signed (arithmetic) shift right

LOGICAL_AND 

logical AND

LOGICAL_OR 

logical OR

EQUAL 

equality

NOT_EQUAL 

unequality

LESS 

less than

LESS_EQ 

less or equal than

GREATER 

greater than

GREATER_EQ 

greater or equal than

BELOW 

unsigned less

BELOW_EQ 

unsigned less or equal

ABOVE 

unsigned less

ABOVE_EQ 

unsigned less or equal

CHOICE 

a ? b : c

CHOICE_START 

helper

FIRST_UNARY 

helper

LAST_UNARY 

helper

FIRST_BINARY 

helper

LAST_BINARY 

helper

NONE 

none operation

anonymous enum : cxbyte
Enumerator
ASMRVU_READ 

register will be read

ASMRVU_WRITE 

register will be written

ASMRVU_ACCESS_MASK 

access mask

ASMRVU_REGTYPE_MASK 

for internal usage (regtype)

ASMRVU_REGSIZE_SHIFT 

for internal usage

ASMRVU_REGSIZE_MASK 

for internal usage

code flow type

Enumerator
JUMP 

jump

CJUMP 

conditional jump

CALL 

call of procedure

RETURN 

return from procedure

START 

code start

END 

code end

assembler section type

Enumerator
DATA 

kernel or global data

CODE 

code of program or kernel

CONFIG 

configuration (global or for kernel)

LAST_COMMON 

last common type

AMD_HEADER 

AMD Catalyst kernel's header.

AMD_METADATA 

AMD Catalyst kernel's metadata.

AMD_CALNOTE 

AMD CALNote.

GALLIUM_COMMENT 

gallium comment section

ROCM_COMMENT 

ROCm comment section.

anonymous enum : cxuint
Enumerator
ASMSECT_ABS 

absolute section id

ASMSECT_NONE 

none section id

ASMKERN_GLOBAL 

no kernel, global space

ASMKERN_INNER 

no kernel, inner global space

anonymous enum : Flags
Enumerator
ASMSECT_UNRESOLVABLE 

section is unresolvable

enum CLRX::AsmSourceType : cxbyte
strong

source type

Enumerator
FILE 

include file

MACRO 

macro substitution

REPT 

repetition

type of AsmInputFilter

Enumerator
STREAM 

AsmStreamInputFilter.

REPEAT 

AsmRepeatInputFilter or AsmIRPInputFilter.

MACROSUBST 

AsmMacroInputFilter.

anonymous enum : Flags
Enumerator
ASM_WARNINGS 

enable all warnings for assembler

ASM_TESTRUN 

only for running tests

ASM_ALL 

all flags

enum CLRX::AsmClauseType
strong

type of clause

Enumerator
IF 

if clause

ELSEIF 

elseif clause

ELSE 

else clause

REPEAT 

rept clause or irp/irpc clause

MACRO 

macro clause

enum CLRX::BinaryFormat
strong

binary for Disassembler

Enumerator
AMD 

AMD CATALYST format.

GALLIUM 

GalliumCompute format.

RAWCODE 

raw code format

AMDCL2 

AMD OpenCL 2.0 format.

ROCM 

ROCm (RadeonOpenCompute) format.

anonymous enum : Flags
Enumerator
DISASM_DUMPCODE 

dump code

DISASM_METADATA 

dump metadatas

DISASM_DUMPDATA 

dump datas

DISASM_CALNOTES 

dump ATI CAL notes

DISASM_FLOATLITS 

print in comments float literals

DISASM_HEXCODE 

print on left side hexadecimal code

DISASM_CONFIG 

print kernel configuration instead raw data

DISASM_CODEPOS 

print code position

DISASM_HSACONFIG 

print HSA configuration

all disassembler flags (without config)

anonymous enum : Flags
Enumerator
AMDBIN_CREATE_CALNOTES 

only for internal usage

AMDBIN_CREATE_KERNELINFO 

create kernel informations

AMDBIN_CREATE_KERNELINFOMAP 

create map of kernel informations

AMDBIN_CREATE_INNERBINMAP 

create map of inner binaries

AMDBIN_CREATE_INFOSTRINGS 

create compile options and driver info

AMDBIN_CREATE_KERNELHEADERS 

create kernel headers

AMDBIN_CREATE_KERNELHEADERMAP 

create kernel headers map

AMDBIN_INNER_CREATE_SECTIONMAP 

create map of sections for inner binaries

AMDBIN_INNER_CREATE_SYMBOLMAP 

create map of symbols for inner binaries

AMDBIN_INNER_CREATE_DYNSYMMAP 

create map of dynamic symbols for inner binaries

AMDBIN_INNER_CREATE_CALNOTES 

create CAL notes for AMD inner GPU binary

AMDBIN_CREATE_ALL 

all AMD binaries creation flags

AMDBIN_INNER_SHIFT 

shift for convert inner binary flags into elf binary flags

kernel pointer type of argument

Enumerator
NONE 

no pointer

LOCAL 

pointer to local memory

CONSTANT 

pointer to constant memory

GLOBAL 

pointer to global memory

anonymous enum : cxbyte
Enumerator
KARG_PTR_NORMAL 

no special flags

KARG_PTR_READ_ONLY 

read only image

KARG_PTR_WRITE_ONLY 

write only image

KARG_PTR_READ_WRITE 

read-write image (???)

KARG_PTR_CONST 

constant buffer

KARG_PTR_RESTRICT 

buffer is restrict specifier

KARG_PTR_VOLATILE 

volatile buffer

enum CLRX::AmdMainType
strong

AMD main binary type.

Enumerator
GPU_BINARY 

binary for GPU

GPU_64_BINARY 

binary for GPU with 64-bit memory model

X86_BINARY 

binary for x86 systems

X86_64_BINARY 

binary for x86-64 systems

GPU_CL2_BINARY 

OpenCL 2.0 binary type (32-bit)

GPU_CL2_64_BINARY 

OpenCL 2.0 binary type (64-bit)

anonymous enum : Flags
Enumerator
AMDCL2BIN_CREATE_KERNELDATA 

create kernel setup

AMDCL2BIN_CREATE_KERNELDATAMAP 

create kernel setups map

AMDCL2BIN_CREATE_KERNELSTUBS 

create kernel stub

AMDCL2BIN_INNER_CREATE_KERNELDATA 

create kernel setup

AMDCL2BIN_INNER_CREATE_KERNELDATAMAP 

create kernel setups map

AMDCL2BIN_INNER_CREATE_KERNELSTUBS 

create kernel stub

anonymous enum : cxbyte
Enumerator
AMDCL2_ARGUSED_NOTUSED 

argument not used

AMDCL2_ARGUSED_READ 

argument to read

AMDCL2_ARGUSED_WRITE 

argument to write

AMDCL2_ARGUSED_READ_WRITE 

argument to read and write

anonymous enum
Enumerator
RELTYPE_VALUE 

relocation that get value

RELTYPE_LOW_32BIT 

relocation that get low 32-bit of value

RELTYPE_HIGH_32BIT 

relocation that get high 32-bit of value

anonymous enum
Enumerator
AMDHSAFLAG_USE_PRIVATE_SEGMENT_BUFFER 

use privae segment buffer

AMDHSAFLAG_USE_QUEUE_PTR 

use queue pointer

AMDHSAFLAG_USE_KERNARG_SEGMENT_PTR 

use kernel argument segment pointer

AMDHSAFLAG_USE_PRIVATE_SEGMENT_SIZE 

use private segment size

AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_X 

use workgroup count for X dim

AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Y 

use workgroup count for Y dim

AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Z 

use workgroup count for Z dim

AMDHSAFLAG_PRIVATE_ELEM_SIZE_BIT 

use ordered append gds

AMDHSAFLAG_USE_PTR64 

use 64-bit pointers

AMDHSAFLAG_USE_DEBUG_ENABLED 

debug enabled

AMDHSAFLAG_USE_XNACK_ENABLED 

xnack enabled

anonymous enum : cxuint
Enumerator
BINGEN_DEFAULT 

if set in field then field has been filled later

BINGEN_NOTSUPPLIED 

if set in field then field has been ignored

anonymous enum : uint64_t
Enumerator
BINGEN64_DEFAULT 

if set in field then field has been filled later

BINGEN64_NOTSUPPLIED 

if set in field then field has been ignored

anonymous enum : uint16_t
Enumerator
BINGEN16_DEFAULT 

if set in field then field has been filled later

BINGEN16_NOTSUPPLIED 

if set in field then field has been ignored

anonymous enum : uint8_t
Enumerator
BINGEN8_DEFAULT 

if set in field then field has been filled later

BINGEN8_NOTSUPPLIED 

if set in field then field has been ignored

anonymous enum : Flags
Enumerator
ELF_CREATE_SECTIONMAP 

create map of sections

ELF_CREATE_SYMBOLMAP 

create map of symbols

ELF_CREATE_DYNSYMMAP 

create map of dynamic symbols

ELF_CREATE_ALL 

creation flags for ELF binaries

enum CLRX::ElfRegionType : cxbyte
strong

type of Elf region

Enumerator
PHDR_TABLE 

program header table

SHDR_TABLE 

section header table

SECTION 

section

USER 

user region

anonymous enum : Flags
Enumerator
GALLIUM_INNER_CREATE_SECTIONMAP 

create map of sections for inner binaries

GALLIUM_INNER_CREATE_SYMBOLMAP 

create map of kernels for inner binaries

GALLIUM_INNER_CREATE_DYNSYMMAP 

create map of dynamic kernels for inner binaries

GALLIUM_INNER_CREATE_PROGINFOMAP 

create prinfomap for inner binaries

GALLIUM_ELF_CREATE_PROGINFOMAP 

create elf proginfomap

GALLIUM_CREATE_ALL 

all Gallium binaries flags

GALLIUM_INNER_SHIFT 

shift for convert inner binary flags into elf binary flags

GalliumCompute Kernel Arg type.

Enumerator
SCALAR 

scalar type

CONSTANT 

constant pointer

GLOBAL 

global pointer

LOCAL 

local pointer

IMAGE2D_RDONLY 

read-only 2d image

IMAGE2D_WRONLY 

write-only 2d image

IMAGE3D_RDONLY 

read-only 3d image

IMAGE3D_WRONLY 

write-only 3d image

SAMPLER 

sampler

MAX_VALUE 

last value

Gallium semantic field type.

Enumerator
GENERAL 

general

GRID_DIMENSION 

???

GRID_OFFSET 

???

IMAGE_SIZE 

image size

IMAGE_FORMAT 

image format

MAX_VALUE 

last value

Gallium format section type.

Enumerator
TEXT 

section for text (binary code)

DATA_CONSTANT 

constant data (???)

DATA_GLOBAL 

global data (???)

DATA_LOCAL 

local data (???)

DATA_PRIVATE 

private data (???)

MAX_VALUE 

last value

anonymous enum : Flags
Enumerator
ROCMBIN_CREATE_REGIONMAP 

create region map

ROCMBIN_CREATE_ALL 

all ROCm binaries flags

enum CLRX::ROCmRegionType : uint8_t

ROCm region/symbol type.

Enumerator
DATA 

data object

DATA 

kernel or global data

FKERNEL 

function kernel (code)

KERNEL 

OpenCL kernel to call ??

anonymous enum : Flags
Enumerator
CLHELPER_USEAMDCL2 

force using AMD OpenCL 2.0 binary format

CLHELPER_USEAMDLEGACY 

force using AMD OpenCL 1.2 binary format

enum CLRX::CLIArgType : cxuchar
strong

type of argument of the option

Enumerator
NONE 

no argument

TRIMMED_STRING 

trimmed string (without spaces at begin and end)

TRIMMED_STRING_ARRAY 

trimmed string (without spaces at begin and end)

enum CLRX::GPUDeviceType : cxbyte
strong

type of GPU device

Enumerator
CAPE_VERDE 

Radeon HD7700.

PITCAIRN 

Radeon HD7800.

TAHITI 

Radeon HD7900.

OLAND 

Radeon R7 250.

BONAIRE 

Radeon R7 260.

SPECTRE 

Kaveri.

SPOOKY 

Kaveri.

KALINDI 

??? GCN1.1

HAINAN 

???? GCN1.0

HAWAII 

Radeon R9 290.

ICELAND 

???

TONGA 

Radeon R9 285.

MULLINS 

???

FIJI 

Radeon Fury.

CARRIZO 

APU.

GPUDEVICE_MAX 

last value

RADEON_HD7700 

Radeon HD7700.

RADEON_HD7800 

Radeon HD7800.

RADEON_HD7900 

Radeon HD7900.

RADEON_R7_250 

Radeon R7 250.

RADEON_R7_260 

Radeon R7 260.

RADEON_R9_290 

Radeon R7 290.

GPU architecture.

Enumerator
GCN1_0 

first iteration (Radeon HD7000 series)

GCN1_1 

second iteration (Radeon Rx 200 series)

GCN1_2 

third iteration (Radeon Rx 300 series and Tonga)

GCN1_4 

GFX9 architecture (AMD RX VEGA)

ADMGPUArchValues table type.

Enumerator
AMDCL2 

AMD OpenCL 2.0 driver.

OPENSOURCE 

ROCm and Gallium.

anonymous enum : Flags
Enumerator
DYNLIB_LOCAL 

treat symbols locally

DYNLIB_LAZY 

resolve symbols when is needed

DYNLIB_NOW 

resolve symbols now

DYNLIB_GLOBAL 

treats symbols globally

Function Documentation

AmdMainBinaryBase* CLRX::createAmdBinaryFromCode ( size_t  binaryCodeSize,
cxbyte binaryCode,
Flags  creationFlags = AMDBIN_CREATE_ALL 
)

create AMD binary object from binary code

Parameters
binaryCodeSizebinary code size
binaryCodepointer to binary code
creationFlagsflags that specified what will be created during creation
Returns
binary object
AmdCL2MainGPUBinaryBase* CLRX::createAmdCL2BinaryFromCode ( size_t  binaryCodeSize,
cxbyte binaryCode,
Flags  creationFlags = AMDBIN_CREATE_ALL 
)

create AMD binary object from binary code

Parameters
binaryCodeSizebinary code size
binaryCodepointer to binary code
creationFlagsflags that specified what will be created during creation
Returns
binary object
template<typename Iter >
Iter CLRX::binaryFind ( Iter  begin,
Iter  end,
const typename std::iterator_traits< Iter >::value_type &  v 
)

binary find helper

binary find

Parameters
beginiterator to first element
enditerator to after last element
vvalue to find
Returns
iterator to value or end
template<typename Iter , typename Comp = std::less<typename std::iterator_traits<Iter>::value_type>>
Iter CLRX::binaryFind ( Iter  begin,
Iter  end,
const typename std::iterator_traits< Iter >::value_type &  v,
Comp  comp 
)

binary find helper

binary find

Parameters
beginiterator to first element
enditerator to after last element
vvalue to find
compcomparator
Returns
iterator to value or end
template<typename Iter >
Iter CLRX::binaryMapFind ( Iter  begin,
Iter  end,
const typename std::iterator_traits< Iter >::value_type::first_type &  k 
)

binary find helper for array-map

binary find of map (array)

Parameters
beginiterator to first element
enditerator to after last element
kkey to find
Returns
iterator to value or end
template<typename Iter , typename Comp = std::less<typename std::iterator_traits<Iter>::value_type::first_type>>
Iter CLRX::binaryMapFind ( Iter  begin,
Iter  end,
const typename std::iterator_traits< Iter >::value_type::first_type &  k,
Comp  comp 
)

binary find helper for array-map

binary find of map (array)

Parameters
beginiterator to first element
enditerator to after last element
kkey to find
compcomparator
Returns
iterator to value or end
template<typename Iter >
void CLRX::mapSort ( Iter  begin,
Iter  end 
)

map range of iterators

sort map (array)

Parameters
beginiterator to first element
enditerator to after last element
template<typename Iter , typename Comp = std::less<typename std::iterator_traits<Iter>::value_type::first_type>>
void CLRX::mapSort ( Iter  begin,
Iter  end,
Comp  comp 
)

map range of iterators

sort map (array)

Parameters
beginiterator to first element
enditerator to after last element
beginiterator to first element
enditerator to after last element
compcomparator
template<typename T >
T CLRX::cstrtovCStyle ( const char *  str,
const char *  inend,
const char *&  outend 
)

parses integer or float point formatted looks like C-style

parses integer or float point from str string. inend can points to end of string or can be null. Function throws ParseException when number in string is out of range, when string does not have number or inend points to string. Function accepts decimal format, octal form (with prefix '0'), hexadecimal form (prefix '0x' or '0X'), and binary form (prefix '0b' or '0B'). For floating points function accepts decimal format and binary format. Result is rounded to nearest even (if two values are equally close will be choosen a even value). Currently only IEEE-754 format is supported.

Parameters
strinput string pointer
inendpointer points to end of string or null if not end specified
outendreturns end of number in string (returned even if exception thrown)
Returns
parsed integer value
template<typename T >
T CLRX::parseEnvVariable ( const char *  envVar,
const T &  defaultValue = T() 
)

parse environment variable

parse environment variable

Parameters
envVar- name of environment variable
defaultValue- value that will be returned if environment variable is not present
Returns
value
size_t CLRX::escapeStringCStyle ( size_t  strSize,
const char *  str,
size_t  outMaxSize,
char *  outStr,
size_t &  outSize 
)

escapes string into C-style string

Parameters
strSizestring size
strstring
outMaxSizeoutput max size (including null-character)
outStroutput string
outSizesize of output string
Returns
number of processed input characters
cxuint CLRX::cstrtoui ( const char *  str,
const char *  inend,
const char *&  outend 
)

parses unsigned integer regardless locales

parses unsigned integer in decimal form from str string. inend can points to end of string or can be null. Function throws ParseException when number in string is out of range, when string does not have number or inend points to string.

Parameters
strinput string pointer
inendpointer points to end of string or null if not end specified
outendreturns end of number in string (returned even if exception thrown)
Returns
parsed integer value
cxushort CLRX::cstrtohCStyle ( const char *  str,
const char *  inend,
const char *&  outend 
)
inline

parses half float formatted looks like C-style

parse half value from string

parses half floating point from str string. inend can points to end of string or can be null. Function throws ParseException when number in string is out of range, when string does not have number or inend points to string. Function accepts decimal format and binary format. Result is rounded to nearest even (if two values are equally close will be choosen a even value). Currently only IEEE-754 format is supported.

Parameters
strinput string pointer
inendpointer points to end of string or null if not end specified
outendreturns end of number in string (returned even if exception thrown)
Returns
parsed floating point value
template<typename T >
size_t CLRX::itocstrCStyle ( value,
char *  str,
size_t  maxSize,
cxuint  radix = 10,
cxuint  width = 0,
bool  prefix = true 
)

formats an integer

formats an integer in C-style formatting.

Parameters
valueinteger value
stroutput string
maxSizemax size of string (including null-character)
radixradix of digits (2, 8, 10, 16)
widthmax number of digits in number
prefixadds required prefix if true
Returns
length of output string (excluding null-character)
size_t CLRX::htocstrCStyle ( cxushort  value,
char *  str,
size_t  maxSize,
bool  scientific = false 
)
inline

formats half float in C-style

formats to string the half float in C-style formatting. This function handles 2 modes of printing value: human readable and scientific. Scientific mode forces form with decimal exponent. Currently only IEEE-754 format is supported.

Parameters
valuefloat value
stroutput string
maxSizemax size of string (including null-character)
scientificenable scientific mode
Returns
length of output string (excluding null-character)
size_t CLRX::ftocstrCStyle ( float  value,
char *  str,
size_t  maxSize,
bool  scientific = false 
)
inline

formats single float in C-style

formats to string the single float in C-style formatting. This function handles 2 modes of printing value: human readable and scientific. Scientific mode forces form with decimal exponent. Currently only IEEE-754 format is supported.

Parameters
valuefloat value
stroutput string
maxSizemax size of string (including null-character)
scientificenable scientific mode
Returns
length of output string (excluding null-character)
size_t CLRX::dtocstrCStyle ( double  value,
char *  str,
size_t  maxSize,
bool  scientific = false 
)
inline

formats double float in C-style

formats to string the double float in C-style formatting. This function handles 2 modes of printing value: human readable and scientific. Scientific mode forces form with decimal exponent. Currently only IEEE-754 format is supported.

Parameters
valuefloat value
stroutput string
maxSizemax size of string (including null-character)
scientificenable scientific mode
Returns
length of output string (excluding null-character)
Array<cxbyte> CLRX::loadDataFromFile ( const char *  filename)

load data from file (any regular or pipe or device)

Parameters
filenamefilename
Returns
array of data (can be greater than size of data from file)