gtsam_points
Loading...
Searching...
No Matches
pointcloud_buffer_cuda.hpp
Go to the documentation of this file.
1#ifndef GLK_POINTCLOUD_BUFFER_CUDA_HPP
2#define GLK_POINTCLOUD_BUFFER_CUDA_HPP
3
4#include <iostream>
5#include <Eigen/Core>
6
7#include <cuda_gl_interop.h>
8#include <thrust/device_vector.h>
10
11namespace glk {
12
13static std::shared_ptr<PointCloudBuffer> create_point_cloud_buffer(const void* src_cuda_ptr, int stride, int num_points) {
14 auto buffer = std::make_shared<PointCloudBuffer>(stride, num_points);
15
16 const auto error_check = [](cudaError_t error) {
17 if(error != cudaSuccess) {
18 // std::cerr << "error : " << cudaGetErrorName(error) << std::endl;
19 // std::cerr << " : " << cudaGetErrorString(error) << std::endl;
20 }
21 };
22
25
26 float* dst_gl_ptr = nullptr;
27 size_t dst_size = 0;
28
31
33
36
37 return buffer;
38}
39
40static std::shared_ptr<PointCloudBuffer> create_point_cloud_buffer(const thrust::device_vector<Eigen::Vector3f>& points) {
41 return create_point_cloud_buffer(thrust::raw_pointer_cast(points.data()), sizeof(Eigen::Vector3f), points.size());
42}
43}
44
45#endif
Definition async_buffer_copy.hpp:6
static std::shared_ptr< PointCloudBuffer > create_point_cloud_buffer(const void *src_cuda_ptr, int stride, int num_points)
Definition pointcloud_buffer_cuda.hpp:13
std::enable_if_t< needs_aligned_allocator< T >::value, std::shared_ptr< T > > make_shared(Args &&... args)
Definition make_shared.hpp:20