LAA: improve code in getStrideFromPointer (NFC) (#124780)
[llvm-project.git] / flang / runtime / CUDA / init.cpp
blob2bffce842b95269301f27e96cc83fd6cc7153a00
1 //===-- runtime/CUDA/init.cpp ---------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "flang/Runtime/CUDA/init.h"
10 #include "../environment.h"
11 #include "../terminator.h"
12 #include "flang/Runtime/CUDA/common.h"
14 #include "cuda_runtime.h"
16 extern "C" {
18 void RTDEF(CUFInit)() {
19 // Perform ctx initialization based on execution environment if necessary.
20 if (Fortran::runtime::executionEnvironment.cudaStackLimit) {
21 CUDA_REPORT_IF_ERROR(cudaDeviceSetLimit(cudaLimitStackSize,
22 Fortran::runtime::executionEnvironment.cudaStackLimit));