Ignore:
Timestamp:
Jul 25, 2016, 12:16:43 PM (3 years ago)
Author:
cameron
Message:

AVX2 checking via getHostCPUFeatures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain.cpp

    r5078 r5108  
    2424#include <llvm/Support/Host.h>
    2525#include <llvm/Support/raw_ostream.h>
    26 
    27 #include <util/ispc.h>
    2826
    2927#include <object_cache.h>
     
    7270    }
    7371}
     72
     73bool AVX2_available() {
     74    llvm::StringMap<bool> HostCPUFeatures;
     75    if (llvm::sys::getHostCPUFeatures(HostCPUFeatures)) {
     76        auto f = HostCPUFeatures.find("avx2");
     77        return ((f != HostCPUFeatures.end()) && f->second);
     78    }
     79    return false;
     80}
     81
    7482
    7583void WriteAssembly (llvm::TargetMachine *TM, Module * m) {
Note: See TracChangeset for help on using the changeset viewer.