clang API Documentation

CGCUDARuntime.h
Go to the documentation of this file.
00001 //===----- CGCUDARuntime.h - Interface to CUDA Runtimes ---------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This provides an abstract class for CUDA code generation.  Concrete
00011 // subclasses of this implement code generation for specific CUDA
00012 // runtime libraries.
00013 //
00014 //===----------------------------------------------------------------------===//
00015 
00016 #ifndef LLVM_CLANG_LIB_CODEGEN_CGCUDARUNTIME_H
00017 #define LLVM_CLANG_LIB_CODEGEN_CGCUDARUNTIME_H
00018 
00019 namespace clang {
00020 
00021 class CUDAKernelCallExpr;
00022 
00023 namespace CodeGen {
00024 
00025 class CodeGenFunction;
00026 class CodeGenModule;
00027 class FunctionArgList;
00028 class ReturnValueSlot;
00029 class RValue;
00030 
00031 class CGCUDARuntime {
00032 protected:
00033   CodeGenModule &CGM;
00034 
00035 public:
00036   CGCUDARuntime(CodeGenModule &CGM) : CGM(CGM) {}
00037   virtual ~CGCUDARuntime();
00038 
00039   virtual RValue EmitCUDAKernelCallExpr(CodeGenFunction &CGF,
00040                                         const CUDAKernelCallExpr *E,
00041                                         ReturnValueSlot ReturnValue);
00042   
00043   virtual void EmitDeviceStubBody(CodeGenFunction &CGF,
00044                                   FunctionArgList &Args) = 0;
00045 
00046 };
00047 
00048 /// Creates an instance of a CUDA runtime class.
00049 CGCUDARuntime *CreateNVCUDARuntime(CodeGenModule &CGM);
00050 
00051 }
00052 }
00053 
00054 #endif