blob: a99a67ae1ae7082b62f09854fe88df9b99835bb0 [file] [log] [blame]
Peter Collingbourne6c0aa5f2011-10-06 18:29:37 +00001//===----- 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;
Peter Collingbournea4ae2292011-10-06 18:51:56 +000027class FunctionArgList;
Peter Collingbourne6c0aa5f2011-10-06 18:29:37 +000028class 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
Peter Collingbournea4ae2292011-10-06 18:51:56 +000043 virtual void EmitDeviceStubBody(CodeGenFunction &CGF,
44 FunctionArgList &Args) = 0;
45
Peter Collingbourne6c0aa5f2011-10-06 18:29:37 +000046};
47
48/// Creates an instance of a CUDA runtime class.
49CGCUDARuntime *CreateNVCUDARuntime(CodeGenModule &CGM);
50
51}
52}
53
54#endif