Changeset 4937 in CLRX


Ignore:
Timestamp:
Aug 25, 2019, 9:28:20 PM (3 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: ROCm: Switch wave32 between kernels (include ROCmKernelDescriptor wave32 flag).

Location:
CLRadeonExtender/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdasm/Disassembler.h

    r4931 r4937  
    189189    void flushOutput()
    190190    { return output.flush(); }
     191   
     192    /// get disassemblers flags
     193    Flags getFlags() const;
     194    /// set disassemblers flags
     195    void setFlags(Flags flags);
    191196};
    192197
     
    479484    Flags getFlags() const
    480485    { return flags; }
    481     /// get disassemblers flags
     486    /// set disassemblers flags
    482487    void setFlags(Flags flags)
    483488    { this->flags = flags; }
     
    505510    { return output; }
    506511};
     512
     513/// get disassemblers flags
     514inline Flags ISADisassembler::getFlags() const
     515{ return disassembler.getFlags(); }
     516/// set disassemblers flags
     517inline void ISADisassembler::setFlags(Flags flags)
     518{ disassembler.setFlags(flags); }
    507519
    508520// routines to get binary config inputs
  • CLRadeonExtender/trunk/CLRX/amdbin/Commons.h

    r4199 r4937  
    5252    AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Y = 256,    ///< use workgroup count for Y dim
    5353    AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Z = 512,    ///< use workgroup count for Z dim
     54   
     55    AMDHSAFLAG_USE_WAVE32 = (1U<<10),
    5456   
    5557    AMDHSAFLAG_USE_ORDERED_APPEND_GDS = 1,  /// use ordered append gds
  • CLRadeonExtender/trunk/CLRX/amdbin/ROCmBinaries.h

    r4931 r4937  
    381381    ROCMFLAG_USE_GRID_WORKGROUP_COUNT_Y = AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Y,
    382382    ROCMFLAG_USE_GRID_WORKGROUP_COUNT_Z = AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_Z,
     383    ROCMFLAG_USE_WAVE32 = AMDHSAFLAG_USE_WAVE32,
    383384   
    384385    ROCMFLAG_USE_ORDERED_APPEND_GDS = AMDHSAFLAG_USE_ORDERED_APPEND_GDS,
  • CLRadeonExtender/trunk/amdasm/DisasmInternals.h

    r4935 r4937  
    7272            const std::vector<ROCmDisasmRegionInput>& regions,
    7373            size_t codeSize, const cxbyte* code, ISADisassembler* isaDisassembler,
    74             Flags flags, bool llvm10BinFormat = false);
     74            Flags flags, bool llvm10BinFormat = false,
     75            const std::vector<const ROCmKernelDescriptor*>& kdescs =
     76                std::vector<const ROCmKernelDescriptor*>());
    7577
    7678// disassemble Gallium binary input
  • CLRadeonExtender/trunk/amdasm/DisasmROCm.cpp

    r4935 r4937  
    218218    if ((sgprFlags&ROCMFLAG_USE_PRIVATE_SEGMENT_SIZE) != 0)
    219219        output.write("        .use_private_segment_size\n", 34);
    220     if ((sgprFlags&(1U<<10)) != 0)
    221         output.write("        .wave32\n", 16);
     220    if ((sgprFlags&AMDHSAFLAG_USE_WAVE32) != 0)
     221        output.write("        .use_wave32\n", 20);
    222222}
    223223
     
    568568            const std::vector<ROCmDisasmRegionInput>& regions,
    569569            size_t codeSize, const cxbyte* code, ISADisassembler* isaDisassembler,
    570             Flags flags, bool llvm10BinFormat)
     570            Flags flags, bool llvm10BinFormat,
     571            const std::vector<const ROCmKernelDescriptor*>& kernelDescs)
    571572{
    572573    const bool doDumpData = ((flags & DISASM_DUMPDATA) != 0);
     
    676677                                code + region.offset+kconfigSize,
    677678                                region.offset+kconfigSize, region.offset+1);
     679                if (llvm10BinFormat)
     680                {
     681                    const ROCmKernelDescriptor* kdesc = kernelDescs[sorted[i].second];
     682                    if (kdesc!=nullptr)
     683                    {
     684                        Flags flags = isaDisassembler->getFlags() & ~DISASM_WAVE32;
     685                        if (kdesc->initialKernelExecState & ROCMFLAG_USE_WAVE32)
     686                            flags |= DISASM_WAVE32;
     687                        isaDisassembler->setFlags(flags);
     688                    }
     689                }
    678690                isaDisassembler->setDontPrintLabels(i+1<regionsNum);
    679691                isaDisassembler->disassemble();
     
    11011113    // disassembly code in HSA form
    11021114    if (rocmInput->code != nullptr && rocmInput->codeSize != 0)
    1103         disassembleAMDHSACode(output, rocmInput->regions, rocmInput->codeSize,
    1104                     rocmInput->code, isaDisassembler, flags, rocmInput->llvm10BinFormat);
     1115        disassembleAMDHSACode(output, rocmInput->regions,
     1116                    rocmInput->codeSize, rocmInput->code, isaDisassembler,
     1117                    flags, rocmInput->llvm10BinFormat, rocmInput->kernelDescs);
    11051118}
Note: See TracChangeset for help on using the changeset viewer.