mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-01 01:31:26 +00:00
Enable CUDA Fortran for bbc
This commit is contained in:
parent
4ce7c4a92a
commit
c5abddbf29
11
flang/test/Driver/bbc-cuda-macro.cuf
Normal file
11
flang/test/Driver/bbc-cuda-macro.cuf
Normal file
@ -0,0 +1,11 @@
|
||||
! Test -fcuda option for bbc
|
||||
! RUN: bbc -fcuda -o - %s | FileCheck %s
|
||||
|
||||
! CHECK-NOT: Unknown command line argument
|
||||
|
||||
program main
|
||||
#if _CUDA
|
||||
integer :: var = _CUDA
|
||||
#endif
|
||||
integer, device :: dvar
|
||||
end program
|
@ -190,6 +190,10 @@ static llvm::cl::opt<bool> useHLFIR("hlfir",
|
||||
llvm::cl::desc("Lower to high level FIR"),
|
||||
llvm::cl::init(false));
|
||||
|
||||
static llvm::cl::opt<bool> enableCUDA("fcuda",
|
||||
llvm::cl::desc("enable CUDA Fortran"),
|
||||
llvm::cl::init(false));
|
||||
|
||||
#define FLANG_EXCLUDE_CODEGEN
|
||||
#include "flang/Tools/CLOptions.inc"
|
||||
|
||||
@ -412,6 +416,11 @@ int main(int argc, char **argv) {
|
||||
options.predefinitions.emplace_back("_OPENACC", "202211");
|
||||
}
|
||||
|
||||
// enable parsing of CUDA Fortran
|
||||
if (enableCUDA) {
|
||||
options.features.Enable(Fortran::common::LanguageFeature::CUDA);
|
||||
}
|
||||
|
||||
Fortran::common::IntrinsicTypeDefaultKinds defaultKinds;
|
||||
Fortran::parser::AllSources allSources;
|
||||
Fortran::parser::AllCookedSources allCookedSources(allSources);
|
||||
|
Loading…
Reference in New Issue
Block a user