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 LLVM_CLANG_LIB_CODEGEN_CGCUDARUNTIME_H
17 #define LLVM_CLANG_LIB_CODEGEN_CGCUDARUNTIME_H
18 
19 namespace clang {
20 
21 class CUDAKernelCallExpr;
22 
23 namespace CodeGen {
24 
25 class CodeGenFunction;
26 class CodeGenModule;
27 class FunctionArgList;
28 class ReturnValueSlot;
29 class RValue;
30 
31 class CGCUDARuntime {
32 protected:
33   CodeGenModule &CGM;
34 
35 public:
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.
49 CGCUDARuntime *CreateNVCUDARuntime(CodeGenModule &CGM);
50 
51 }
52 }
53 
54 #endif
55