Adam Jesionowski | 6e273a7 | 2022-04-14 12:20:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2022 Google LLC |
| 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 | |
Cindy Liu | 3c4d627 | 2022-08-04 18:54:12 -0700 | [diff] [blame] | 17 | #ifndef DEVICE_DEVICE_H_ |
| 18 | #define DEVICE_DEVICE_H_ |
Cindy Liu | 2449a16 | 2021-11-12 22:48:02 -0800 | [diff] [blame] | 19 | |
Lun Dong | c393789 | 2022-10-11 13:19:37 -0700 | [diff] [blame] | 20 | #include "iree/hal/local/executable_loader.h" |
Cindy Liu | 2449a16 | 2021-11-12 22:48:02 -0800 | [diff] [blame] | 21 | |
| 22 | // Create the HAL device from the different backend targets. |
Lun Dong | c393789 | 2022-10-11 13:19:37 -0700 | [diff] [blame] | 23 | // The HAL device and loader are returned based on the implementation, and they |
| 24 | // must be released by the caller. |
Lun Dong | 328fb1f | 2021-12-03 22:57:00 +0000 | [diff] [blame] | 25 | iree_status_t create_sample_device(iree_allocator_t host_allocator, |
Lun Dong | c393789 | 2022-10-11 13:19:37 -0700 | [diff] [blame] | 26 | iree_hal_device_t** out_device, |
| 27 | iree_hal_executable_loader_t** loader); |
Cindy Liu | 2449a16 | 2021-11-12 22:48:02 -0800 | [diff] [blame] | 28 | |
Cindy Liu | 3c4d627 | 2022-08-04 18:54:12 -0700 | [diff] [blame] | 29 | #endif // DEVICE_DEVICE_H_ |