Elffuss BraidHub

kikocis/ncnn public

master · 1.4 KiBRawPermalink
1// Tencent is pleased to support the open source community by making ncnn available.
2//
3// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
4//
5// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
6// in compliance with the License. You may obtain a copy of the License at
7//
8// https://opensource.org/licenses/BSD-3-Clause
9//
10// Unless required by applicable law or agreed to in writing, software distributed
11// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12// CONDITIONS OF ANY KIND, either express or implied. See the License for the
13// specific language governing permissions and limitations under the License.
14
15#ifndef NCNN_SIMPLEOMP_H
16#define NCNN_SIMPLEOMP_H
17
18#include "platform.h"
19
20#if NCNN_SIMPLEOMP
21
22#include <stdint.h>
23
24// This minimal openmp runtime implementation only supports the llvm openmp abi
25// and only supports #pragma omp parallel for num_threads(X)
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31NCNN_EXPORT int omp_get_max_threads();
32
33NCNN_EXPORT void omp_set_num_threads(int num_threads);
34
35NCNN_EXPORT int omp_get_dynamic();
36
37NCNN_EXPORT void omp_set_dynamic(int dynamic);
38
39NCNN_EXPORT int omp_get_num_threads();
40
41NCNN_EXPORT int omp_get_thread_num();
42
43NCNN_EXPORT int kmp_get_blocktime();
44
45NCNN_EXPORT void kmp_set_blocktime(int blocktime);
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif // NCNN_SIMPLEOMP
52
53#endif // NCNN_SIMPLEOMP_H