clang 23.0.0git
CIRGenCUDARuntime.cpp
Go to the documentation of this file.
1//===----- CIRGenCUDARuntime.cpp - Interface to CUDA Runtimes -------------===//
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//===----------------------------------------------------------------------===//
8//
9// This provides an abstract class for CUDA code generation. Concrete
10// subclasses of this implement code generation for specific CUDA
11// runtime libraries.
12//
13//===----------------------------------------------------------------------===//
14
15#include "CIRGenCUDARuntime.h"
16#include "CIRGenBuilder.h"
17#include "CIRGenFunction.h"
18#include "clang/AST/ExprCXX.h"
19
20using namespace clang;
21using namespace CIRGen;
22
24
27 ReturnValueSlot retValue) {
28
29 CIRGenBuilderTy &builder = cgm.getBuilder();
30 mlir::Location loc =
31 cgf.currSrcLoc ? cgf.currSrcLoc.value() : builder.getUnknownLoc();
32
34 expr->getConfig(),
35 [&](mlir::OpBuilder &b, mlir::Location l) { cir::YieldOp::create(b, l); },
36 loc,
37 [&](mlir::OpBuilder &b, mlir::Location l) {
38 CIRGenCallee callee = cgf.emitCallee(expr->getCallee());
39 cgf.emitCall(expr->getCallee()->getType(), callee, expr, retValue);
40 cir::YieldOp::create(b, l);
41 },
42 loc);
43
44 return RValue::get(nullptr);
45}
Defines the clang::Expr interface and subclasses for C++ expressions.
__device__ __2f16 b
virtual RValue emitCUDAKernelCallExpr(CIRGenFunction &cgf, const CUDAKernelCallExpr *expr, ReturnValueSlot retValue)
mlir::LogicalResult emitIfOnBoolExpr(const clang::Expr *cond, const clang::Stmt *thenS, const clang::Stmt *elseS)
Emit an if on a boolean condition to the specified blocks.
std::optional< mlir::Location > currSrcLoc
Use to track source locations across nested visitor traversals.
This trivial value class is used to represent the result of an expression that is evaluated.
Definition CIRGenValue.h:33
static RValue get(mlir::Value v)
Definition CIRGenValue.h:83
Contains the address where the return value of a function can be stored, and whether the address is v...
Definition CIRGenCall.h:256
Represents a call to a CUDA kernel function.
Definition ExprCXX.h:235
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
The JSON file list parser is used to communicate input to InstallAPI.