Skip to content

Commit af6368d

Browse files
committed
Use ACC_OFFLOAD_STACK_SIZE
1 parent b3bcc4e commit af6368d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

flang/runtime/environment.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,15 @@ void ExecutionEnvironment::Configure(int ac, const char *av[],
143143
}
144144
}
145145

146-
if (auto *x{std::getenv("CUDA_STACKLIMIT")}) {
146+
if (auto *x{std::getenv("ACC_OFFLOAD_STACK_SIZE")}) {
147147
char *end;
148148
auto n{std::strtoul(x, &end, 10)};
149149
if (n > 0 && n < std::numeric_limits<std::size_t>::max() && *end == '\0') {
150150
cudaStackLimit = n;
151151
} else {
152152
std::fprintf(stderr,
153-
"Fortran runtime: CUDA_STACKLIMIT=%s is invalid; ignored\n", x);
153+
"Fortran runtime: ACC_OFFLOAD_STACK_SIZE=%s is invalid; ignored\n",
154+
x);
154155
}
155156
}
156157

flang/runtime/environment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ struct ExecutionEnvironment {
5757
bool defaultUTF8{false}; // DEFAULT_UTF8
5858
bool checkPointerDeallocation{true}; // FORT_CHECK_POINTER_DEALLOCATION
5959

60-
// CUDA Fortran related variables
61-
std::size_t cudaStackLimit{0}; // CUDA_STACKLIMIT
60+
// CUDA related variables
61+
std::size_t cudaStackLimit{0}; // ACC_OFFLOAD_STACK_SIZE
6262
};
6363

6464
RT_OFFLOAD_VAR_GROUP_BEGIN

0 commit comments

Comments
 (0)