Changeset 2603 in CLRX


Ignore:
Timestamp:
Dec 1, 2016, 7:18:28 PM (3 years ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: put config to code (prepareBinary). Add BINGENXX_XX enums.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdbin/ElfBinaries.h

    r2590 r2603  
    5757};
    5858
     59enum: uint16_t {
     60    BINGEN16_DEFAULT = UINT16_MAX,    ///< if set in field then field has been filled later
     61    BINGEN16_NOTSUPPLIED  = UINT16_MAX-1 ///< if set in field then field has been ignored
     62};
     63
     64enum: uint8_t {
     65    BINGEN8_DEFAULT = UINT8_MAX,    ///< if set in field then field has been filled later
     66    BINGEN8_NOTSUPPLIED  = UINT8_MAX-1 ///< if set in field then field has been ignored
     67};
    5968
    6069enum : Flags {
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r2602 r2603  
    280280        config.reset(new AsmROCmKernelConfig{});
    281281        ::memset(config.get(), 0, sizeof(AsmROCmKernelConfig));
     282        config->amdCodeVersionMajor = BINGEN_DEFAULT;
     283        config->amdCodeVersionMinor = BINGEN_DEFAULT;
    282284    }
    283285}
     
    11671169    for (size_t i = 0; i < kernelStates.size(); i++)
    11681170    {
    1169         const Kernel* kernel = kernelStates[i];
    1170         if (kernel->config.get() == nullptr)
     1171        const Kernel& kernel = *kernelStates[i];
     1172        if (kernel.config.get() == nullptr)
    11711173            continue;
    11721174        const CString& kernelName = assembler.kernels[i].name;
    1173         AsmROCmKernelConfig& config = *kernel->config.get();
     1175        AsmROCmKernelConfig& config = *kernel.config.get();
    11741176        // setup config
    1175         cxuint userSGPRsNum = 4;
     1177        //config.enableSpgrRegisterFlags = (config.enableSpgrRegisterFlags&~64) |
     1178        cxuint userSGPRsNum = config.userDataNum;
    11761179        /* include userData sgprs */
    11771180        cxuint dimMask = (config.dimMask!=BINGEN_DEFAULT) ? config.dimMask :
     
    12331236        SLEV(config.callConvention, config.callConvention);
    12341237        SLEV(config.runtimeLoaderKernelSymbol, config.runtimeLoaderKernelSymbol);
     1238        // put control directive section to config
     1239        if (kernel.ctrlDirSection!=ASMSECT_NONE)
     1240            ::memcpy(config.controlDirective,
     1241                 assembler.sections[kernel.ctrlDirSection].content.data(), 128);
    12351242    }
    12361243   
     
    12651272            continue;
    12661273        }
     1274        const Kernel& kernel = *kernelStates[ki];
    12671275        kinput.offset = symbol.value;
     1276        if (kernel.config!=nullptr) // put config to code section
     1277            ::memcpy(assembler.sections[codeSection].content.data() + symbol.value,
     1278                     kernel.config.get(), sizeof(ROCmKernelConfig));
    12681279        // set symbol type
    1269         kinput.type = kernelStates[ki]->isFKernel ? ROCmRegionType::FKERNEL :
    1270                 ROCmRegionType::KERNEL;
     1280        kinput.type = kernel.isFKernel ? ROCmRegionType::FKERNEL : ROCmRegionType::KERNEL;
    12711281    }
    12721282    return good;
Note: See TracChangeset for help on using the changeset viewer.