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/IR/GlobalValue.h"
29class CUDAKernelCallExpr;
71 unsigned Constant : 1;
73 unsigned Normalized : 1;
78 : Kind(K), Extern(E), Constant(
C), Managed(M), Normalized(N),
101 llvm::GlobalVariable &Var) = 0;
121 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)
OffloadEntryKindFlag
The kind flag for an offloading entry.
@ OffloadGlobalSurfaceEntry
Mark the entry as a surface variable.
@ OffloadGlobalTextureEntry
Mark the entry as a texture variable.
@ OffloadGlobalEntry
Mark the entry as a global entry.
@ OffloadGlobalManagedEntry
Mark the entry as a managed global variable.
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.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
YAML serialization mapping.