Changeset 3681 in CLRX


Ignore:
Timestamp:
Jan 31, 2018, 7:18:52 AM (15 months ago)
Author:
matszpk
Message:

CLRadeonExtender: ROCmBin: Make constructors for ROCmMetadata and ROCmKernelMetadata. Initialize values for CodeProps? after opening it.
Reorder ROCmAccessQualifier enums.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r3680 r3681  
    116116enum class ROCmAccessQual: cxbyte
    117117{
    118     READ_ONLY = 0,
     118    DEFAULT = 0,
     119    READ_ONLY,
    119120    WRITE_ONLY,
    120121    READ_WRITE,
    121     DEFAULT
    122122};
    123123
     
    134134    ROCmAddressSpace addressSpace;  ///< pointer address space
    135135    ROCmAccessQual accessQual;      ///< access qualifier (for images and values)
    136     ROCmAccessQual actualAccessQual;    ///< access qualifier to resource data
     136    ROCmAccessQual actualAccessQual;    ///< actual access qualifier
    137137    bool isConst;       ///< is constant
    138138    bool isRestrict;    ///< is restrict
     
    161161    cxuint vgprsNum;        ///< number of VGPRs
    162162    uint64_t maxFlatWorkGroupSize;
    163     uint64_t fixedWorkGroupSize[3];
     163    cxuint fixedWorkGroupSize[3];
    164164    cxuint spilledSgprs;    ///< number of spilled SGPRs
    165165    cxuint spilledVgprs;    ///< number of spilled VGPRs
     166   
     167    ROCmKernelMetadata();
    166168};
    167169
     
    180182    std::vector<ROCmPrintfInfo> printfInfos;  ///< printf calls infos
    181183    std::vector<ROCmKernelMetadata> kernels;  ///< kernel metadatas
     184   
     185    ROCmMetadata();
    182186};
    183187
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r3680 r3681  
    3939 * ROCm metadata YAML parser
    4040 */
     41
     42ROCmKernelMetadata::ROCmKernelMetadata() :
     43    langVersion{ BINGEN_NOTSUPPLIED, BINGEN_NOTSUPPLIED },
     44    reqdWorkGroupSize{ BINGEN_NOTSUPPLIED, BINGEN_NOTSUPPLIED, BINGEN_NOTSUPPLIED },
     45    workGroupSizeHint{ BINGEN_NOTSUPPLIED, BINGEN_NOTSUPPLIED, BINGEN_NOTSUPPLIED },
     46    kernargSegmentSize(BINGEN64_NOTSUPPLIED),
     47    groupSegmentFixedSize(BINGEN64_NOTSUPPLIED),
     48    privateSegmentFixedSize(BINGEN64_NOTSUPPLIED),
     49    kernargSegmentAlign(BINGEN64_NOTSUPPLIED),
     50    wavefrontSize(BINGEN_NOTSUPPLIED),
     51    sgprsNum(BINGEN_NOTSUPPLIED), vgprsNum(BINGEN_NOTSUPPLIED),
     52    maxFlatWorkGroupSize(BINGEN64_NOTSUPPLIED),
     53    fixedWorkGroupSize{ BINGEN_NOTSUPPLIED, BINGEN_NOTSUPPLIED, BINGEN_NOTSUPPLIED },
     54    spilledSgprs(BINGEN_NOTSUPPLIED),
     55    spilledVgprs(BINGEN_NOTSUPPLIED)
     56{ }
     57
     58ROCmMetadata::ROCmMetadata() : version{ 0, 0 }
     59{ }
    4160
    4261// return trailing spaces
     
    574593
    575594static const char* rocmAccessQualifierTbl[] =
    576 { "ReadOnly", "WriteOnly", "ReadWrite", "Default" };
     595{ "Default", "ReadOnly", "WriteOnly", "ReadWrite" };
    577596
    578597void parseROCmMetadata(size_t metadataSize, const char* metadata,
     
    691710            inKernel = true;
    692711           
    693             kernels.push_back(ROCmKernelMetadata{});
     712            kernels.push_back(ROCmKernelMetadata());
    694713        }
    695714       
     
    712731                    break;
    713732                case ROCMMT_KERNEL_CODEPROPS:
     733                    kernel.kernargSegmentSize = BINGEN64_DEFAULT;
     734                    kernel.groupSegmentFixedSize = BINGEN64_DEFAULT;
     735                    kernel.privateSegmentFixedSize = BINGEN64_DEFAULT;
     736                    kernel.kernargSegmentAlign = BINGEN64_DEFAULT;
     737                    kernel.wavefrontSize = BINGEN_DEFAULT;
     738                    kernel.sgprsNum = BINGEN_DEFAULT;
     739                    kernel.vgprsNum = BINGEN_DEFAULT;
     740                    kernel.maxFlatWorkGroupSize = BINGEN64_DEFAULT;
    714741                    inKernelCodeProps = true;
    715742                    canToNextLevel = true;
     
    778805                case ROCMMT_CODEPROPS_FIXED_WORK_GROUP_SIZE:
    779806                {
    780                     YAMLIntArrayConsumer<uint64_t> consumer(3, kernel.fixedWorkGroupSize);
     807                    YAMLIntArrayConsumer<cxuint> consumer(3, kernel.fixedWorkGroupSize);
    781808                    parseYAMLValArray(ptr, end, lineNo, level, &consumer);
    782809                    break;
     
    784811                case ROCMMT_CODEPROPS_GROUP_SEGMENT_FIXED_SIZE:
    785812                    kernel.groupSegmentFixedSize =
    786                                 parseYAMLIntValue<uint64_t>(ptr, end, lineNo);
     813                                parseYAMLIntValue<cxuint>(ptr, end, lineNo);
    787814                    break;
    788815                case ROCMMT_CODEPROPS_KERNARG_SEGMENT_ALIGN:
Note: See TracChangeset for help on using the changeset viewer.