# HG changeset patch # User S.Bharadwaj Yadavalli # Date 1393614091 18000 # Node ID 2d95cf7a29c8636fa3d7b3c335f4012421338757 # Parent 692452c4cfb63110c83248bf6e39a0d9cf5c26be Fixes PTX test failure and a crash when TraceGPUInteraction flag is specified. diff -r 692452c4cfb6 -r 2d95cf7a29c8 graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java --- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Fri Feb 28 14:25:27 2014 +0100 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Fri Feb 28 14:01:31 2014 -0500 @@ -164,9 +164,9 @@ } Warp warpAnnotation = parameterIndex >= 0 ? MetaUtil.getParameterAnnotation(Warp.class, parameterIndex, graph.method()) : null; if (warpAnnotation != null) { - setResult(param, emitWarpParam(paramValue.getKind(), warpAnnotation)); + setResult(param, emitWarpParam(paramValue.getKind().getStackKind(), warpAnnotation)); } else { - setResult(param, emitLoadParam(paramValue.getKind(), paramValue, null)); + setResult(param, emitLoadParam(paramValue.getKind().getStackKind(), paramValue, null)); } } } diff -r 692452c4cfb6 -r 2d95cf7a29c8 src/gpu/ptx/vm/gpu_ptx.cpp --- a/src/gpu/ptx/vm/gpu_ptx.cpp Fri Feb 28 14:25:27 2014 +0100 +++ b/src/gpu/ptx/vm/gpu_ptx.cpp Fri Feb 28 14:01:31 2014 -0500 @@ -234,13 +234,18 @@ tty->print_cr("[CUDA] Failed to query unified addressing mode of device: %d", _cu_device); return false; } + /* The CUDA driver runtime interaction and generated code as implemented requires + that the device supports Unified Addressing. + */ + if (unified_addressing == 0) { + tty->print_cr("[CUDA] CUDA device %d does NOT have required Unified Addressing support.", _cu_device); + return false; + } if (TraceGPUInteraction) { - tty->print_cr("[CUDA] Device %d %s unified addressing support", _cu_device, - ((unified_addressing == 0) ? "does not have" : "has")); + tty->print_cr("[CUDA] Device %d has Unified Addressing support", _cu_device); } - /* Get device name */ char device_name[256]; status = _cuda_cu_device_get_name(device_name, 256, _cu_device); @@ -461,6 +466,7 @@ bool check(int status, const char *action) { if (status != GRAAL_CUDA_SUCCESS) { Thread* THREAD = _thread; + ResourceMark rm(THREAD); char* message = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, O_BUFLEN + 1); jio_snprintf(message, O_BUFLEN, "[CUDA] *** Error (status=%d): %s", status, action); if (TraceGPUInteraction) { @@ -662,6 +668,7 @@ for (vframeStream vfst(thread); !vfst.at_end(); vfst.next()) { Method* m = vfst.method(); if (m != NULL) { + ResourceMark rm; stringStream st(O_BUFLEN); st.print("[CUDA] Call: %s.%s(", m->method_holder()->name()->as_C_string(), m->name()->as_C_string()); KernelArgumentsPrinter kap(m, buffer, &st);