加载中...
搜索中...
无匹配项
intersection.cuh
1/*
2 * 版权所有 (c) 2022-2024, NVIDIA CORPORATION。
3 *
4 * 根据 Apache 许可证版本 2.0 ("许可证") 获得许可;
5 * 除非符合许可证的规定,否则您不得使用此文件。
6 * 您可以在以下网址获得许可证副本:
7 *
8 * https://apache.ac.cn/licenses/LICENSE-2.0
9 *
10 * 除非适用法律要求或书面同意,否则软件
11 * 根据许可证分发是基于"原样"原则的,
12 * 不附带任何明示或暗示的保证或条件。
13 * 有关管理权限和限制的特定语言,请参阅许可证。
14 * 许可证下的限制。
15 */
16
17#pragma once
18
21
22#include <rmm/cuda_stream_view.hpp>
23#include <rmm/device_uvector.hpp>
24#include <rmm/mr/device/per_device_resource.hpp>
25#include <rmm/resource_ref.hpp>
26
27#include <thrust/pair.h>
28
29namespace cuspatial {
30
31enum IntersectionTypeCode : uint8_t { POINT = 0, LINESTRING = 1 };
32
42template <typename T, typename OffsetType>
44 using point_t = vec_2d<T>;
45 using segment_t = segment<T>;
46 using types_t = uint8_t;
47 using index_t = OffsetType;
48
50 std::unique_ptr<rmm::device_uvector<index_t>> geometry_collection_offset;
51
53 std::unique_ptr<rmm::device_uvector<types_t>> types_buffer;
54 std::unique_ptr<rmm::device_uvector<index_t>> offset_buffer;
55
57 std::unique_ptr<rmm::device_uvector<point_t>> points_coords;
58
60 std::unique_ptr<rmm::device_uvector<segment_t>> segments_coords;
61
63 std::unique_ptr<rmm::device_uvector<index_t>> lhs_linestring_id;
64 std::unique_ptr<rmm::device_uvector<index_t>> lhs_segment_id;
65 std::unique_ptr<rmm::device_uvector<index_t>> rhs_linestring_id;
66 std::unique_ptr<rmm::device_uvector<index_t>> rhs_segment_id;
67};
68
84template <typename T,
85 typename index_t,
86 typename MultiLinestringRange1,
87 typename MultiLinestringRange2>
88linestring_intersection_result<T, index_t> pairwise_linestring_intersection(
89 MultiLinestringRange1 multilinestrings1,
90 MultiLinestringRange2 multilinestrings2,
91 rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource(),
92 rmm::cuda_stream_view stream = rmm::cuda_stream_default);
93
94} // namespace cuspatial
95
96#include <cuspatial/detail/intersection/linestring_intersection.cuh>
一个通用的线段类型。
一个通用的二维向量类型。
std::unique_ptr< rmm::device_uvector< segment_t > > segments_coords
子项 1: 线段结果。
std::unique_ptr< rmm::device_uvector< index_t > > geometry_collection_offset
到联合列的列表偏移。
std::unique_ptr< rmm::device_uvector< point_t > > points_coords
子项 0: 点结果。
std::unique_ptr< rmm::device_uvector< index_t > > lhs_linestring_id
回溯索引。
std::unique_ptr< rmm::device_uvector< types_t > > types_buffer
联合列结果。