Changeset 4988 in CLRX


Ignore:
Timestamp:
Sep 23, 2019, 9:03:30 AM (3 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: GPUId: Count VCC as 1 extra SGPR register if Navi and WAVE32.

Location:
CLRadeonExtender/trunk
Files:
4 edited

Legend:

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

    r4973 r4988  
    176176    GCN_VCC = 1,
    177177    GCN_FLAT = 2,
    178     GCN_XNACK = 4
     178    GCN_XNACK = 4,
     179    GCN_REG_WAVE32 = 8
    179180};
    180181
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r4987 r4988  
    25412541            config.usedSGPRsNum = std::min(
    25422542                std::max(minRegsNum[0], kernelStates[i]->allocRegs[0]) +
    2543                     getGPUExtraRegsNum(arch, REGTYPE_SGPR, flags|GCN_VCC),
     2543                    getGPUExtraRegsNum(arch, REGTYPE_SGPR, flags|GCN_VCC|
     2544                        ((config.enableSgprRegisterFlags & ROCMFLAG_USE_WAVE32) ?
     2545                                GCN_REG_WAVE32 : 0)),
    25442546                    maxSGPRsNum); // include all extra sgprs
    25452547        }
  • CLRadeonExtender/trunk/tests/amdasm/AsmRegPool.cpp

    r4987 r4988  
    455455        s_endpgm
    456456        )ffDXD",
    457         { { "a1", 2, 1, ASM_CODE_WAVE32 }, { "a2", 2, 1, 0 } }
     457        { { "a1", 1, 1, ASM_CODE_WAVE32 }, { "a2", 2, 1, 0 } }
    458458    }
    459459};
  • CLRadeonExtender/trunk/utils/GPUId.cpp

    r4973 r4988  
    362362cxuint CLRX::getGPUExtraRegsNum(GPUArchitecture architecture, cxuint regType, Flags flags)
    363363{
     364    const cxuint vccCount = (architecture >= GPUArchitecture::GCN1_5 &&
     365                (flags&GCN_REG_WAVE32)!=0) ? 1 : 2;
    364366    if (regType == REGTYPE_VGPR)
    365367        return 0;
    366368    if ((flags & GCN_FLAT)!=0 && (architecture>GPUArchitecture::GCN1_0))
    367         return (architecture>=GPUArchitecture::GCN1_2) ? 6 : 4;
     369        return ((architecture>=GPUArchitecture::GCN1_2) ? 4 : 2) + vccCount;
    368370    else if ((flags & GCN_XNACK)!=0 && (architecture>GPUArchitecture::GCN1_1))
    369         return 4;
     371        return 2+vccCount;
    370372    else if ((flags & GCN_VCC)!=0)
    371         return 2;
     373        return vccCount;
    372374    return 0;
    373375}
Note: See TracChangeset for help on using the changeset viewer.