Loading...
Searching...
No Matches
base_fixture.hpp
1/*
2 * Copyright (c) 2022-2024, NVIDIA CORPORATION.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
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
Base test fixture class from which libcuspatial test with only value parameterization should inherit.
Base test fixture class from which libcuspatial test with no parameterization or only with type param...
Mixin to supply rmm resources for fixtures.
rmm::device_async_resource_ref mr()
Returns pointer to device_memory_resource that should be used for all tests inheriting from this fixt...
rmm::cuda_stream_view stream()
Returns cuda_stream_view that should be used for computation in tests inheriting from this fixture.