| 1 | // Tencent is pleased to support the open source community by making ncnn available. |
| 2 | // |
| 3 | // Copyright (C) 2019 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 | #include "option.h" |
| 16 | |
| 17 | #include "cpu.h" |
| 18 | |
| 19 | namespace ncnn { |
| 20 | |
| 21 | Option::Option() |
| 22 | { |
| 23 | lightmode = true; |
| 24 | num_threads = get_physical_big_cpu_count(); |
| 25 | blob_allocator = 0; |
| 26 | workspace_allocator = 0; |
| 27 | |
| 28 | #if NCNN_VULKAN |
| 29 | blob_vkallocator = 0; |
| 30 | workspace_vkallocator = 0; |
| 31 | staging_vkallocator = 0; |
| 32 | pipeline_cache = 0; |
| 33 | #endif // NCNN_VULKAN |
| 34 | |
| 35 | openmp_blocktime = 20; |
| 36 | |
| 37 | use_winograd_convolution = true; |
| 38 | use_sgemm_convolution = true; |
| 39 | use_int8_inference = true; |
| 40 | use_vulkan_compute = false; // TODO enable me |
| 41 | |
| 42 | use_bf16_storage = false; |
| 43 | |
| 44 | use_fp16_packed = true; |
| 45 | use_fp16_storage = true; |
| 46 | use_fp16_arithmetic = true; |
| 47 | use_int8_packed = true; |
| 48 | use_int8_storage = true; |
| 49 | use_int8_arithmetic = false; |
| 50 | |
| 51 | use_packing_layout = true; |
| 52 | |
| 53 | use_shader_pack8 = false; |
| 54 | |
| 55 | use_subgroup_basic = false; |
| 56 | use_subgroup_vote = false; |
| 57 | use_subgroup_ballot = false; |
| 58 | use_subgroup_shuffle = false; |
| 59 | |
| 60 | use_image_storage = false; |
| 61 | use_tensor_storage = false; |
| 62 | |
| 63 | use_reserved_0 = false; |
| 64 | |
| 65 | flush_denormals = 3; |
| 66 | |
| 67 | use_local_pool_allocator = true; |
| 68 | |
| 69 | use_shader_local_memory = true; |
| 70 | use_cooperative_matrix = true; |
| 71 | |
| 72 | use_winograd23_convolution = true; |
| 73 | use_winograd43_convolution = true; |
| 74 | use_winograd63_convolution = true; |
| 75 | |
| 76 | use_a53_a55_optimized_kernel = is_current_thread_running_on_a53_a55(); |
| 77 | |
| 78 | use_fp16_uniform = true; |
| 79 | use_int8_uniform = true; |
| 80 | } |
| 81 | |
| 82 | } // namespace ncnn |