libcuspatial  23.12.00
Loading...
Searching...
No Matches
base_fixture.hpp
1/*
2 * Copyright (c) 2022-2023, 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 <rmm/cuda_stream_view.hpp>
20#include <rmm/mr/device/per_device_resource.hpp>
21
22#include <cudf_test/cudf_gtest.hpp>
23
24namespace cuspatial {
25namespace test {
26
31 rmm::mr::device_memory_resource* _mr{rmm::mr::get_current_device_resource()};
32 rmm::cuda_stream_view _stream{rmm::cuda_stream_default};
33
34 public:
40 rmm::mr::device_memory_resource* mr() { return _mr; }
41
47 rmm::cuda_stream_view stream() { return _stream; }
48};
49
59class BaseFixture : public RMMResourceMixin, public ::testing::Test {};
60
83template <typename... Ts>
85 public ::testing::TestWithParam<std::tuple<Ts...>> {};
86
91using FloatingPointTypes = ::testing::Types<float, double>;
92
93} // namespace test
94} // 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::mr::device_memory_resource * 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.