# HG changeset patch # User Andreas Woess # Date 1380570401 -7200 # Node ID 372bacc13022367e0ceab3e9c7fca13f78eb321f # Parent 8d8f63069f58fa8f342cb105c486a3612436442d gtx_ptx.cpp: fix switch default label and operator precedence in ncores(). diff -r 8d8f63069f58 -r 372bacc13022 src/gpu/ptx/vm/gpu_ptx.cpp --- a/src/gpu/ptx/vm/gpu_ptx.cpp Mon Sep 30 13:03:47 2013 -0400 +++ b/src/gpu/ptx/vm/gpu_ptx.cpp Mon Sep 30 21:46:41 2013 +0200 @@ -55,7 +55,7 @@ * see http://en.wikipedia.org/wiki/CUDA#Supported_GPUs */ int ncores(int major, int minor) { - int device_type = major << 4 + minor; + int device_type = (major << 4) + minor; switch (device_type) { case 0x10: return 8; @@ -66,7 +66,7 @@ case 0x21: return 48; case 0x30: return 192; case 0x35: return 192; - defaulf: + default: tty->print_cr("[CUDA] Warning: Unhandled device %x", device_type); return 0; }