OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
cuda.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_GPU_CUDA_HPP
2 #define OPENPOSE_GPU_CUDA_HPP
3 
4 #include <utility> // std::pair
6 
7 namespace op
8 {
9  const auto CUDA_NUM_THREADS = 512u;
10 
11  OP_API void cudaCheck(const int line = -1, const std::string& function = "", const std::string& file = "");
12 
14 
15  inline unsigned int getNumberCudaBlocks(
16  const unsigned int totalRequired, const unsigned int numberCudaThreads = CUDA_NUM_THREADS)
17  {
18  return (totalRequired + numberCudaThreads - 1) / numberCudaThreads;
19  }
20 
22  dim3& numberCudaThreads, dim3& numberCudaBlocks, const Point<unsigned int>& frameSize);
23 
24  template <typename T>
26  T* targetPtr, const unsigned char* const srcPtr, const int width, const int height, const int channels);
27 
28  template <typename T>
29  void uCharImageCast(unsigned char* targetPtr, const T* const srcPtr, const int volume);
30 }
31 
32 #endif // OPENPOSE_GPU_CUDA_HPP
#define OP_API
Definition: macros.hpp:18
OP_API void getNumberCudaThreadsAndBlocks(dim3 &numberCudaThreads, dim3 &numberCudaBlocks, const Point< unsigned int > &frameSize)
OP_API void cudaCheck(const int line=-1, const std::string &function="", const std::string &file="")
unsigned int getNumberCudaBlocks(const unsigned int totalRequired, const unsigned int numberCudaThreads=CUDA_NUM_THREADS)
Definition: cuda.hpp:15
void uCharImageCast(unsigned char *targetPtr, const T *const srcPtr, const int volume)
void reorderAndNormalize(T *targetPtr, const unsigned char *const srcPtr, const int width, const int height, const int channels)
const auto CUDA_NUM_THREADS
Definition: cuda.hpp:9
OP_API int getCudaGpuNumber()