Mercurial > hg > truffle
comparison src/gpu/ptx/vm/gpu_ptx.cpp @ 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 | c7abc8411011 |
comparison
equal
deleted
inserted
replaced
11842:8d8f63069f58 | 11843:372bacc13022 |
---|---|
53 | 53 |
54 /* | 54 /* |
55 * see http://en.wikipedia.org/wiki/CUDA#Supported_GPUs | 55 * see http://en.wikipedia.org/wiki/CUDA#Supported_GPUs |
56 */ | 56 */ |
57 int ncores(int major, int minor) { | 57 int ncores(int major, int minor) { |
58 int device_type = major << 4 + minor; | 58 int device_type = (major << 4) + minor; |
59 | 59 |
60 switch (device_type) { | 60 switch (device_type) { |
61 case 0x10: return 8; | 61 case 0x10: return 8; |
62 case 0x11: return 8; | 62 case 0x11: return 8; |
63 case 0x12: return 8; | 63 case 0x12: return 8; |
64 case 0x13: return 8; | 64 case 0x13: return 8; |
65 case 0x20: return 32; | 65 case 0x20: return 32; |
66 case 0x21: return 48; | 66 case 0x21: return 48; |
67 case 0x30: return 192; | 67 case 0x30: return 192; |
68 case 0x35: return 192; | 68 case 0x35: return 192; |
69 defaulf: | 69 default: |
70 tty->print_cr("[CUDA] Warning: Unhandled device %x", device_type); | 70 tty->print_cr("[CUDA] Warning: Unhandled device %x", device_type); |
71 return 0; | 71 return 0; |
72 } | 72 } |
73 } | 73 } |
74 | 74 |