Ignore:
Timestamp:
Nov 3, 2018, 3:39:55 PM (7 months ago)
Author:
nmedfort
Message:

Potential bug fix for u32u8. CPUDriver only constructs the pass manager if uncached kernels exist.

File:
1 edited

Legend:

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

    r6186 r6187  
    146146 * @brief addScalarToMap
    147147 ** ------------------------------------------------------------------------------------------------------------- */
    148 void Kernel::addScalarToMap(const std::string & name, const ScalarType scalarType, const unsigned index) {
    149     const auto r = mScalarMap.emplace(name, ScalarField{scalarType, index});
     148void Kernel::addScalarToMap(const llvm::StringRef name, const ScalarType scalarType, const unsigned index) {
     149    const auto r = mScalarMap.insert(std::make_pair(name, ScalarField{scalarType, index}));
    150150    if (LLVM_UNLIKELY(!r.second)) {
    151151        const ScalarField & sf = r.first->second;
     
    159159 * @brief addScalarToMap
    160160 ** ------------------------------------------------------------------------------------------------------------- */
    161 void Kernel::addStreamToMap(const std::string & name, const Port port, const unsigned index) {
    162     const auto r = mStreamSetMap.emplace(name, std::make_pair(port, index));
     161void Kernel::addStreamToMap(const llvm::StringRef name, const Port port, const unsigned index) {
     162    const auto r = mStreamSetMap.insert(std::make_pair(name, std::make_pair(port, index)));
    163163    if (LLVM_UNLIKELY(!r.second)) {
    164164        const StreamPort & sf = r.first->second;
     
    613613 * @brief addInternalScalar
    614614 ** ------------------------------------------------------------------------------------------------------------- */
    615 void Kernel::addInternalScalar(llvm::Type * type, const std::string & name) {
     615void Kernel::addInternalScalar(llvm::Type * type, const llvm::StringRef name) {
    616616    const auto index = mInternalScalars.size();
    617617    mInternalScalars.emplace_back(type, name);
     
    622622 * @brief getScalarIndex
    623623 ** ------------------------------------------------------------------------------------------------------------- */
    624 unsigned Kernel::getScalarIndex(const std::string & fieldName) const {
     624unsigned Kernel::getScalarIndex(const llvm::StringRef fieldName) const {
    625625    const auto & field = getScalarField(fieldName);
    626626    assert (mKernelStateType);
     
    675675 * Create a fixed length string hash of the given str
    676676 ** ------------------------------------------------------------------------------------------------------------- */
    677 std::string Kernel::getStringHash(const std::string & str) {
     677std::string Kernel::getStringHash(const llvm::StringRef str) {
    678678
    679679    uint32_t digest[5]; // 160 bits in total
    680680    boost::uuids::detail::sha1 sha1;
    681     sha1.process_bytes(str.c_str(), str.size());
     681    sha1.process_bytes(str.data(), str.size());
    682682    sha1.get_digest(digest);
    683683
     
    756756 * @brief getScalarField
    757757 ** ------------------------------------------------------------------------------------------------------------- */
    758 const Kernel::ScalarField & Kernel::getScalarField(const std::string & name) const {
     758const Kernel::ScalarField & Kernel::getScalarField(const llvm::StringRef name) const {
    759759    assert (!mScalarMap.empty());
    760760    const auto f = mScalarMap.find(name);
     
    768768 * @brief getInputScalarBinding
    769769 ** ------------------------------------------------------------------------------------------------------------- */
    770 Binding & Kernel::getInputScalarBinding(const std::string & name) {
     770Binding & Kernel::getInputScalarBinding(const llvm::StringRef name) {
    771771    const ScalarField & field = getScalarField(name);
    772772    if (LLVM_UNLIKELY(field.type != ScalarType::Input)) {
     
    779779 * @brief getOutputScalarBinding
    780780 ** ------------------------------------------------------------------------------------------------------------- */
    781 Binding & Kernel::getOutputScalarBinding(const std::string & name) {
     781Binding & Kernel::getOutputScalarBinding(const llvm::StringRef name) {
    782782    const ScalarField & field = getScalarField(name);
    783783    if (LLVM_UNLIKELY(field.type != ScalarType::Output)) {
     
    790790 * @brief getStreamPort
    791791 ** ------------------------------------------------------------------------------------------------------------- */
    792 Kernel::StreamSetPort Kernel::getStreamPort(const std::string & name) const {
     792Kernel::StreamSetPort Kernel::getStreamPort(const llvm::StringRef name) const {
    793793    const auto f = mStreamSetMap.find(name);
    794794    if (LLVM_UNLIKELY(f == mStreamSetMap.end())) {
     
    802802 * @brief getBinding
    803803 ** ------------------------------------------------------------------------------------------------------------- */
    804 const Binding & Kernel::getStreamBinding(const std::string & name) const {
     804const Binding & Kernel::getStreamBinding(const llvm::StringRef name) const {
    805805    Port port; unsigned index;
    806806    std::tie(port, index) = getStreamPort(name);
Note: See TracChangeset for help on using the changeset viewer.