Changeset 5743 for icGREP/icgrep-devel


Ignore:
Timestamp:
Nov 25, 2017, 12:43:21 PM (18 months ago)
Author:
cameron
Message:

Propagate target triple and data layout in kernel module creation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5733 r5743  
    164164 ** ------------------------------------------------------------------------------------------------------------- */
    165165Module * Kernel::makeModule(const std::unique_ptr<kernel::KernelBuilder> & idb) {
    166     return setModule(new Module(getCacheName(idb), idb->getContext()));
     166    Module * m = new Module(getCacheName(idb), idb->getContext());
     167    m->setTargetTriple(idb->getModule()->getTargetTriple());
     168    m->setDataLayout(idb->getModule()->getDataLayout());
     169    return setModule(m);
    167170}
    168171
     
    180183    // NOTE: StructType::create always creates a new type even if an identical one exists.
    181184    if (LLVM_UNLIKELY(mModule == nullptr)) {
    182         setModule(new Module(getCacheName(idb), idb->getContext()));
     185        makeModule(idb);
    183186    }
    184187    mKernelStateType = mModule->getTypeByName(getName());
Note: See TracChangeset for help on using the changeset viewer.