GPURuntime: Check for debug-mode early on

Before this change, the debug statements in polly_initDevice would all be
skipped, as debug-mode would only be enabled _after_ they have already been run.

llvm-svn: 276621
This commit is contained in:
Tobias Grosser 2016-07-25 09:15:53 +00:00
parent c20d47751d
commit 0a1a2720c8
1 changed files with 2 additions and 2 deletions

View File

@ -220,6 +220,8 @@ static int initialDeviceAPIs() {
}
void polly_initDevice(PollyGPUContext **Context, PollyGPUDevice **Device) {
DebugMode = getenv("POLLY_DEBUG") != 0;
dump_function();
int Major = 0, Minor = 0, DeviceID = 0;
@ -264,8 +266,6 @@ void polly_initDevice(PollyGPUContext **Context, PollyGPUDevice **Device) {
exit(-1);
}
CuCtxCreateFcnPtr(&((*Context)->Cuda), 0, (*Device)->Cuda);
DebugMode = getenv("POLLY_DEBUG") != 0;
}
void polly_getPTXModule(void *PTXBuffer, PollyGPUModule **Module) {