Changeset 4939 in CLRX


Ignore:
Timestamp:
Aug 31, 2019, 9:32:54 AM (3 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: ROCm: Add ROCmDisasmKernelDescInfo and use it in code.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

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

    r4937 r4939  
    312312};
    313313
     314struct ROCmDisasmKernelDescInfo
     315{
     316    size_t sectionOffset;
     317    const ROCmKernelDescriptor* desc;
     318};
     319
    314320/// disasm ROCm input
    315321struct ROCmDisasmInput
     
    331337    const char* metadata;   ///< metadata
    332338    Array<std::pair<CString, size_t> > gotSymbols; ///< GOT symbols names
    333     std::vector<const ROCmKernelDescriptor*> kernelDescs; ///< kernel descriptors
     339    std::vector<ROCmDisasmKernelDescInfo> kernelDescs; ///< kernel descriptors
    334340};
    335341
  • CLRadeonExtender/trunk/amdasm/DisasmInternals.h

    r4937 r4939  
    7373            size_t codeSize, const cxbyte* code, ISADisassembler* isaDisassembler,
    7474            Flags flags, bool llvm10BinFormat = false,
    75             const std::vector<const ROCmKernelDescriptor*>& kdescs =
    76                 std::vector<const ROCmKernelDescriptor*>());
     75            const std::vector<ROCmDisasmKernelDescInfo>& kdescs =
     76                std::vector<ROCmDisasmKernelDescInfo>());
    7777
    7878// disassemble Gallium binary input
  • CLRadeonExtender/trunk/amdasm/DisasmROCm.cpp

    r4938 r4939  
    5555    if (binary.isLLVM10BinaryFormat())
    5656    {
    57         input->kernelDescs.resize(regionsNum);
     57        input->kernelDescs.resize(regionsNum, ROCmDisasmKernelDescInfo{});
    5858        for (size_t i = 0; i < regionsNum; i++)
    59             input->kernelDescs[i] = binary.getKernelDescriptor(i);
     59        {
     60            input->kernelDescs[i].sectionOffset = reinterpret_cast<const cxbyte*>(
     61                binary.getKernelDescriptor(i)) - binary.getGlobalData();
     62            input->kernelDescs[i].desc = binary.getKernelDescriptor(i);
     63        }
    6064    }
    6165   
     
    571575            size_t codeSize, const cxbyte* code, ISADisassembler* isaDisassembler,
    572576            Flags flags, bool llvm10BinFormat,
    573             const std::vector<const ROCmKernelDescriptor*>& kernelDescs)
     577            const std::vector<ROCmDisasmKernelDescInfo>& kernelDescs)
    574578{
    575579    const bool doDumpData = ((flags & DISASM_DUMPDATA) != 0);
     
    681685                if (llvm10BinFormat)
    682686                {
    683                     const ROCmKernelDescriptor* kdesc = kernelDescs[sorted[i].second];
     687                    const ROCmKernelDescriptor* kdesc = kernelDescs[sorted[i].second].desc;
    684688                    if (kdesc!=nullptr)
    685689                    {
     
    10361040        output.write(".globaldata\n", 12);
    10371041        output.write(".gdata:\n", 8); /// symbol used by text relocations
    1038         if (rocmInput->llvm10BinFormat)
     1042        //if (rocmInput->llvm10BinFormat)
    10391043            printDisasmData(rocmInput->globalDataSize, rocmInput->globalData, output);
    1040         else
    1041         {
    1042             rocmInput->kernelDescs.
    1043         }
     1044        /*else
     1045        {
     1046        }*/
    10441047    }
    10451048   
     
    11021105                        *reinterpret_cast<const ROCmKernelConfig*>(
    11031106                                rocmInput->code + rinput.offset));
    1104                 else if (rocmInput->kernelDescs[i]!=nullptr)
     1107                else if (rocmInput->kernelDescs[i].desc!=nullptr)
    11051108                    dumpKernelDescriptor(output, maxSgprsNum, arch,
    1106                                 *(rocmInput->kernelDescs[i]));
     1109                                *(rocmInput->kernelDescs[i].desc));
    11071110               
    11081111                if (!haveMetadataInfo)
Note: See TracChangeset for help on using the changeset viewer.