Changeset 4928 in CLRX


Ignore:
Timestamp:
Aug 24, 2019, 1:05:59 PM (3 months ago)
Author:
matszpk
Message:

CLRadeonExtender: ROCm: Remove unsetting globalData in ROCmBinary constructor. Add getKernelDescriptor methods.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r4926 r4928  
    4747    ROCMBIN_CREATE_METADATAINFO = 0x20,     ///< create metadata info object
    4848    ROCMBIN_CREATE_KERNELINFOMAP = 0x40,    ///< create kernel metadata info map
    49     ROCMBIN_CREATE_KERNELDESCMAP = 0x80,    ///< create kernel descriptor map
    5049    ROCMBIN_CREATE_ALL = ELF_CREATE_ALL | 0xfff0 ///< all ROCm binaries flags
    5150};
     
    328327    const ROCmKernelMetadata& getKernelInfo(const char* name) const;
    329328   
     329    /// get kernel descriptor
     330    const ROCmKernelDescriptor& getKernelDescriptor(size_t index) const
     331    {
     332        if (kernelDescs[index]==nullptr)
     333            throw BinException("No kernel descriptor for region index");
     334        return *(kernelDescs[index]);
     335    }
     336    // get kernel descriptor by name
     337    const ROCmKernelDescriptor& getKernelDescriptor(const char* name) const;
     338   
    330339    /// get target
    331340    const CString& getTarget() const
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r4927 r4928  
    307307        }
    308308    }
    309    
    310     if (llvm10BinFormat)
    311     {
    312         // remove global data for LLVM10 bin format
    313         globalData = nullptr;
    314         globalDataSize = 0;
    315     }
    316309}
    317310
     
    350343        }
    351344    }
     345    if (llvm10BinFormat && archMajor==0 && archMajor==0 && archStepping==0)
     346    {
     347        // default is Navi
     348        outArchMinor = 1;
     349        outArchStepping = 0;
     350        return GPUDeviceType::GFX1010;
     351    }
    352352    // determine device type
    353353    GPUDeviceType deviceType = getGPUDeviceTypeFromArchVersion(archMajor, archMinor,
     
    376376        throw BinException("Can't find kernel info name");
    377377    return metadataInfo->kernels[it->second];
     378}
     379
     380const ROCmKernelDescriptor& ROCmBinary::getKernelDescriptor(const char* name) const
     381{
     382    RegionMap::const_iterator it = binaryMapFind(regionsMap.begin(),
     383                             regionsMap.end(), name);
     384    if (it == regionsMap.end())
     385        throw BinException("Can't find kernel descriptor name");
     386    if (kernelDescs[it->second]==nullptr)
     387        throw BinException("No kernel descriptor for region name");
     388    return *(kernelDescs[it->second]);
    378389}
    379390
Note: See TracChangeset for help on using the changeset viewer.