Changeset 3329 in CLRX


Ignore:
Timestamp:
Sep 7, 2017, 3:13:27 PM (10 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmAmdCL2/Gallium: Remove obsolete initializeKernelConfig calls.
Force kernel.useHsaConfig==true after '.control_directive'. InitializeKernelHsa? Config while calling '.config' and '.control_directive'.

Location:
CLRadeonExtender/trunk/amdasm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/AsmAmdCL2Format.cpp

    r3328 r3329  
    796796    asmr.goToSection(pseudoOpPlace, kernel.ctrlDirSection);
    797797    handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
     798    kernel.useHsaConfig = true;
    798799    handler.output.kernels[asmr.currentKernel].hsaConfig = true;
    799800}
     
    924925        target >= AMDCL2CVAL_HSA_FIRST_PARAM)
    925926    {   // hsa config
    926         handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    927         AsmAmdHsaKernelConfig& config = *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
     927        AsmAmdHsaKernelConfig& config =
     928                *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
    928929       
    929930        AsmROCmPseudoOps::setConfigValueMain(config, ROCmConfigValueTarget(
     
    956957            else
    957958            {
    958                 handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    959959                AsmAmdHsaKernelConfig& hsaConfig = *(handler.
    960960                                kernelStates[asmr.currentKernel]->hsaConfig);
     
    967967            else
    968968            {
    969                 handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    970969                AsmAmdHsaKernelConfig& hsaConfig = *(handler.
    971970                                kernelStates[asmr.currentKernel]->hsaConfig);
     
    978977            else
    979978            {
    980                 handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    981979                AsmAmdHsaKernelConfig& hsaConfig = *(handler.
    982980                                kernelStates[asmr.currentKernel]->hsaConfig);
     
    10261024    if (useHsaConfig)
    10271025    {   // hsa config
    1028         handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    1029         AsmAmdHsaKernelConfig& config = *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
     1026        AsmAmdHsaKernelConfig& config =
     1027                *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
    10301028       
    10311029        AsmROCmPseudoOps::setConfigBoolValueMain(config, ROCmConfigValueTarget(
     
    10861084    if (!handler.kernelStates[asmr.currentKernel]->useHsaConfig)
    10871085        handler.output.kernels[asmr.currentKernel].config.dimMask = dimMask;
    1088     else
    1089     {   // if HSA config
    1090         handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
     1086    else // if HSA config
    10911087        handler.kernelStates[asmr.currentKernel]->hsaConfig->dimMask = dimMask;
    1092     }
    10931088}
    10941089
     
    11151110        return;
    11161111   
    1117     handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    1118     AsmAmdHsaKernelConfig* config = handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     1112    AsmAmdHsaKernelConfig* config =
     1113            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
    11191114    config->amdMachineKind = kindValue;
    11201115    config->amdMachineMajor = majorValue;
     
    11431138        return;
    11441139   
    1145     handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    1146     AsmAmdHsaKernelConfig* config = handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     1140    AsmAmdHsaKernelConfig* config =
     1141            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
    11471142    config->amdCodeVersionMajor = majorValue;
    11481143    config->amdCodeVersionMinor = minorValue;
     
    11691164        return;
    11701165   
    1171     handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    1172     AsmAmdHsaKernelConfig* config = handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     1166    AsmAmdHsaKernelConfig* config =
     1167            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
    11731168    if (inVgpr)
    11741169    {
     
    12051200    if (!checkGarbagesAtEnd(asmr, linePtr))
    12061201        return;
    1207     handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    12081202    uint16_t& flags = handler.kernelStates[asmr.currentKernel]->hsaConfig->
    12091203                enableSgprRegisterFlags;
     
    15121506    asmr.goToSection(pseudoOpPlace, kernel.configSection);
    15131507    kernel.useHsaConfig = hsaConfig;
     1508    if (hsaConfig)
     1509        handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
    15141510    handler.output.kernels[asmr.currentKernel].hsaConfig = hsaConfig;
    15151511    handler.output.kernels[asmr.currentKernel].useConfig = true;
  • CLRadeonExtender/trunk/amdasm/AsmGalliumFormat.cpp

    r3328 r3329  
    563563    else
    564564    {    // AMD HSA
    565         handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    566         AsmAmdHsaKernelConfig& config = *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
     565        AsmAmdHsaKernelConfig& config =
     566                *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
    567567        config.dimMask = dimMask;
    568568    }
     
    754754    if (target >= GALLIUMCVAL_HSA_FIRST_PARAM)
    755755    {
    756         handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    757         AsmAmdHsaKernelConfig& config = *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
     756        AsmAmdHsaKernelConfig& config = *(
     757                    handler.kernelStates[asmr.currentKernel]->hsaConfig);
    758758       
    759759        AsmROCmPseudoOps::setConfigValueMain(config,
     
    806806    if (target >= GALLIUMCVAL_HSA_FIRST_PARAM)
    807807    {
    808         handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    809         AsmAmdHsaKernelConfig& config = *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
     808        AsmAmdHsaKernelConfig& config =
     809                *(handler.kernelStates[asmr.currentKernel]->hsaConfig);
    810810       
    811811        AsmROCmPseudoOps::setConfigBoolValueMain(config,
     
    833833        return;
    834834   
    835     handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    836     AsmAmdHsaKernelConfig* config = handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     835    AsmAmdHsaKernelConfig* config =
     836            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
    837837    config->enableSgprRegisterFlags =
    838838                    uint16_t(AMDHSAFLAG_USE_PRIVATE_SEGMENT_BUFFER|
     
    864864        return;
    865865   
    866     handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    867     AsmAmdHsaKernelConfig* config = handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     866    AsmAmdHsaKernelConfig* config =
     867            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
    868868    config->amdMachineKind = kindValue;
    869869    config->amdMachineMajor = majorValue;
     
    893893        return;
    894894   
    895     handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    896     AsmAmdHsaKernelConfig* config = handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     895    AsmAmdHsaKernelConfig* config =
     896            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
    897897    config->amdCodeVersionMajor = majorValue;
    898898    config->amdCodeVersionMinor = minorValue;
     
    920920        return;
    921921   
    922     handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    923     AsmAmdHsaKernelConfig* config = handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     922    AsmAmdHsaKernelConfig* config =
     923            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
    924924    if (inVgpr)
    925925    {
     
    956956    if (!checkGarbagesAtEnd(asmr, linePtr))
    957957        return;
    958     handler.kernelStates[asmr.currentKernel]->initializeAmdHsaKernelConfig();
    959958    uint16_t& flags = handler.kernelStates[asmr.currentKernel]->hsaConfig->
    960959                enableSgprRegisterFlags;
Note: See TracChangeset for help on using the changeset viewer.