15#ifndef LLVM_CLANG_LIB_CODEGEN_CGCUDARUNTIME_H
16#define LLVM_CLANG_LIB_CODEGEN_CGCUDARUNTIME_H
19#include "llvm/ADT/StringRef.h"
20#include "llvm/Frontend/Offloading/Utility.h"
21#include "llvm/IR/GlobalValue.h"
30class CUDAKernelCallExpr;
59 LLVM_PREFERRED_TYPE(
bool)
61 LLVM_PREFERRED_TYPE(
bool)
62 unsigned Constant : 1;
63 LLVM_PREFERRED_TYPE(
bool)
65 LLVM_PREFERRED_TYPE(
bool)
66 unsigned Normalized : 1;
71 : Kind(K), Extern(
E), Constant(
C), Managed(M), Normalized(N),
94 llvm::GlobalVariable &Var) = 0;
114 llvm::GlobalValue::LinkageTypes &
Linkage) = 0;
Represents a call to a CUDA kernel function.
DeviceVarFlags(DeviceVarKind K, bool E, bool C, bool M, bool N, int T)
bool isNormalized() const
int getSurfTexType() const
DeviceVarKind getKind() const
virtual std::string getDeviceSideName(const NamedDecl *ND)=0
Returns function or variable name on device side even if the current compilation is for host.
virtual void emitDeviceStub(CodeGenFunction &CGF, FunctionArgList &Args)=0
Emits a kernel launch stub.
virtual llvm::Function * getKernelStub(llvm::GlobalValue *Handle)=0
Get kernel stub by kernel handle.
virtual void handleVarRegistration(const VarDecl *VD, llvm::GlobalVariable &Var)=0
Check whether a variable is a device variable and register it if true.
virtual llvm::Function * finalizeModule()=0
Finalize generated LLVM module.
virtual llvm::GlobalValue * getKernelHandle(llvm::Function *Stub, GlobalDecl GD)=0
Get kernel handle by stub function.
virtual RValue EmitCUDAKernelCallExpr(CodeGenFunction &CGF, const CUDAKernelCallExpr *E, ReturnValueSlot ReturnValue)
CGCUDARuntime(CodeGenModule &CGM)
virtual void internalizeDeviceSideVar(const VarDecl *D, llvm::GlobalValue::LinkageTypes &Linkage)=0
Adjust linkage of shadow variables in host compilation.
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
This class organizes the cross-function state that is used while generating LLVM code.
FunctionArgList - Type for representing both the decl and type of parameters to a function.
RValue - This trivial value class is used to represent the result of an expression that is evaluated.
ReturnValueSlot - Contains the address where the return value of a function can be stored,...
GlobalDecl - represents a global declaration.
This represents a decl that may have a name.
Represents a variable declaration or definition.
CGCUDARuntime * CreateNVCUDARuntime(CodeGenModule &CGM)
Creates an instance of a CUDA runtime class.
The JSON file list parser is used to communicate input to InstallAPI.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
const FunctionProtoType * T
Diagnostic wrappers for TextAPI types for error reporting.