// Arguments to pass to the clang frontend
vector<const char *> args;
bool bOpt = true;
+ bool bFastMath = false;
vector<std::string> useless; //hold substrings to avoid c_str free
size_t start = 0, end = 0;
if(str.size() == 0)
continue;
if(str == "-cl-opt-disable") bOpt = false;
+ if(str == "-cl-fast-relaxed-math") bFastMath = true;
useless.push_back(str);
args.push_back(str.c_str());
}
// XXX we haven't implement those builtin functions,
// so disable it currently.
args.push_back("-fno-builtin");
- if(bOpt) args.push_back("-O2");
+ if(bOpt)
+ args.push_back("-O3");
+ if(bFastMath)
+ args.push_back("-D __FAST_RELAXED_MATH__=1");
#if LLVM_VERSION_MINOR <= 2
args.push_back("-triple");
args.push_back("nvptx");
#define __CL_VERSION_1_0__ 100
#define __CL_VERSION_1_1__ 110
#define __ENDIAN_LITTLE__ 1
+#define __IMAGE_SUPPORT__ 1
#define __kernel_exec(X, TYPE) __kernel __attribute__((work_group_size_hint(X,1,1))) \
__attribute__((vec_type_hint(TYPE)))
#define kernel_exec(X, TYPE) __kernel_exec(X, TYPE)