加载中...
正在搜索...
无匹配项
base_fixture.hpp
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
19#include <cudf_test/cudf_gtest.hpp>
20
21#include <rmm/cuda_stream_view.hpp>
22#include <rmm/mr/device/per_device_resource.hpp>
23#include <rmm/resource_ref.hpp>
24
25namespace cuspatial {
26namespace test {
27
32 rmm::device_async_resource_ref _mr{rmm::mr::get_current_device_resource()};
33 rmm::cuda_stream_view _stream{rmm::cuda_stream_default};
34
35 public
41 rmm::device_async_resource_ref mr() { return _mr; }
42
48 rmm::cuda_stream_view stream() { return _stream; }
49};
50
60class BaseFixture : public RMMResourceMixin, public ::testing::Test {};
61
84template <typename... Ts>
86 public ::testing::TestWithParam<std::tuple<Ts...>> {};
87
92using FloatingPointTypes = ::testing::Types<float, double>;
93
94} // namespace test
95} // namespace cuspatial
libcuspatial 中仅包含值参数化的测试应继承的基础测试夹具类。
libcuspatial 中不包含参数化或仅包含类型参数化的测试应继承的基础测试夹具类...
为夹具提供 rmm 资源的 Mixin。
rmm::device_async_resource_ref mr()
返回应供继承自此夹具的所有测试使用的 device_memory_resource 指针...
rmm::cuda_stream_view stream()
返回应供继承自此夹具的测试用于计算的 cuda_stream_view。