Changeset 3444 in CLRX


Ignore:
Timestamp:
Sep 28, 2017, 12:19:14 PM (19 months ago)
Author:
matszpk
Message:

CLRadeonExtender: Rename arch values to arch version.

Location:
CLRadeonExtender/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/utils/GPUId.h

    r3443 r3444  
    150150
    151151/// structure helper for AMDGPU architecture version
    152 struct AMDGPUArchValues
     152struct AMDGPUArchVersion
    153153{
    154154    uint32_t major;     ///< arch major number
     
    169169
    170170/// ADMGPUArchValues table type
    171 enum class GPUArchValuesTable: cxuint
     171enum class GPUArchVersionTable: cxuint
    172172{
    173173    AMDCL2 = 0, ///< AMD OpenCL 2.0 driver
     
    175175};
    176176
    177 /// get AMD GPU architecture values (version) for specific device type and driver
    178 extern AMDGPUArchValues getGPUArchValues(GPUDeviceType deviceType,
    179                         GPUArchValuesTable table);
     177/// get AMD GPU architecture version for specific device type and driver
     178extern AMDGPUArchVersion getGPUArchVersion(GPUDeviceType deviceType,
     179                        GPUArchVersionTable table);
    180180
    181 // get GPU device type from Architecture values (version)
    182 extern GPUDeviceType getGPUDeviceTypeFromArchValues(cxuint archMajor, cxuint archMinor,
     181// get GPU device type from architecture version
     182extern GPUDeviceType getGPUDeviceTypeFromArchVersion(cxuint archMajor, cxuint archMinor,
    183183                            cxuint archStepping);
    184184
  • CLRadeonExtender/trunk/amdasm/AsmGalliumFormat.cpp

    r3443 r3444  
    18241824   
    18251825    // setup amd GPU arch values (for LLVM 4.0 HSA config)
    1826     AMDGPUArchValues amdGpuArchValues = getGPUArchValues(assembler.deviceType,
    1827                                 GPUArchValuesTable::OPENSOURCE);
     1826    AMDGPUArchVersion amdGpuArchValues = getGPUArchVersion(assembler.deviceType,
     1827                                GPUArchVersionTable::OPENSOURCE);
    18281828    // replace arch minor and stepping by user defined values (if set)
    18291829    if (archMinor != BINGEN_DEFAULT)
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r3443 r3444  
    14111411    cxuint maxSGPRsNum = getGPUMaxRegistersNum(arch, REGTYPE_SGPR, 0);
    14121412   
    1413     AMDGPUArchValues amdGpuArchValues = getGPUArchValues(assembler.deviceType,
    1414                                 GPUArchValuesTable::OPENSOURCE);
     1413    AMDGPUArchVersion amdGpuArchValues = getGPUArchVersion(assembler.deviceType,
     1414                                GPUArchVersionTable::OPENSOURCE);
    14151415    // replace arch minor and stepping by user defined values (if set)
    14161416    if (output.archMinor!=UINT32_MAX)
  • CLRadeonExtender/trunk/amdbin/AmdCL2BinGen.cpp

    r3443 r3444  
    20592059   
    20602060    const bool is16_3Ver = (input->driverVersion>=200406);
    2061     AMDGPUArchValues amdGpuArchValues = getGPUArchValues(input->deviceType,
    2062                                 GPUArchValuesTable::AMDCL2);
     2061    AMDGPUArchVersion amdGpuArchValues = getGPUArchVersion(input->deviceType,
     2062                                GPUArchVersionTable::AMDCL2);
    20632063    // fix for old drivers (1912.05)
    20642064    if (!is16_3Ver && input->deviceType==GPUDeviceType::FIJI)
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r3443 r3444  
    168168    }
    169169    // determine device type
    170     GPUDeviceType deviceType = getGPUDeviceTypeFromArchValues(archMajor, archMinor,
     170    GPUDeviceType deviceType = getGPUDeviceTypeFromArchVersion(archMajor, archMinor,
    171171                                    archStepping);
    172172    outArchMinor = archMinor;
     
    272272             Array<cxbyte>* aPtr) const
    273273{
    274     AMDGPUArchValues amdGpuArchValues = getGPUArchValues(input->deviceType,
    275                 GPUArchValuesTable::OPENSOURCE);
     274    AMDGPUArchVersion amdGpuArchValues = getGPUArchVersion(input->deviceType,
     275                GPUArchVersionTable::OPENSOURCE);
    276276    if (input->archMinor!=UINT32_MAX)
    277277        amdGpuArchValues.minor = input->archMinor;
  • CLRadeonExtender/trunk/utils/GPUId.cpp

    r3443 r3444  
    300300
    301301// AMD GPU architecture for Gallium and ROCm
    302 static const AMDGPUArchValues galliumGpuArchValuesTbl[] =
     302static const AMDGPUArchVersion galliumGpuArchVersionTbl[] =
    303303{
    304304    { 0, 0, 0 }, // GPUDeviceType::CAPE_VERDE
     
    329329
    330330// AMDGPU architecture values for specific GPU device type for AMDOCL 2.0
    331 static const AMDGPUArchValues amdCL2GpuArchValuesTbl[] =
     331static const AMDGPUArchVersion amdCL2GpuArchVersionTbl[] =
    332332{
    333333    { 0, 0, 0 }, // GPUDeviceType::CAPE_VERDE
     
    357357};
    358358
    359 AMDGPUArchValues CLRX::getGPUArchValues(GPUDeviceType deviceType, GPUArchValuesTable table)
     359AMDGPUArchVersion CLRX::getGPUArchVersion(GPUDeviceType deviceType, GPUArchVersionTable table)
    360360{
    361361    if (deviceType > GPUDeviceType::GPUDEVICE_MAX)
    362362        throw Exception("Unknown GPU device type");
    363363    // choose correct GPU arch values table
    364     const AMDGPUArchValues* archValuesTable = (table == GPUArchValuesTable::AMDCL2) ?
    365             amdCL2GpuArchValuesTbl : galliumGpuArchValuesTbl;
     364    const AMDGPUArchVersion* archValuesTable = (table == GPUArchVersionTable::AMDCL2) ?
     365            amdCL2GpuArchVersionTbl : galliumGpuArchVersionTbl;
    366366    return archValuesTable[cxuint(deviceType)];
    367367}
    368368
    369 // GPU arch values with device type
    370 struct AMDGPUArchValuesEntry
     369// GPU arch version with device type
     370struct AMDGPUArchVersionEntry
    371371{
    372372    uint32_t major;
     
    377377
    378378// list of AMDGPU arch entries for GPU devices
    379 static const AMDGPUArchValuesEntry amdGpuArchValueEntriesTbl[] =
     379static const AMDGPUArchVersionEntry amdGpuArchVersionEntriesTbl[] =
    380380{
    381381    { 0, 0, 0, GPUDeviceType::CAPE_VERDE },
     
    392392};
    393393
    394 static const size_t amdGpuArchValueEntriesNum = sizeof(amdGpuArchValueEntriesTbl) /
    395                 sizeof(AMDGPUArchValuesEntry);
    396 
    397 GPUDeviceType CLRX::getGPUDeviceTypeFromArchValues(cxuint archMajor, cxuint archMinor,
     394static const size_t amdGpuArchVersionEntriesNum = sizeof(amdGpuArchVersionEntriesTbl) /
     395                sizeof(AMDGPUArchVersionEntry);
     396
     397GPUDeviceType CLRX::getGPUDeviceTypeFromArchVersion(cxuint archMajor, cxuint archMinor,
    398398                            cxuint archStepping)
    399399{
     
    411411   
    412412    // recognize device type by arch major, minor and stepping
    413     for (cxuint i = 0; i < amdGpuArchValueEntriesNum; i++)
    414         if (amdGpuArchValueEntriesTbl[i].major==archMajor &&
    415             amdGpuArchValueEntriesTbl[i].minor==archMinor &&
    416             amdGpuArchValueEntriesTbl[i].stepping==archStepping)
     413    for (cxuint i = 0; i < amdGpuArchVersionEntriesNum; i++)
     414        if (amdGpuArchVersionEntriesTbl[i].major==archMajor &&
     415            amdGpuArchVersionEntriesTbl[i].minor==archMinor &&
     416            amdGpuArchVersionEntriesTbl[i].stepping==archStepping)
    417417        {
    418             deviceType = amdGpuArchValueEntriesTbl[i].deviceType;
     418            deviceType = amdGpuArchVersionEntriesTbl[i].deviceType;
    419419            break;
    420420        }
Note: See TracChangeset for help on using the changeset viewer.