source: icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.cpp @ 5489

Last change on this file since 5489 was 5489, checked in by nmedfort, 23 months ago

Bug fix for memory check and issues found parsing internal 'files'. Added backtrace option from execinfo.h

File size: 1.3 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5
6#include "idisa_target.h"
7#include <toolchain/toolchain.h>
8#include <IR_Gen/idisa_sse_builder.h>
9#include <IR_Gen/idisa_avx_builder.h>
10#include <IR_Gen/idisa_i64_builder.h>
11#include <IR_Gen/idisa_nvptx_builder.h>
12#include <llvm/IR/Module.h>
13#include <llvm/ADT/Triple.h>
14
15#include <kernels/kernel_builder.h>
16
17using namespace kernel;
18
19namespace IDISA {
20   
21KernelBuilder * GetIDISA_Builder(llvm::LLVMContext & C) {
22    const bool hasAVX2 = AVX2_available();
23    if (LLVM_LIKELY(codegen::BlockSize == 0)) {  // No BlockSize override: use processor SIMD width
24        codegen::BlockSize = hasAVX2 ? 256 : 128;
25    }
26    if (codegen::BlockSize >= 256) {
27        if (hasAVX2) {
28            return new KernelBuilderImpl<IDISA_AVX2_Builder>(C, codegen::BlockSize, codegen::BlockSize);
29        }
30    } else if (codegen::BlockSize == 64) {
31        return new KernelBuilderImpl<IDISA_I64_Builder>(C, codegen::BlockSize, codegen::BlockSize);
32    }
33    return new KernelBuilderImpl<IDISA_SSE2_Builder>(C, codegen::BlockSize, codegen::BlockSize);
34}
35
36KernelBuilder * GetIDISA_GPU_Builder(llvm::LLVMContext & C) {
37    return new KernelBuilderImpl<IDISA_NVPTX20_Builder>(C, 64, 64 * 64);
38}
39
40}
Note: See TracBrowser for help on using the repository browser.