ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Config.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
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// For CLKernelLibraryEx initialization
18#include "arm_compute/core/CL/CLHelpers.h"
19#include "arm_compute/core/CL/CLKernelLibrary.h"
21
22#include <util/ConfigSource.h>
23
24#include <arm_compute/runtime/CL/CLScheduler.h>
25
26#include "Config.h"
27
28namespace onert
29{
30namespace backend
31{
32namespace acl_cl
33{
34
36{
37 if (!arm_compute::opencl_is_available())
38 {
39 return false;
40 }
41 arm_compute::CLScheduler::get().default_init();
42 // NOTE CLKernelLibraryEx must use the same context as CLScheduler
43 // It did not check whether another device is available.
45 "./cl_kernels/", arm_compute::CLScheduler::get().context(), cl::Device::getDefault());
46
47 return true;
48}
49
50} // namespace acl_cl
51} // namespace backend
52} // namespace onert
This file is a cloned version of CLKernelLibrary.h in ACL. This file defines an interface for CLKerne...
void init(std::string kernel_path, cl::Context context, cl::Device device)
Initialise the kernel library.
static CLKernelLibraryEx & get()
Get the KernelLibrary singleton.
bool initialize() override
Initialize the backend. This is called as soon as the backend is loaded.
Definition Config.cc:35