Changeset 3211 in CLRX


Ignore:
Timestamp:
Jun 28, 2017, 4:30:43 PM (22 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmGallium?: Add auto-detection of LLVM version and Mesa3D version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/AsmGalliumFormat.cpp

    r3194 r3211  
    326326    cxuint driverVersion = 0;
    327327    if (getLLVMVersion)
    328         driverVersion = asmr.llvmVersion;
     328    {
     329        if (asmr.llvmVersion == 0)
     330            driverVersion = detectLLVMCompilerVersion();
     331        else
     332            driverVersion = asmr.llvmVersion;
     333    }
    329334    else
    330         driverVersion = asmr.driverVersion;
     335    {
     336        if (asmr.driverVersion == 0)
     337            driverVersion = detectMesaDriverVersion();
     338        else
     339            driverVersion = asmr.driverVersion;
     340    }
    331341   
    332342    std::pair<AsmSymbolEntry*, bool> res = asmr.insertSymbolInScope(symName,
     
    12991309    const AsmSymbolMap& symbolMap = assembler.getSymbolMap();
    13001310   
     1311    cxuint llvmVersion = assembler.llvmVersion;
     1312    if (llvmVersion == 0)
     1313        llvmVersion = detectLLVMCompilerVersion();
     1314   
    13011315    const cxuint ldsShift = arch<GPUArchitecture::GCN1_1 ? 8 : 9;
    13021316    const uint32_t ldsMask = (1U<<ldsShift)-1U;
     
    13321346        }
    13331347        kinput.offset = symbol.value;
    1334         if (assembler.llvmVersion >= 40000U)
     1348        if (llvmVersion >= 40000U)
    13351349        {   // requires amdhsa-gcn (with HSA header)
    13361350            // hotfix
     
    14141428    }
    14151429    // set versions
    1416     output.isMesa170 = assembler.driverVersion >= 170000U;
    1417     output.isLLVM390 = assembler.llvmVersion >= 30900U;
     1430    if (assembler.driverVersion == 0) // auto detection
     1431        output.isMesa170 = detectMesaDriverVersion() >= 170000U;
     1432    else
     1433        output.isMesa170 = assembler.driverVersion >= 170000U;
     1434    output.isLLVM390 = llvmVersion >= 30900U;
    14181435    return good;
    14191436}
Note: See TracChangeset for help on using the changeset viewer.