From 1445202e0ed206b148564e95e6f3841bf4129bd4 Mon Sep 17 00:00:00 2001 From: Evghenii Date: Thu, 14 Nov 2013 21:18:25 +0100 Subject: [PATCH] identified bug due to llvm-3.4 --- Makefile | 2 +- examples_cuda/aobench/Makefile_gpu | 4 ++-- examples_cuda/mandelbrot_tasks3d/Makefile_gpu | 4 ++-- module.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 65f9c265..34839f86 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ # If you have your own special version of llvm and/or clang, change # these variables to match. -LLVM_CONFIG=$(shell which /home/evghenii/usr/local/llvm/bin-3.3/bin/llvm-config) +LLVM_CONFIG=$(shell which /home/evghenii/usr/local/llvm/bin-trunk/bin/llvm-config) CLANG_INCLUDE=$(shell $(LLVM_CONFIG) --includedir) # Enable ARM by request diff --git a/examples_cuda/aobench/Makefile_gpu b/examples_cuda/aobench/Makefile_gpu index e217f388..6a11cbc5 100644 --- a/examples_cuda/aobench/Makefile_gpu +++ b/examples_cuda/aobench/Makefile_gpu @@ -8,7 +8,7 @@ LD=g++ LDFLAGS=-lcuda ISPC=ispc -ISPCFLAGS=-O3 --math-lib=default --target=nvptx64,avx +ISPCFLAGS=-O3 --math-lib=default --target=nvptx64 LLVM32 = $(HOME)/usr/local/llvm/bin-3.2 LLVM = $(HOME)/usr/local/llvm/bin-3.3 @@ -37,7 +37,7 @@ $(PROG): $(CXX_OBJ) kernel.ptx %_ispc_nvptx64.bc: %.ispc - $(ISPC) $(ISPCFLAGS) --emit-llvm -o `basename $< .ispc`_ispc.bc -h `basename $< .ispc`_ispc.h $< --emit-llvm + $(ISPC) $(ISPCFLAGS) --emit-llvm -o `basename $< .ispc`_ispc_nvptx64.bc -h `basename $< .ispc`_ispc.h $< --emit-llvm %.ptx: %.bc $(LLVM32DIS) $< diff --git a/examples_cuda/mandelbrot_tasks3d/Makefile_gpu b/examples_cuda/mandelbrot_tasks3d/Makefile_gpu index 73f0523f..1bb6d8d1 100644 --- a/examples_cuda/mandelbrot_tasks3d/Makefile_gpu +++ b/examples_cuda/mandelbrot_tasks3d/Makefile_gpu @@ -8,7 +8,7 @@ LD=g++ LDFLAGS=-lcuda ISPC=ispc -ISPCFLAGS=-O3 --math-lib=default --target=nvptx64,avx +ISPCFLAGS=-O3 --math-lib=default --target=nvptx64 LLVM32 = $(HOME)/usr/local/llvm/bin-3.2 LLVM = $(HOME)/usr/local/llvm/bin-3.3 @@ -37,7 +37,7 @@ $(PROG): $(CXX_OBJ) kernel.ptx %_ispc_nvptx64.bc: %.ispc - $(ISPC) $(ISPCFLAGS) --emit-llvm -o `basename $< .ispc`_ispc.bc -h `basename $< .ispc`_ispc.h $< --emit-llvm + $(ISPC) $(ISPCFLAGS) --emit-llvm -o `basename $< .ispc`_ispc_nvptx64.bc -h `basename $< .ispc`_ispc.h $< --emit-llvm %.ptx: %.bc $(LLVM32DIS) $< diff --git a/module.cpp b/module.cpp index 14ecd5c5..eae5ec7c 100644 --- a/module.cpp +++ b/module.cpp @@ -2334,7 +2334,7 @@ Module::CompileAndOutput(const char *srcFile, char ptxname[] = "nvptx64"; for (int k = 0; k < 7; k++) ptxname[k] = target[k]; - if (target != NULL && strcmp(ptxname,"nvptx64") == 0) // NVPTX64 + if (0) //target != NULL && strcmp(ptxname,"nvptx64") == 0) // NVPTX64 { std::vector targets = lExtractTargets(target); Assert(targets.size() > 1); @@ -2458,7 +2458,8 @@ Module::CompileAndOutput(const char *srcFile, } else if (target == NULL || strchr(target, ',') == NULL) { // We're only compiling to a single target - g->target = new Target(arch, cpu, target, generatePIC); + const bool isPTX = strcmp(target, "nvptx64") == 0; + g->target = new Target(arch, cpu, target, generatePIC, isPTX); if (!g->target->isValid()) return 1;