Changeset 3284 in CLRX


Ignore:
Timestamp:
Sep 1, 2017, 9:15:09 PM (10 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmGallium?: Keep default values for enableSgprRegisterFlags and enableFeatureFlags in
AMD HSA config if these config params not set. Replace AMD HSA config only if kernel uses config (.config pseudo-op used).

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r3282 r3284  
    21492149        }
    21502150        kinput.offset = symbol.value;
    2151         if (llvmVersion >= 40000U)
     2151        if (llvmVersion >= 40000U && output.kernels[ki].useConfig)
    21522152        {   // requires amdhsa-gcn (with HSA header)
    21532153            // hotfix
     
    21632163            if (kernel.config != nullptr)
    21642164            {   // replace by HSA config
    2165                 ::memcpy(&outConfig, kernel.config.get(),
    2166                         sizeof(AmdHsaKernelConfig));
     2165                ::memcpy(&outConfig, kernel.config.get(), sizeof(AmdHsaKernelConfig));
    21672166                // set config from HSA config
    21682167                const AsmAmdHsaKernelConfig& hsaConfig = *kernel.config.get();
     
    21882187                if (hsaConfig.workitemPrivateSegmentSize != BINGEN_DEFAULT) // scratch buffer
    21892188                    config.scratchBufferSize = hsaConfig.workitemPrivateSegmentSize;
     2189               
     2190                if (outConfig.enableSgprRegisterFlags == 0)
     2191                    outConfig.enableSgprRegisterFlags =
     2192                        uint16_t(AMDHSAFLAG_USE_PRIVATE_SEGMENT_BUFFER|
     2193                            AMDHSAFLAG_USE_DISPATCH_PTR|AMDHSAFLAG_USE_KERNARG_SEGMENT_PTR);
     2194                if (outConfig.enableFeatureFlags == 0)
     2195                    outConfig.enableFeatureFlags = uint16_t(AMDHSAFLAG_USE_PTR64|2);
    21902196            }
    21912197           
  • CLRadeonExtender/trunk/tests/amdasm/AsmGalliumFormat.cpp

    r3283 r3284  
    489489      computePgmRsrc1=0x8eb662
    490490      computePgmRsrc2=0x7fbd1
    491       enableSgprRegisterFlags=0x0
    492       enableFeatureFlags=0x0
     491      enableSgprRegisterFlags=0xb
     492      enableFeatureFlags=0xa
    493493      workitemPrivateSegmentSize=230
    494494      workgroupGroupSegmentSize=22
     
    529529      computePgmRsrc1=0x8c0c40
    530530      computePgmRsrc2=0x1310
    531       enableSgprRegisterFlags=0x0
    532       enableFeatureFlags=0x0
     531      enableSgprRegisterFlags=0xb
     532      enableFeatureFlags=0xa
    533533      workitemPrivateSegmentSize=0
    534534      workgroupGroupSegmentSize=0
     
    562562  Code:
    563563  0100000000000000010000000000000000010000000000000000000000000000
    564   0000000000000000000000000000000062b68e00d1fb070000000000e6000000
     564  0000000000000000000000000000000062b68e00d1fb07000b000a00e6000000
    565565  16000000640000001000000000000000fc0c00004f008b000000000000000000
    566566  6000620005040406ac4d03000000000000000000000000000000000000000000
     
    570570  0000000000000000000000000000000000000000000000000000000000000000
    571571  010000000000000001000000000000000001000000000000ea03000000000000
    572   77340000000000007410000000000000400c8c00101300000000000000000000
     572  77340000000000007410000000000000400c8c00101300000b000a0000000000
    573573  0000000000000000e400000000000000000000000c0003001a0017000c000800
    574574  0000000006070406000000000000000000000000000000000000000000000000
Note: See TracChangeset for help on using the changeset viewer.