changeset 11843:372bacc13022

gtx_ptx.cpp: fix switch default label and operator precedence in ncores().
author Andreas Woess <andreas.woess@jku.at>
date Mon, 30 Sep 2013 21:46:41 +0200
parents 8d8f63069f58
children 1ce74467ab51 099af41815ea
files src/gpu/ptx/vm/gpu_ptx.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }