preprocess.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __CENTERPOINT_PREPROCESS__
  2. #define __CENTERPOINT_PREPROCESS__
  3. #include <iostream>
  4. #include <fstream>
  5. #include <sstream>
  6. #include "config.h"
  7. #include "buffers.h"
  8. #include "common.h"
  9. #include "logger.h"
  10. #include "NvInfer.h"
  11. #include <cuda_runtime_api.h>
  12. using namespace std;
  13. #define GPU_CHECK(ans) \
  14. { \
  15. GPUAssert((ans), __FILE__, __LINE__); \
  16. }
  17. inline void GPUAssert(cudaError_t code, const char* file, int line, bool abort = true)
  18. {
  19. if (code != cudaSuccess)
  20. {
  21. fprintf(stderr, "GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);
  22. if (abort)
  23. exit(code);
  24. }
  25. }
  26. void _preprocess_gpu(float* points, float* feature,int* indices,
  27. bool* p_mask, int* p_bev_idx, int* p_point_num_assigned, int* bev_voxel_idx, float* v_point_sum, int* v_range, int* v_point_num,
  28. int pointNum);
  29. void preprocessGPU(float* points, float* feature,int* indices,
  30. bool* p_mask, int* p_bev_idx, int* p_point_num_assigned, int* bev_voxel_idx, float* v_point_sum, int* v_range, int* v_point_num,
  31. int pointNum, int pointDim);
  32. void preprocess(float* points, float* feature, int* indices, int pointNum, int pointDim);
  33. bool readBinFile(std::string& filename, void*& bufPtr, int& pointNum, int pointDim );
  34. #endif