diff --git a/flang/include/flang/Runtime/CUDA/descriptor.h b/flang/include/flang/Runtime/CUDA/descriptor.h index 4c6c2c4694fd..415efc9ba2ff 100644 --- a/flang/include/flang/Runtime/CUDA/descriptor.h +++ b/flang/include/flang/Runtime/CUDA/descriptor.h @@ -18,7 +18,7 @@ namespace Fortran::runtime::cuda { extern "C" { /// Allocate a descriptor in managed. -Descriptor *RTDECL(CUFAllocDesciptor)( +Descriptor *RTDECL(CUFAllocDescriptor)( std::size_t, const char *sourceFile = nullptr, int sourceLine = 0); /// Deallocate a descriptor allocated in managed or unified memory. diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp index 9d911d6bfd40..1714b9e191db 100644 --- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp +++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp @@ -1210,12 +1210,12 @@ genCUFAllocDescriptor(mlir::Location loc, llvmPointerType, {llvmIntPtrType, llvmPointerType, llvmInt32Type}); auto llvmFunc = mod.lookupSymbol( - RTNAME_STRING(CUFAllocDesciptor)); + RTNAME_STRING(CUFAllocDescriptor)); auto funcFunc = - mod.lookupSymbol(RTNAME_STRING(CUFAllocDesciptor)); + mod.lookupSymbol(RTNAME_STRING(CUFAllocDescriptor)); if (!llvmFunc && !funcFunc) mlir::OpBuilder::atBlockEnd(mod.getBody()) - .create(loc, RTNAME_STRING(CUFAllocDesciptor), + .create(loc, RTNAME_STRING(CUFAllocDescriptor), fctTy); mlir::Type structTy = typeConverter.convertBoxTypeAsStruct(boxTy); @@ -1224,7 +1224,7 @@ genCUFAllocDescriptor(mlir::Location loc, genConstantIndex(loc, llvmIntPtrType, rewriter, boxSize); llvm::SmallVector args = {sizeInBytes, sourceFile, sourceLine}; return rewriter - .create(loc, fctTy, RTNAME_STRING(CUFAllocDesciptor), + .create(loc, fctTy, RTNAME_STRING(CUFAllocDescriptor), args) .getResult(); } @@ -1735,7 +1735,7 @@ static bool isDeviceAllocation(mlir::Value val) { (callOp.getCallee().value().getRootReference().getValue().starts_with( RTNAME_STRING(CUFMemAlloc)) || callOp.getCallee().value().getRootReference().getValue().starts_with( - RTNAME_STRING(CUFAllocDesciptor)))) + RTNAME_STRING(CUFAllocDescriptor)))) return true; return false; } @@ -3127,7 +3127,7 @@ struct LoadOpConversion : public fir::FIROpConversion { inputBoxStorage.getDefiningOp())) { if (callOp.getCallee() && (*callOp.getCallee()) - .starts_with(RTNAME_STRING(CUFAllocDesciptor))) { + .starts_with(RTNAME_STRING(CUFAllocDescriptor))) { // CUDA Fortran local descriptor are allocated in managed memory. So // new storage must be allocated the same way. auto mod = load->getParentOfType(); diff --git a/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp b/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp index 1df82e6accfe..de1634f1cd22 100644 --- a/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp +++ b/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp @@ -342,7 +342,7 @@ struct CUFAllocOpConversion : public mlir::OpRewritePattern { // Convert descriptor allocations to function call. auto boxTy = mlir::dyn_cast_or_null(op.getInType()); mlir::func::FuncOp func = - fir::runtime::getRuntimeFunc(loc, builder); + fir::runtime::getRuntimeFunc(loc, builder); auto fTy = func.getFunctionType(); mlir::Value sourceLine = fir::factory::locationToLineNo(builder, loc, fTy.getInput(2)); diff --git a/flang/runtime/CUDA/descriptor.cpp b/flang/runtime/CUDA/descriptor.cpp index 58bc0dbed6ba..ae01c11fdc01 100644 --- a/flang/runtime/CUDA/descriptor.cpp +++ b/flang/runtime/CUDA/descriptor.cpp @@ -18,7 +18,7 @@ namespace Fortran::runtime::cuda { extern "C" { RT_EXT_API_GROUP_BEGIN -Descriptor *RTDEF(CUFAllocDesciptor)( +Descriptor *RTDEF(CUFAllocDescriptor)( std::size_t sizeInBytes, const char *sourceFile, int sourceLine) { return reinterpret_cast(CUFAllocManaged(sizeInBytes)); } diff --git a/flang/test/Fir/CUDA/cuda-allocate.fir b/flang/test/Fir/CUDA/cuda-allocate.fir index 9b87c7546d1e..8f2b1d278870 100644 --- a/flang/test/Fir/CUDA/cuda-allocate.fir +++ b/flang/test/Fir/CUDA/cuda-allocate.fir @@ -15,7 +15,7 @@ func.func @_QPsub1() { } // CHECK-LABEL: func.func @_QPsub1() -// CHECK: %[[DESC_RT_CALL:.*]] = fir.call @_FortranACUFAllocDesciptor(%{{.*}}, %{{.*}}, %{{.*}}) : (i64, !fir.ref, i32) -> !fir.ref> +// CHECK: %[[DESC_RT_CALL:.*]] = fir.call @_FortranACUFAllocDescriptor(%{{.*}}, %{{.*}}, %{{.*}}) : (i64, !fir.ref, i32) -> !fir.ref> // CHECK: %[[DESC:.*]] = fir.convert %[[DESC_RT_CALL]] : (!fir.ref>) -> !fir.ref>>> // CHECK: %[[DECL_DESC:.*]]:2 = hlfir.declare %[[DESC]] {data_attr = #cuf.cuda, fortran_attrs = #fir.var_attrs, uniq_name = "_QFsub1Ea"} : (!fir.ref>>>) -> (!fir.ref>>>, !fir.ref>>>) // CHECK: %[[BOX_NONE:.*]] = fir.convert %[[DECL_DESC]]#1 : (!fir.ref>>>) -> !fir.ref> diff --git a/flang/test/Fir/CUDA/cuda-code-gen.mlir b/flang/test/Fir/CUDA/cuda-code-gen.mlir index 47c5667a14c9..5367314415dc 100644 --- a/flang/test/Fir/CUDA/cuda-code-gen.mlir +++ b/flang/test/Fir/CUDA/cuda-code-gen.mlir @@ -8,7 +8,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry : %c48 = arith.constant 48 : index %1 = fir.convert %c48 : (index) -> i64 %2 = fir.convert %0 : (!fir.ref>) -> !fir.ref - %3 = fir.call @_FortranACUFAllocDesciptor(%1, %2, %c4_i32) : (i64, !fir.ref, i32) -> !fir.ref> + %3 = fir.call @_FortranACUFAllocDescriptor(%1, %2, %c4_i32) : (i64, !fir.ref, i32) -> !fir.ref> %4 = fir.convert %3 : (!fir.ref>) -> !fir.ref>>> %5 = fir.zero_bits !fir.heap> %6 = fircg.ext_embox %5(%c0) {allocator_idx = 2 : i32} : (!fir.heap>, index) -> !fir.box>> @@ -18,13 +18,13 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry : } // CHECK-LABEL: llvm.func @_QQmain() - // CHECK-COUNT-2: llvm.call @_FortranACUFAllocDesciptor + // CHECK-COUNT-2: llvm.call @_FortranACUFAllocDescriptor fir.global linkonce @_QQclX3C737464696E3E00 constant : !fir.char<1,8> { %0 = fir.string_lit "\00"(8) : !fir.char<1,8> fir.has_value %0 : !fir.char<1,8> } - func.func private @_FortranACUFAllocDesciptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} + func.func private @_FortranACUFAllocDescriptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} } // ----- @@ -55,7 +55,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec : vector<2xi64> // CHECK-LABEL: llvm.func @_QQmain() // CHECK: llvm.call @_FortranACUFMemAlloc -// CHECK: llvm.call @_FortranACUFAllocDesciptor +// CHECK: llvm.call @_FortranACUFAllocDescriptor // ----- @@ -73,7 +73,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec : vector<2xi64> %c72 = arith.constant 72 : index %3 = fir.convert %c72 : (index) -> i64 %4 = fir.convert %2 : (!fir.ref>) -> !fir.ref - %5 = fir.call @_FortranACUFAllocDesciptor(%3, %4, %c14_i32) : (i64, !fir.ref, i32) -> !fir.ref> + %5 = fir.call @_FortranACUFAllocDescriptor(%3, %4, %c14_i32) : (i64, !fir.ref, i32) -> !fir.ref> %6 = fir.convert %5 : (!fir.ref>) -> !fir.ref>>> %7 = fir.zero_bits !fir.heap> %8 = fircg.ext_embox %7(%c0, %c0) {allocator_idx = 2 : i32} : (!fir.heap>, index, index) -> !fir.box>> @@ -83,7 +83,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec : vector<2xi64> %c48 = arith.constant 48 : index %10 = fir.convert %c48 : (index) -> i64 %11 = fir.convert %9 : (!fir.ref>) -> !fir.ref - %12 = fir.call @_FortranACUFAllocDesciptor(%10, %11, %c20_i32) : (i64, !fir.ref, i32) -> !fir.ref> + %12 = fir.call @_FortranACUFAllocDescriptor(%10, %11, %c20_i32) : (i64, !fir.ref, i32) -> !fir.ref> %13 = fir.convert %12 : (!fir.ref>) -> !fir.ref>>> %14 = fir.zero_bits !fir.heap> %15 = fircg.ext_embox %14(%c0) {allocator_idx = 2 : i32} : (!fir.heap>, index) -> !fir.box>> @@ -120,9 +120,9 @@ module attributes {dlti.dl_spec = #dlti.dl_spec : vector<2xi64> %0 = fir.string_lit "dummy.mlir\00"(11) : !fir.char<1,11> fir.has_value %0 : !fir.char<1,11> } - func.func private @_FortranACUFAllocDesciptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} + func.func private @_FortranACUFAllocDescriptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} func.func private @_FortranACUFAllocatableAllocate(!fir.ref>, i64, i1, !fir.box, !fir.ref, i32) -> i32 attributes {fir.runtime} } // CHECK-LABEL: llvm.func @_QQmain() -// CHECK-COUNT-4: llvm.call @_FortranACUFAllocDesciptor +// CHECK-COUNT-4: llvm.call @_FortranACUFAllocDescriptor diff --git a/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp b/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp index b51ff0ac006c..cad73799ac7c 100644 --- a/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp +++ b/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp @@ -66,7 +66,7 @@ TEST(AllocatableCUFTest, DescriptorAllocationTest) { // REAL(4), DEVICE, ALLOCATABLE :: a(:) auto a{createAllocatable(TypeCategory::Real, 4)}; Descriptor *desc = nullptr; - desc = RTNAME(CUFAllocDesciptor)(a->SizeInBytes()); + desc = RTNAME(CUFAllocDescriptor)(a->SizeInBytes()); EXPECT_TRUE(desc != nullptr); RTNAME(CUFFreeDesciptor)(desc); }