CGCUDARuntime.h revision a4ae2294b6ebfb2554aacb6a6a0682fb5ed1f276
1//===----- CGCUDARuntime.h - Interface to CUDA Runtimes ---------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This provides an abstract class for CUDA code generation.  Concrete
11// subclasses of this implement code generation for specific CUDA
12// runtime libraries.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef CLANG_CODEGEN_CUDARUNTIME_H
17#define CLANG_CODEGEN_CUDARUNTIME_H
18
19namespace clang {
20
21class CUDAKernelCallExpr;
22
23namespace CodeGen {
24
25class CodeGenFunction;
26class CodeGenModule;
27class FunctionArgList;
28class ReturnValueSlot;
29class RValue;
30
31class CGCUDARuntime {
32protected:
33  CodeGenModule &CGM;
34
35public:
36  CGCUDARuntime(CodeGenModule &CGM) : CGM(CGM) {}
37  virtual ~CGCUDARuntime();
38
39  virtual RValue EmitCUDAKernelCallExpr(CodeGenFunction &CGF,
40                                        const CUDAKernelCallExpr *E,
41                                        ReturnValueSlot ReturnValue);
42
43  virtual void EmitDeviceStubBody(CodeGenFunction &CGF,
44                                  FunctionArgList &Args) = 0;
45
46};
47
48/// Creates an instance of a CUDA runtime class.
49CGCUDARuntime *CreateNVCUDARuntime(CodeGenModule &CGM);
50
51}
52}
53
54#endif
55