1
+ /* ******************************************************************************
2
+ * Copyright 2023 Intel 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
+ #include " oneapi/dal/detail/user_policy.hpp"
17
+
18
+ namespace oneapi ::dal::detail {
19
+ class user_cpu_context_impl {
20
+ public:
21
+ user_cpu_context_impl () : policy_(host_policy::get_default()) {}
22
+ user_cpu_context_impl (const host_policy& policy) : policy_(policy) {}
23
+ void set_host_policy (const host_policy& policy) {
24
+ policy_ = policy;
25
+ }
26
+ host_policy get_host_policy () {
27
+ return policy_;
28
+ }
29
+
30
+ private:
31
+ detail::host_policy policy_;
32
+ };
33
+
34
+ user_cpu_context::user_cpu_context () : impl_(new user_cpu_context_impl()) {}
35
+
36
+ user_cpu_context::user_cpu_context (const host_policy& policy)
37
+ : impl_(new user_cpu_context_impl(policy)) {}
38
+
39
+ void user_cpu_context::set_host_policy (const host_policy& policy) {
40
+ impl_->set_host_policy (policy);
41
+ }
42
+
43
+ host_policy user_cpu_context::get_host_policy () {
44
+ return impl_->get_host_policy ();
45
+ }
46
+
47
+ } // namespace oneapi::dal::detail
0 commit comments