Ignore:
Timestamp:
Feb 6, 2018, 7:10:25 PM (22 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmGallium?: Remove obsolete (stupid) checking spilled GPRs.
AsmROCm: Add first stuff to handling ROCm metadata config. ROCmBin: Checking uniqueness of printf ids.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r3726 r3727  
    2727#include <algorithm>
    2828#include <utility>
     29#include <unordered_set>
    2930#include <CLRX/amdbin/ElfBinaries.h>
    3031#include <CLRX/utils/Utilities.h>
     
    530531class CLRX_INTERNAL YAMLPrintfVectorConsumer: public YAMLElemConsumer
    531532{
     533private:
     534    std::unordered_set<cxuint> printfIds;
    532535public:
    533536    std::vector<ROCmPrintfInfo>& printfInfos;
     
    553556        catch(const ParseException& ex)
    554557        { throw ParseException(oldLineNo, ex.what()); }
     558       
     559        // check printf id uniqueness
     560        if (!printfIds.insert(printfInfo.id).second)
     561            throw ParseException(oldLineNo, "Duplicate of printf id");
     562       
    555563        skipSpacesToLineEnd(ptr2, end2);
    556564        if (ptr2==end || *ptr2!=':')
     
    15621570    if (!mdInfo.printfInfos.empty())
    15631571        output += "Printf:          \n";
     1572    // check print ids uniquness
     1573    {
     1574        std::unordered_set<cxuint> printfIds;
     1575        for (const ROCmPrintfInfo& printfInfo: mdInfo.printfInfos)
     1576            if (!printfIds.insert(printfInfo.id).second)
     1577                throw BinGenException("Duplicate of printf id");
     1578    }
    15641579    // printfs
    15651580    for (const ROCmPrintfInfo& printfInfo: mdInfo.printfInfos)
Note: See TracChangeset for help on using the changeset viewer.