Changeset 5560


Ignore:
Timestamp:
Jul 10, 2017, 1:52:57 PM (22 months ago)
Author:
cameron
Message:

BlockSize? check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.cpp

    r5489 r5560  
    1212#include <llvm/IR/Module.h>
    1313#include <llvm/ADT/Triple.h>
    14 
     14#include <llvm/Support/ErrorHandling.h>
    1515#include <kernels/kernel_builder.h>
    1616
     
    2323    if (LLVM_LIKELY(codegen::BlockSize == 0)) {  // No BlockSize override: use processor SIMD width
    2424        codegen::BlockSize = hasAVX2 ? 256 : 128;
     25    }
     26    else if (((codegen::BlockSize & (codegen::BlockSize - 1)) != 0) || (codegen::BlockSize < 64)) {
     27        llvm::report_fatal_error("BlockSize must be a power of 2 and >=64");
    2528    }
    2629    if (codegen::BlockSize >= 256) {
Note: See TracChangeset for help on using the changeset viewer.