Commit 03e887c
Cache device major version value to avoid multiple calls of getCudaDeviceProperties (facebookresearch#3950)
Summary:
This diff enables to cache the device major version value so getCudaDeviceProperties() doesn't need to be called multiple times. Currently, the profiler of the code looks as so:
{F1933796291}
Pull Request resolved: facebookresearch#3950
Test Plan:
N5114369 -- provides a toy example (2) which exhibits the following timings:
Average timings before change: 3.35s
Average tmings after change: 1.99s
Reviewed By: algoriddle
Differential Revision: D64047778
Pulled By: mlomeli1
fbshipit-source-id: 2f09373944237e80b96d40f35c6714c06f5741a91 parent 8b00d00 commit 03e887c
2 files changed
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | | - | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | | - | |
47 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | | - | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| |||
0 commit comments