MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetWorkspaceLimit

Function GetWorkspaceLimit

tensorflow/stream_executor/matmul_util.cc:22–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace stream_executor {
21
22int64_t GetWorkspaceLimit(int64_t default_value_in_bytes) {
23 const char* workspace_limit_in_mb_str =
24 getenv("TF_CUBLAS_WORKSPACE_LIMIT_IN_MB");
25 if (workspace_limit_in_mb_str != nullptr &&
26 strcmp(workspace_limit_in_mb_str, "") != 0) {
27 int64 scratch_limit_in_mb = -1;
28 if (tensorflow::strings::safe_strto64(workspace_limit_in_mb_str,
29 &scratch_limit_in_mb)) {
30 return scratch_limit_in_mb * (1 << 20);
31 } else {
32 LOG(WARNING) << "Invalid value for TF_CUBLAS_WORKSPACE_LIMIT_IN_MB: "
33 << workspace_limit_in_mb_str;
34 }
35 }
36 return default_value_in_bytes;
37}
38
39int MatmulMaxAutotuneAlgorithmCount() {
40 int64 value;

Callers 1

GetPlanAndAlgorithmsFunction · 0.85

Calls 1

safe_strto64Function · 0.85

Tested by

no test coverage detected