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

AVX2 checking via getHostCPUFeatures

Location:
icGREP/icgrep-devel/icgrep
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5088 r5108  
    7373add_library(UCDlib UCD/unicode_set.cpp UCD/ucd_compiler.cpp UCD/PropertyObjects.cpp UCD/resolve_properties.cpp UCD/UnicodeNameData.cpp)
    7474
    75 add_library(CodeGen object_cache.cpp util/ispc.cpp ${IDISA_SRC})
     75add_library(CodeGen object_cache.cpp ${IDISA_SRC})
    7676
    7777# add the executable
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_target.cpp

    r5037 r5108  
    99#include <IDISA/idisa_i64_builder.h>
    1010
    11 // Dynamic processor detection
    12 //#define ISPC_LLVM_VERSION ISPC_LLVM_3_6
    13 #include <util/ispc.h>
    14 
    1511namespace IDISA {
    1612   
     
    1814
    1915IDISA_Builder * GetIDISA_Builder(Module * mod) {
    20     bool hasAVX2 = (strncmp(lGetSystemISA(), "avx2", 4) == 0);
     16    bool hasAVX2 = AVX2_available();
    2117    unsigned theBlockSize = codegen::BlockSize;  // from command line
    2218   
  • 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) {
  • icGREP/icgrep-devel/icgrep/toolchain.h

    r5033 r5108  
    2222}
    2323
     24bool AVX2_available();
     25
    2426llvm::ExecutionEngine * JIT_to_ExecutionEngine (llvm::Module * m);
    2527
Note: See TracChangeset for help on using the changeset viewer.