Changeset 2500 in CLRX


Ignore:
Timestamp:
Oct 29, 2016, 9:32:18 PM (4 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Add ROCmBinaries.cpp.

Location:
CLRadeonExtender/trunk
Files:
1 added
2 edited

Legend:

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

    r2499 r2500  
    3030#include <string>
    3131#include <CLRX/amdbin/Elf.h>
     32#include <CLRX/amdbin/ElfBinaries.h>
    3233#include <CLRX/utils/MemAccess.h>
    3334#include <CLRX/utils/Containers.h>
     
    4647
    4748/// ROCm GPU metadata for kernel
    48 struct ROCmGPUKernel
     49struct ROCmKernel
    4950{
    5051    CString kernelName; ///< kernel name
     
    5960 * Only it takes and uses a binary code.
    6061 */
    61 class ROCmMainGPUBinary : public ElfBinary64
     62class ROCmBinary : public ElfBinary64, public NonCopyableAndNonMovable
    6263{
    6364public:
    64     typedef Array<std::pair<CString, size_t> > MetadataMap;
    65 protected:
     65    typedef Array<std::pair<CString, size_t> > KernelMap;
     66private:
    6667    size_t kernelsNum;
    67     std::unique_ptr<ROCmGPUKernel[]> kernels;  ///< AMD metadatas
     68    std::unique_ptr<ROCmKernel[]> kernels;  ///< AMD metadatas
     69    KernelMap kernelsMap;
    6870public:
     71    ROCmBinary(size_t binaryCodeSize, cxbyte* binaryCode,
     72            Flags creationFlags = ROCMBIN_CREATE_ALL);
     73    ~ROCmBinary() = default;
     74   
     75    size_t getKernelsNum() const
     76    { return kernelsNum; }
     77   
     78    /// get kernel by index
     79    const ROCmKernel& getKernel(size_t index) const
     80    { return kernels[index]; }
     81   
     82    /// get kernel by name
     83    const ROCmKernel& getKernel(const char* name) const;
    6984};
    7085
  • CLRadeonExtender/trunk/amdbin/CMakeLists.txt

    r2431 r2500  
    2626        AmdCL2BinGen.cpp
    2727        ElfBinaries.cpp
    28         GalliumBinaries.cpp)
     28        GalliumBinaries.cpp
     29        ROCmBinaries.cpp)
    2930
    3031SET(LINK_LIBRARIES CLRXUtils)
Note: See TracChangeset for help on using the changeset viewer.