File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 2828 #define LDS_SIZE 64 * 1024
2929#endif
3030
31- static int get_lds_size () {
32- auto dprops = at::cuda::getCurrentDeviceProperties ();
33- std::string device_arch = dprops->gcnArchName ;
34- size_t substring = device_arch.find (" gfx95" );
35- if (substring == std::string::npos) return 64 * 1024 ;
36- return 160 * 1024 ;
31+ int get_lds_size () {
32+ static bool is_cached = false ;
33+ static int result;
34+ if (is_cached == false ) {
35+ auto dprops = at::cuda::getCurrentDeviceProperties ();
36+ std::string device_arch = dprops->gcnArchName ;
37+ size_t substring = device_arch.find (" gfx95" );
38+ result = (substring == std::string::npos ? 64 * 1024 : 160 * 1024 );
39+ is_cached = true ;
40+ }
41+ return result;
3742}
3843
3944#if defined(NDEBUG)
You can’t perform that action at this time.
0 commit comments