device_initialization.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023-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 #pragma once
17 
19 
20 #include <variant>
21 #ifdef CUML_ENABLE_GPU
23 #endif
24 
25 namespace ML {
26 namespace experimental {
27 namespace fil {
28 namespace detail {
29 /* Set any required device options for optimizing FIL compute */
30 template <typename forest_t, raft_proto::device_type D>
32 {
33  device_initialization::initialize_device<forest_t>(device);
34 }
35 
36 /* Set any required device options for optimizing FIL compute */
37 template <typename forest_t>
39 {
40  std::visit(
41  [](auto&& concrete_device) {
42  device_initialization::initialize_device<forest_t>(concrete_device);
43  },
44  device);
45 }
46 } // namespace detail
47 } // namespace fil
48 } // namespace experimental
49 } // namespace ML
void initialize_device(raft_proto::device_id< D > device)
Definition: device_initialization.hpp:31
Definition: dbscan.hpp:30
std::variant< device_id< device_type::cpu >, device_id< device_type::gpu > > device_id_variant
Definition: device_id.hpp:31
Definition: base.hpp:22