1 //===----- CGOpenMPRuntimeNVPTX.h - Interface to OpenMP NVPTX Runtimes ----===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This provides a class for OpenMP runtime code generation specialized to NVPTX 10 // targets from generalized CGOpenMPRuntimeGPU class. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMENVPTX_H 15 #define LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMENVPTX_H 16 17 #include "CGOpenMPRuntime.h" 18 #include "CGOpenMPRuntimeGPU.h" 19 #include "CodeGenFunction.h" 20 #include "clang/AST/StmtOpenMP.h" 21 22 namespace clang { 23 namespace CodeGen { 24 25 class CGOpenMPRuntimeNVPTX final : public CGOpenMPRuntimeGPU { 26 27 public: 28 explicit CGOpenMPRuntimeNVPTX(CodeGenModule &CGM); 29 30 /// Get the GPU warp size. 31 llvm::Value *getGPUWarpSize(CodeGenFunction &CGF) override; 32 33 /// Get the id of the current thread on the GPU. 34 llvm::Value *getGPUThreadID(CodeGenFunction &CGF) override; 35 36 /// Get the maximum number of threads in a block of the GPU. 37 llvm::Value *getGPUNumThreads(CodeGenFunction &CGF) override; 38 }; 39 40 } // CodeGen namespace. 41 } // clang namespace. 42 43 #endif // LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMENVPTX_H 44