├── repvgg_tensorrt_int8 ├── build │ ├── CMakeFiles │ │ ├── progress.marks │ │ ├── RepVGGsEngine.dir │ │ │ ├── progress.make │ │ │ ├── repvgg_infer.cc.o │ │ │ ├── cmake_clean.cmake │ │ │ ├── flags.make │ │ │ ├── DependInfo.cmake │ │ │ ├── link.txt │ │ │ ├── build.make │ │ │ ├── depend.internal │ │ │ └── depend.make │ │ ├── cmake.check_cache │ │ ├── 3.17.3 │ │ │ ├── CompilerIdC │ │ │ │ ├── a.out │ │ │ │ └── CMakeCCompilerId.c │ │ │ ├── CompilerIdCXX │ │ │ │ ├── a.out │ │ │ │ └── CMakeCXXCompilerId.cpp │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CMakeCCompiler.cmake │ │ │ └── CMakeCXXCompiler.cmake │ │ ├── TargetDirectories.txt │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── Makefile.cmake │ │ └── Makefile2 │ ├── RepVGGsEngine │ ├── cmake_install.cmake │ ├── Makefile │ └── CMakeCache.txt ├── test_imgs │ ├── cat.0.jpg │ ├── cat.103.jpg │ ├── dog.32.jpg │ └── dog.33.jpg ├── trt_engine_lib │ └── libMyTtrEngine-trt721.so ├── include │ ├── my_interface.h │ └── my_common.h ├── CMakeLists.txt └── repvgg_infer.cc ├── netron_repvgg.py ├── repvgg_tensorrt_int8_tools ├── __pycache__ │ ├── util_trt.cpython-36.pyc │ ├── util_trt.cpython-38.pyc │ └── calibrator.cpython-36.pyc ├── calibrator.py ├── util_trt.py └── convert_trt_quant.py ├── convert.py ├── models └── convert_model.py ├── export_onnx.py ├── utils.py ├── README.md ├── test.py ├── repvgg.py └── train.py /repvgg_tensorrt_int8/build/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /netron_repvgg.py: -------------------------------------------------------------------------------- 1 | import netron 2 | netron.start('./RepVGG-A0-simple.onnx', port=3344) 3 | 4 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/RepVGGsEngine: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/build/RepVGGsEngine -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/test_imgs/cat.0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/test_imgs/cat.0.jpg -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/test_imgs/cat.103.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/test_imgs/cat.103.jpg -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/test_imgs/dog.32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/test_imgs/dog.32.jpg -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/test_imgs/dog.33.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/test_imgs/dog.33.jpg -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/trt_engine_lib/libMyTtrEngine-trt721.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/trt_engine_lib/libMyTtrEngine-trt721.so -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CompilerIdC/a.out -------------------------------------------------------------------------------- /repvgg_tensorrt_int8_tools/__pycache__/util_trt.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8_tools/__pycache__/util_trt.cpython-36.pyc -------------------------------------------------------------------------------- /repvgg_tensorrt_int8_tools/__pycache__/util_trt.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8_tools/__pycache__/util_trt.cpython-38.pyc -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /repvgg_tensorrt_int8_tools/__pycache__/calibrator.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8_tools/__pycache__/calibrator.cpython-36.pyc -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wulingtian/RepVGG_TensorRT_int8/HEAD/repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles/rebuild_cache.dir 2 | /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles/edit_cache.dir 3 | /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir 4 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o" 3 | "RepVGGsEngine" 4 | "RepVGGsEngine.pdb" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/RepVGGsEngine.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=gnu++14 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/usr/local/cuda-11.0/include -I/home/willer/RepVGG/repvgg_tensorrt_int8/include -isystem /opt/intel/openvino_2020.4.287/opencv/include 10 | 11 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-5.4.0-42-generic") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "5.4.0-42-generic") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-5.4.0-42-generic") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "5.4.0-42-generic") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/willer/RepVGG/repvgg_tensorrt_int8") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/willer/RepVGG/repvgg_tensorrt_int8/build") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/willer/RepVGG/repvgg_tensorrt_int8/repvgg_infer.cc" "/home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "GNU") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | "/usr/local/cuda-11.0/include" 14 | "../include" 15 | "/opt/intel/openvino_2020.4.287/opencv/include" 16 | ) 17 | 18 | # Targets to which this target links. 19 | set(CMAKE_TARGET_LINKED_INFO_FILES 20 | ) 21 | 22 | # Fortran module output directory. 23 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 24 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/include/my_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef __MY_INTERFACE_H_ 2 | #define __MY_INTERFACE_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #include "my_common.h" 10 | 11 | result_t my_init_tensors(tensor_params_array_t *input_tensors_params, tensor_params_array_t *output_tensors_params, 12 | tensor_array_t **input_tensors, tensor_array_t **output_tensors); 13 | 14 | result_t my_deinit_tensors(tensor_array_t *input_tensors, tensor_array_t *output_tensors); 15 | 16 | 17 | result_t my_load_model(model_params_t *load_model_param, 18 | tensor_array_t *input_tensors, 19 | tensor_array_t *output_tensors, 20 | model_handle_t *load_model_handle); 21 | 22 | 23 | result_t my_release_model(model_handle_t *load_model_handle); 24 | 25 | 26 | result_t my_inference_tensors(model_handle_t *load_model_handle); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif -------------------------------------------------------------------------------- /convert.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import torch 4 | import torch.nn.parallel 5 | import torch.optim 6 | import torch.utils.data 7 | import torch.utils.data.distributed 8 | 9 | from repvgg import get_RepVGG_func_by_name, repvgg_model_convert 10 | 11 | parser = argparse.ArgumentParser(description='RepVGG Conversion') 12 | parser.add_argument('load', metavar='LOAD', help='path to the weights file') 13 | parser.add_argument('save', metavar='SAVE', help='path to the weights file') 14 | parser.add_argument('-a', '--arch', metavar='ARCH', default='RepVGG-A0') 15 | 16 | def convert(): 17 | args = parser.parse_args() 18 | 19 | repvgg_build_func = get_RepVGG_func_by_name(args.arch) 20 | 21 | train_model = repvgg_build_func(deploy=False) 22 | 23 | if os.path.isfile(args.load): 24 | print("=> loading checkpoint '{}'".format(args.load)) 25 | checkpoint = torch.load(args.load) 26 | if 'state_dict' in checkpoint: 27 | checkpoint = checkpoint['state_dict'] 28 | ckpt = {k.replace('module.', ''): v for k, v in checkpoint.items()} # strip the names 29 | train_model.load_state_dict(ckpt) 30 | else: 31 | print("=> no checkpoint found at '{}'".format(args.load)) 32 | 33 | repvgg_model_convert(train_model, build_func=repvgg_build_func, save_path=args.save) 34 | 35 | 36 | if __name__ == '__main__': 37 | convert() -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(RepVGGsEngine) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | SET(USER_DIR /home/willer) 7 | 8 | SET(CUDA_INC_DIR /usr/local/cuda-11.0/include) 9 | SET(CUDNN_INC_DIR /usr/local/cuda-11.0/include) 10 | SET(TENSORRT_INC_DIR ${USER_DIR}/TensorRT-7.2.1.6/include) 11 | SET(TRT_ENGINE_INC_DIR include) 12 | SET(INC_DIR ${CUDA_INC_DIR} ${CUDNN_INC_DIR} ${TRT_ENGINE_INC_DIR} ${TRT_ENGINE_INC_DIR}) 13 | 14 | SET(CUDA_LIB_DIR /usr/local/cuda-11.0/lib64) 15 | SET(CUDNN_LIB_DIR /usr/local/cuda-11.0/lib64) 16 | SET(TENSORRT_LIB_DIR ${USER_DIR}/TensorRT-7.2.1.6/lib) 17 | SET(TRT_ENGINE_LIB_DIR trt_engine_lib/) 18 | SET(LIB_DIR ${CUDA_LIB_DIR} ${CUDNN_LIB_DIR} ${TENSORRT_LIB_DIR} ${TRT_ENGINE_LIB_DIR}) 19 | 20 | set(TRT_LIBS nvinfer nvinfer_plugin ) 21 | set(CUDNN_LIBs cudnn ) 22 | set(TRT_ENGINE_LIBS MyTtrEngine-trt721) 23 | set(CUDA_LIBS cublas cudart curand cufft nppig) 24 | 25 | set(LINK_LIBS ${TRT_LIBS} ${CUDNN_LIBs} ${TRT_ENGINE_LIBS} ${CUDA_LIBS}) 26 | 27 | set(OpenCV_INCLUDE_DIRS ${USER_DIR}/opencv-3.4.2/include) 28 | set(OpenCV_LIBS_DIR ${USER_DIR}/opencv-3.4.2/build/lib) 29 | set(OpenCV_LIBS opencv_core opencv_dnn opencv_imgproc opencv_imgcodecs opencv_highgui) 30 | 31 | find_package(OpenCV REQUIRED) 32 | 33 | include_directories(${INC_DIR} ${OpenCV_INCLUDE_DIRS}) 34 | link_directories(${LIB_DIR} ${OpenCV_LIBS_DIR}) 35 | link_libraries(${LINK_LIBS} ${OpenCV_LIBS}) 36 | 37 | add_executable(RepVGGsEngine 38 | repvgg_infer.cc) 39 | -------------------------------------------------------------------------------- /models/convert_model.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | #gen coco pretrained weight 3 | import torch 4 | num_classes = 2 5 | checkpoint = torch.load("RepVGG-A0-train.pth") 6 | #print(checkpoint.keys()) 7 | for key in list(checkpoint.keys()): 8 | checkpoint["module." + key] = checkpoint.pop(key) 9 | 10 | checkpoint["module.linear.weight"] = checkpoint["module.linear.weight"][:num_classes, :] 11 | checkpoint["module.linear.bias"] = checkpoint["module.linear.bias"][:num_classes] 12 | torch.save(checkpoint, "RepVGG-A0-classes%d.pth" % num_classes) 13 | 14 | # weight 15 | #model_coco["state_dict"]["bbox_head.0.fc_cls.weight"] = model_coco["state_dict"]["bbox_head.0.fc_cls.weight"][:num_classes, :] 16 | #model_coco["state_dict"]["bbox_head.1.fc_cls.weight"] = model_coco["state_dict"]["bbox_head.1.fc_cls.weight"][:num_classes, :] 17 | #model_coco["state_dict"]["bbox_head.2.fc_cls.weight"] = model_coco["state_dict"]["bbox_head.2.fc_cls.weight"][:num_classes, :] 18 | # bias 19 | #model_coco["state_dict"]["bbox_head.0.fc_cls.bias"] = model_coco["state_dict"]["bbox_head.0.fc_cls.bias"][:num_classes] 20 | #model_coco["state_dict"]["bbox_head.1.fc_cls.bias"] = model_coco["state_dict"]["bbox_head.1.fc_cls.bias"][:num_classes] 21 | #model_coco["state_dict"]["bbox_head.2.fc_cls.bias"] = model_coco["state_dict"]["bbox_head.2.fc_cls.bias"][:num_classes] 22 | # save new model 23 | #torch.save(model_coco, "cascade_rcnn_r50_coco_pretrained_weights_classes_%d.pth" % num_classes) 24 | 25 | if __name__ == "__main__": 26 | main() 27 | 28 | -------------------------------------------------------------------------------- /export_onnx.py: -------------------------------------------------------------------------------- 1 | import onnx 2 | import torch 3 | from repvgg import get_RepVGG_func_by_name 4 | from onnxsim import simplify 5 | import argparse 6 | 7 | 8 | def main(arch, model_path, output_path, input_shape=(224, 224), batch_size=1): 9 | repvgg_build_func = get_RepVGG_func_by_name(arch) 10 | model = repvgg_build_func(deploy=True) 11 | model.load_state_dict(torch.load(model_path)) 12 | dummy_input = torch.autograd.Variable(torch.randn(batch_size, 3, input_shape[0], input_shape[1])) 13 | torch.onnx.export(model, dummy_input, output_path, verbose=True, keep_initializers_as_inputs=True, opset_version=12) 14 | onnx_model = onnx.load(output_path) # load onnx model 15 | model_simp, check = simplify(onnx_model) 16 | assert check, "Simplified ONNX model could not be validated" 17 | onnx.save(model_simp, output_path) 18 | print('finished exporting onnx ') 19 | 20 | 21 | if __name__ == '__main__': 22 | parser = argparse.ArgumentParser() 23 | parser.add_argument('-a', '--arch', metavar='ARCH', default='RepVGG-A0') 24 | parser.add_argument('--weights_file', type=str, default='./RepVGG-A0-deploy.pth', help='weights file path') 25 | parser.add_argument('--output_file', type=str, default='./RepVGG-A0-simple.onnx', help='onnx file path') 26 | parser.add_argument('--img_size', nargs='+', type=int, default=[224, 224], help='image size') 27 | parser.add_argument('--batch_size', type=int, default=1, help='batch size') 28 | opt = parser.parse_args() 29 | main(opt.arch, opt.weights_file, opt.output_file, input_shape=opt.img_size, batch_size=opt.batch_size) 30 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o -o RepVGGsEngine -L/usr/local/cuda-11.0/lib64 -L/home/willer/TensorRT-7.2.1.6/lib -L/home/willer/RepVGG/repvgg_tensorrt_int8/trt_engine_lib -L/home/willer/temp/opencv-3.4.2/build/lib -Wl,-rpath,/usr/local/cuda-11.0/lib64:/home/willer/TensorRT-7.2.1.6/lib:/home/willer/RepVGG/repvgg_tensorrt_int8/trt_engine_lib:/home/willer/temp/opencv-3.4.2/build/lib:/opt/intel/openvino_2020.4.287/opencv/lib -lnvinfer -lnvinfer_plugin -lcudnn -lMyTtrEngine-trt721 -lcublas -lcudart -lcurand -lcufft -lnppig /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_dnn.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_gapi.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_highgui.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_ml.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_objdetect.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_photo.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_stitching.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_video.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_videoio.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_imgcodecs.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_calib3d.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_features2d.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_imgproc.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_flann.so.4.4.0 /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_core.so.4.4.0 2 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/willer/RepVGG/repvgg_tensorrt_int8 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | if(CMAKE_INSTALL_COMPONENT) 41 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 42 | else() 43 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 44 | endif() 45 | 46 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 47 | "${CMAKE_INSTALL_MANIFEST_FILES}") 48 | file(WRITE "/home/willer/RepVGG/repvgg_tensorrt_int8/build/${CMAKE_INSTALL_MANIFEST}" 49 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 50 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | class AverageMeter(object): 4 | """Computes and stores the average and current value""" 5 | def __init__(self, name, fmt=':f'): 6 | self.name = name 7 | self.fmt = fmt 8 | self.reset() 9 | 10 | def reset(self): 11 | self.val = 0 12 | self.avg = 0 13 | self.sum = 0 14 | self.count = 0 15 | 16 | def update(self, val, n=1): 17 | self.val = val 18 | self.sum += val * n 19 | self.count += n 20 | self.avg = self.sum / self.count 21 | 22 | def __str__(self): 23 | fmtstr = '{name} {val' + self.fmt + '} ({avg' + self.fmt + '})' 24 | return fmtstr.format(**self.__dict__) 25 | 26 | 27 | class ProgressMeter(object): 28 | def __init__(self, num_batches, meters, prefix=""): 29 | self.batch_fmtstr = self._get_batch_fmtstr(num_batches) 30 | self.meters = meters 31 | self.prefix = prefix 32 | 33 | def display(self, batch): 34 | entries = [self.prefix + self.batch_fmtstr.format(batch)] 35 | entries += [str(meter) for meter in self.meters] 36 | print('\t'.join(entries)) 37 | 38 | def _get_batch_fmtstr(self, num_batches): 39 | num_digits = len(str(num_batches // 1)) 40 | fmt = '{:' + str(num_digits) + 'd}' 41 | return '[' + fmt + '/' + fmt.format(num_batches) + ']' 42 | 43 | 44 | def accuracy(output, target, topk=(1,)): 45 | """Computes the accuracy over the k top predictions for the specified values of k""" 46 | with torch.no_grad(): 47 | maxk = max(topk) 48 | batch_size = target.size(0) 49 | #print(output) 50 | 51 | _, pred = output.topk(maxk, 1, True, True) 52 | pred = pred.t() 53 | #print(pred) 54 | correct = pred.eq(target.view(1, -1).expand_as(pred)) 55 | 56 | res = [] 57 | for k in topk: 58 | correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True) 59 | res.append(correct_k.mul_(100.0 / batch_size)) 60 | return res 61 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8_tools/calibrator.py: -------------------------------------------------------------------------------- 1 | # *** tensorrt校准模块 *** 2 | 3 | import os 4 | import torch 5 | import torch.nn.functional as F 6 | import tensorrt as trt 7 | import pycuda.driver as cuda 8 | import pycuda.autoinit 9 | import numpy as np 10 | import ctypes 11 | import logging 12 | import util_trt 13 | logger = logging.getLogger(__name__) 14 | ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_char_p 15 | ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py_object, ctypes.c_char_p] 16 | 17 | # calibrator 18 | #IInt8EntropyCalibrator2 19 | #IInt8LegacyCalibrator 20 | #IInt8EntropyCalibrator 21 | #IInt8MinMaxCalibrator 22 | class Calibrator(trt.IInt8EntropyCalibrator2): 23 | def __init__(self, stream, cache_file=""): 24 | trt.IInt8EntropyCalibrator2.__init__(self) 25 | self.stream = stream 26 | self.d_input = cuda.mem_alloc(self.stream.calibration_data.nbytes) 27 | self.cache_file = cache_file 28 | stream.reset() 29 | 30 | def get_batch_size(self): 31 | return self.stream.batch_size 32 | 33 | def get_batch(self, names): 34 | #print("############################################################") 35 | #print(names) 36 | #print("############################################################") 37 | batch = self.stream.next_batch() 38 | if not batch.size: 39 | return None 40 | 41 | cuda.memcpy_htod(self.d_input, batch) 42 | 43 | return [int(self.d_input)] 44 | 45 | def read_calibration_cache(self): 46 | # If there is a cache, use it instead of calibrating again. Otherwise, implicitly return None. 47 | if os.path.exists(self.cache_file): 48 | with open(self.cache_file, "rb") as f: 49 | logger.info("Using calibration cache to save time: {:}".format(self.cache_file)) 50 | return f.read() 51 | 52 | def write_calibration_cache(self, cache): 53 | with open(self.cache_file, "wb") as f: 54 | logger.info("Caching calibration data for future use: {:}".format(self.cache_file)) 55 | f.write(cache) 56 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "7.5.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "Linux") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 16 | set(CMAKE_C_SIMULATE_VERSION "") 17 | 18 | 19 | 20 | set(CMAKE_AR "/usr/bin/ar") 21 | set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-7") 22 | set(CMAKE_RANLIB "/usr/bin/ranlib") 23 | set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-7") 24 | set(CMAKE_LINKER "/usr/bin/ld") 25 | set(CMAKE_MT "") 26 | set(CMAKE_COMPILER_IS_GNUCC 1) 27 | set(CMAKE_C_COMPILER_LOADED 1) 28 | set(CMAKE_C_COMPILER_WORKS TRUE) 29 | set(CMAKE_C_ABI_COMPILED TRUE) 30 | set(CMAKE_COMPILER_IS_MINGW ) 31 | set(CMAKE_COMPILER_IS_CYGWIN ) 32 | if(CMAKE_COMPILER_IS_CYGWIN) 33 | set(CYGWIN 1) 34 | set(UNIX 1) 35 | endif() 36 | 37 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 38 | 39 | if(CMAKE_COMPILER_IS_MINGW) 40 | set(MINGW 1) 41 | endif() 42 | set(CMAKE_C_COMPILER_ID_RUN 1) 43 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 44 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_C_LINKER_PREFERENCE 10) 46 | 47 | # Save compiler ABI information. 48 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 49 | set(CMAKE_C_COMPILER_ABI "ELF") 50 | set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 51 | 52 | if(CMAKE_C_SIZEOF_DATA_PTR) 53 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 54 | endif() 55 | 56 | if(CMAKE_C_COMPILER_ABI) 57 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 58 | endif() 59 | 60 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 61 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 62 | endif() 63 | 64 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 65 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 66 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 67 | endif() 68 | 69 | 70 | 71 | 72 | 73 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include") 74 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") 75 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/opt/intel/openvino_2020.4.287/data_processing/dl_streamer/lib;/opt/intel/openvino_2020.4.287/data_processing/gstreamer/lib;/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 76 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 77 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8_tools/util_trt.py: -------------------------------------------------------------------------------- 1 | # tensorrt-lib 2 | 3 | import os 4 | import tensorrt as trt 5 | import pycuda.autoinit 6 | import pycuda.driver as cuda 7 | from calibrator import Calibrator 8 | from torch.autograd import Variable 9 | import torch 10 | import numpy as np 11 | import time 12 | # add verbose 13 | TRT_LOGGER = trt.Logger(trt.Logger.VERBOSE) # ** engine可视化 ** 14 | 15 | # create tensorrt-engine 16 | # fixed and dynamic 17 | def get_engine(max_batch_size=1, onnx_file_path="", engine_file_path="",\ 18 | fp16_mode=False, int8_mode=False, calibration_stream=None, calibration_table_path="", save_engine=False): 19 | """Attempts to load a serialized engine if available, otherwise builds a new TensorRT engine and saves it.""" 20 | def build_engine(max_batch_size, save_engine): 21 | """Takes an ONNX file and creates a TensorRT engine to run inference with""" 22 | with trt.Builder(TRT_LOGGER) as builder, \ 23 | builder.create_network(1) as network,\ 24 | trt.OnnxParser(network, TRT_LOGGER) as parser: 25 | 26 | # parse onnx model file 27 | if not os.path.exists(onnx_file_path): 28 | quit('ONNX file {} not found'.format(onnx_file_path)) 29 | print('Loading ONNX file from path {}...'.format(onnx_file_path)) 30 | with open(onnx_file_path, 'rb') as model: 31 | print('Beginning ONNX file parsing') 32 | parser.parse(model.read()) 33 | assert network.num_layers > 0, 'Failed to parse ONNX model. \ 34 | Please check if the ONNX model is compatible ' 35 | print('Completed parsing of ONNX file') 36 | print('Building an engine from file {}; this may take a while...'.format(onnx_file_path)) 37 | 38 | # build trt engine 39 | builder.max_batch_size = max_batch_size 40 | builder.max_workspace_size = 1 << 30 # 1GB 41 | builder.fp16_mode = fp16_mode 42 | if int8_mode: 43 | builder.int8_mode = int8_mode 44 | assert calibration_stream, 'Error: a calibration_stream should be provided for int8 mode' 45 | builder.int8_calibrator = Calibrator(calibration_stream, calibration_table_path) 46 | print('Int8 mode enabled') 47 | engine = builder.build_cuda_engine(network) 48 | if engine is None: 49 | print('Failed to create the engine') 50 | return None 51 | print("Completed creating the engine") 52 | if save_engine: 53 | with open(engine_file_path, "wb") as f: 54 | f.write(engine.serialize()) 55 | return engine 56 | 57 | if os.path.exists(engine_file_path): 58 | # If a serialized engine exists, load it instead of building a new one. 59 | print("Reading engine from file {}".format(engine_file_path)) 60 | with open(engine_file_path, "rb") as f, trt.Runtime(TRT_LOGGER) as runtime: 61 | return runtime.deserialize_cuda_engine(f.read()) 62 | else: 63 | return build_engine(max_batch_size, save_engine) 64 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "../CMakeLists.txt" 11 | "CMakeFiles/3.17.3/CMakeCCompiler.cmake" 12 | "CMakeFiles/3.17.3/CMakeCXXCompiler.cmake" 13 | "CMakeFiles/3.17.3/CMakeSystem.cmake" 14 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCInformation.cmake" 15 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCXXInformation.cmake" 16 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" 17 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeCommonLanguageInclude.cmake" 18 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeGenericSystem.cmake" 19 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeInitializeConfigs.cmake" 20 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeLanguageInformation.cmake" 21 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeSystemSpecificInformation.cmake" 22 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/CMakeSystemSpecificInitialize.cmake" 23 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 24 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Compiler/GNU-C.cmake" 25 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Compiler/GNU-CXX.cmake" 26 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Compiler/GNU.cmake" 27 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake" 28 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/FindPackageMessage.cmake" 29 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Internal/CMakeCheckCompilerFlag.cmake" 30 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Platform/Linux-GNU-C.cmake" 31 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Platform/Linux-GNU-CXX.cmake" 32 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Platform/Linux-GNU.cmake" 33 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Platform/Linux.cmake" 34 | "/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17/Modules/Platform/UnixPaths.cmake" 35 | "/opt/intel/openvino_2020.4.287/opencv/cmake/OpenCVConfig-version.cmake" 36 | "/opt/intel/openvino_2020.4.287/opencv/cmake/OpenCVConfig.cmake" 37 | "/opt/intel/openvino_2020.4.287/opencv/cmake/OpenCVModules-release.cmake" 38 | "/opt/intel/openvino_2020.4.287/opencv/cmake/OpenCVModules.cmake" 39 | ) 40 | 41 | # The corresponding makefile is: 42 | set(CMAKE_MAKEFILE_OUTPUTS 43 | "Makefile" 44 | "CMakeFiles/cmake.check_cache" 45 | ) 46 | 47 | # Byproducts of CMake generate step: 48 | set(CMAKE_MAKEFILE_PRODUCTS 49 | "CMakeFiles/CMakeDirectoryInformation.cmake" 50 | ) 51 | 52 | # Dependency information for all targets: 53 | set(CMAKE_DEPEND_INFO_FILES 54 | "CMakeFiles/RepVGGsEngine.dir/DependInfo.cmake" 55 | ) 56 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8_tools/convert_trt_quant.py: -------------------------------------------------------------------------------- 1 | # eval_trt(temp_demo) 2 | 3 | import numpy as np 4 | import torch 5 | import torch.nn as nn 6 | # tensorrt-lib 7 | import util_trt 8 | import glob,os,cv2 9 | 10 | BATCH_SIZE = 8 11 | BATCH = 30 12 | CALIB_IMG_DIR = '/home/willer/RepVGG/calibration_data' 13 | onnx_model_path = "/home/willer/RepVGG/RepVGG-A0-simple.onnx" 14 | 15 | height = 224 16 | width = 224 17 | mean=[0.485, 0.456, 0.406] 18 | std=[0.229, 0.224, 0.225] 19 | def preprocess_v1(image_raw): 20 | h, w, c = image_raw.shape 21 | image = cv2.cvtColor(image_raw, cv2.COLOR_BGR2RGB) 22 | # Calculate widht and height and paddings 23 | r_w = width / w 24 | r_h = height / h 25 | if r_h > r_w: 26 | tw = width 27 | th = int(r_w * h) 28 | tx1 = tx2 = 0 29 | ty1 = int((height - th) / 2) 30 | ty2 = height - th - ty1 31 | else: 32 | tw = int(r_h * w) 33 | th = height 34 | tx1 = int((width - tw) / 2) 35 | tx2 = width - tw - tx1 36 | ty1 = ty2 = 0 37 | # Resize the image with long side while maintaining ratio 38 | image = cv2.resize(image, (tw, th)) 39 | # Pad the short side with (128,128,128) 40 | image = cv2.copyMakeBorder( 41 | image, ty1, ty2, tx1, tx2, cv2.BORDER_CONSTANT, (0, 0, 0) 42 | ) 43 | image = image.astype(np.float32) 44 | # Normalize to [0,1] 45 | image /= 255.0 46 | image -= mean 47 | image /= std 48 | # HWC to CHW format: 49 | image = np.transpose(image, [2, 0, 1]) 50 | # CHW to NCHW format 51 | #image = np.expand_dims(image, axis=0) 52 | # Convert the image to row-major order, also known as "C order": 53 | #image = np.ascontiguousarray(image) 54 | return image 55 | 56 | class DataLoader: 57 | def __init__(self): 58 | self.index = 0 59 | self.length = BATCH 60 | self.batch_size = BATCH_SIZE 61 | # self.img_list = [i.strip() for i in open('calib.txt').readlines()] 62 | self.img_list = glob.glob(os.path.join(CALIB_IMG_DIR, "*.jpg")) 63 | assert len(self.img_list) > self.batch_size * self.length, '{} must contains more than '.format(CALIB_IMG_DIR) + str(self.batch_size * self.length) + ' images to calib' 64 | print('found all {} images to calib.'.format(len(self.img_list))) 65 | self.calibration_data = np.zeros((self.batch_size,3,height,width), dtype=np.float32) 66 | 67 | def reset(self): 68 | self.index = 0 69 | 70 | def next_batch(self): 71 | if self.index < self.length: 72 | for i in range(self.batch_size): 73 | assert os.path.exists(self.img_list[i + self.index * self.batch_size]), 'not found!!' 74 | img = cv2.imread(self.img_list[i + self.index * self.batch_size]) 75 | img = preprocess_v1(img) 76 | self.calibration_data[i] = img 77 | 78 | self.index += 1 79 | 80 | # example only 81 | return np.ascontiguousarray(self.calibration_data, dtype=np.float32) 82 | else: 83 | return np.array([]) 84 | 85 | def __len__(self): 86 | return self.length 87 | 88 | def main(): 89 | #onnx_model_fixed = "/home/willer/yolov5-2.0/models/models_origal/yolov5s-simple.onnx" 90 | # onnx2trt 91 | fp16_mode = False 92 | int8_mode = True 93 | print('*** onnx to tensorrt begin ***') 94 | # calibration 95 | calibration_stream = DataLoader() 96 | engine_model_path = "models_save/RepVGG-A0_int8.trt" 97 | calibration_table = 'models_save/RepVGG-A0_calibration.cache' 98 | # fixed_engine,校准产生校准表 99 | engine_fixed = util_trt.get_engine(BATCH_SIZE, onnx_model_path, engine_model_path, fp16_mode=fp16_mode, 100 | int8_mode=int8_mode, calibration_stream=calibration_stream, calibration_table_path=calibration_table, save_engine=True) 101 | assert engine_fixed, 'Broken engine_fixed' 102 | print('*** onnx to tensorrt completed ***\n') 103 | 104 | if __name__ == '__main__': 105 | main() 106 | 107 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 环境配置 2 | 3 | ubuntu:18.04 4 | 5 | cuda:11.0 6 | 7 | cudnn:8.0 8 | 9 | tensorrt:7.2.16 10 | 11 | OpenCV:3.4.2 12 | 13 | cuda,cudnn,tensorrt和OpenCV安装包(编译好了,也可以自己从官网下载编译)可以从链接: https://pan.baidu.com/s/1Nl5XTAsUOyTbY6VbigsMNQ 密码: c4dn 14 | 15 | cuda安装 16 | 17 | 如果系统有安装驱动,运行如下命令卸载 18 | 19 | sudo apt-get purge nvidia* 20 | 21 | 禁用nouveau,运行如下命令 22 | 23 | sudo vim /etc/modprobe.d/blacklist.conf 24 | 25 | 在末尾添加 26 | 27 | blacklist nouveau 28 | 29 | 然后执行 30 | 31 | sudo update-initramfs -u 32 | 33 | chmod +x cuda_11.0.2_450.51.05_linux.run 34 | 35 | sudo ./cuda_11.0.2_450.51.05_linux.run 36 | 37 | 是否接受协议: accept 38 | 39 | 然后选择Install 40 | 41 | 最后回车 42 | 43 | vim ~/.bashrc 添加如下内容: 44 | 45 | export PATH=/usr/local/cuda-11.0/bin:$PATH 46 | 47 | export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64:$LD_LIBRARY_PATH 48 | 49 | source ~/.bashrc 激活环境 50 | 51 | cudnn 安装 52 | 53 | tar -xzvf cudnn-11.0-linux-x64-v8.0.4.30.tgz 54 | 55 | cd cuda/include 56 | 57 | sudo cp *.h /usr/local/cuda-11.0/include 58 | 59 | cd cuda/lib64 60 | 61 | sudo cp libcudnn* /usr/local/cuda-11.0/lib64 62 | 63 | tensorrt及OpenCV安装 64 | 65 | 定位到用户根目录 66 | 67 | tar -xzvf TensorRT-7.2.1.6.Ubuntu-18.04.x86_64-gnu.cuda-11.0.cudnn8.0.tar.gz 68 | 69 | cd TensorRT-7.2.1.6/python,该目录有4个python版本的tensorrt安装包 70 | 71 | sudo pip3 install tensorrt-7.2.1.6-cp37-none-linux_x86_64.whl(根据自己的python版本安装) 72 | 73 | pip install pycuda 安装python版本的cuda 74 | 75 | 定位到用户根目录 76 | 77 | tar -xzvf opencv-3.4.2.zip 以备推理调用 78 | 79 | # RepVGG模型训练以及转换onnx 80 | 81 | 定位到用户根目录 82 | 83 | git clone https://github.com/Wulingtian/RepVGG_TensorRT_int8.git 84 | 85 | cd RepVGG_TensorRT_int8/models 86 | 87 | vim convert_model.py 88 | 89 | 设置 num_classes,例如:我训练的是猫狗识别,则设置为2 90 | 91 | python convert_model.py 生成可加载的ImageNet预训练模型路径 92 | 93 | cd RepVGG_TensorRT_int8 94 | 95 | vim repvgg.py 定位到154行,修改类别数 96 | 97 | vim train.py 修改IMAGENET_TRAINSET_SIZE参数 指定训练图片的数量 98 | 99 | 根据自己的训练数据及配置设置data(数据集路径),arch(我选择的是最小的模型RepVGG-A0),epochs,lr,batch-size,model_path(设置ImageNet预训练模型路径,就是上面convert_model.py转换得到的模型)等参数 100 | 101 | python train.py,开始训练,模型保存在当前目录,名为model_best.pth.tar 102 | 103 | python convert.py model_best.pth.tar RepVGG-A0-deploy.pth -a RepVGG-A0(指定模型类型,我训练的是RepVGG-A0) 104 | 105 | vim export_onnx.py 106 | 107 | 设置arch,weights_file(convert.py生成的模型),output_file(输出模型名称),img_size(图片输入大小),batch_size(推理的batch) 108 | 109 | python export_onnx.py得到onnx模型 110 | 111 | # onnx模型转换为 int8 tensorrt引擎 112 | 113 | cd RepVGG_TensorRT_int8/repvgg_tensorrt_int8_tools 114 | 115 | vim convert_trt_quant.py 修改如下参数 116 | 117 | BATCH_SIZE 模型量化一次输入多少张图片 118 | 119 | BATCH 模型量化次数 120 | 121 | height width 输入图片宽和高 122 | 123 | CALIB_IMG_DIR 量化图片路径(把训练的图片放到一个文件夹下,然后把这个文件夹设置为此参数,注意BATCH_SIZE*BATCH要小于或等于训练图片数量) 124 | 125 | onnx_model_path onnx模型路径(上面运行export_onnx.py得到的onnx模型) 126 | 127 | python convert_trt_quant.py 量化后的模型存到models_save目录下 128 | 129 | # tensorrt模型推理 130 | 131 | cd RepVGG_TensorRT_int8/repvgg_tensorrt_int8 132 | 133 | cd yolov5_tensorrt_int8 134 | 135 | vim CMakeLists.txt 136 | 137 | 修改USER_DIR参数为自己的用户根目录 138 | 139 | vim repvgg_infer.cc修改如下参数 140 | 141 | output_name repvgg模型有1个输出 142 | 143 | 我们可以通过netron查看模型输出名 144 | 145 | pip install netron 安装netron 146 | 147 | vim netron_repvgg.py 把如下内容粘贴 148 | 149 | import netron 150 | 151 | netron.start('此处填充简化后的onnx模型路径', port=3344) 152 | 153 | python netron_repvgg.py 即可查看 模型输出名 154 | 155 | trt_model_path 量化的tensorrt推理引擎(models_save目录下trt后缀的文件) 156 | 157 | test_img 测试图片路径 158 | 159 | INPUT_W INPUT_H 输入图片宽高 160 | 161 | NUM_CLASS 训练的模型有多少类 162 | 163 | 参数配置完毕 164 | 165 | mkdir build 166 | 167 | cd build 168 | 169 | cmake .. 170 | 171 | make 172 | 173 | ./RepVGGsEngine 输出平均推理时间,实测平均推理时间小于1ms一帧,不得不说,RepVGG真的很香!至此,部署完成! 174 | 175 | # 训练数据链接 176 | 177 | 由于我训练的是猫狗识别下面放一张猫狗同框的图片结尾 178 | 179 | 顺便放一下我的数据集链接 180 | 181 | 链接: https://pan.baidu.com/s/1Mh6GxTLoXRTCRQh-TPUc3Q 密码: 3dt3 182 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | #============================================================================= 10 | # Special targets provided by cmake. 11 | 12 | # Disable implicit rules so canonical targets will work. 13 | .SUFFIXES: 14 | 15 | 16 | # Disable VCS-based implicit rules. 17 | % : %,v 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : RCS/% 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/%,v 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : SCCS/s.% 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : s.% 34 | 35 | 36 | .SUFFIXES: .hpux_make_needs_suffix_list 37 | 38 | 39 | # Command-line flag to silence nested $(MAKE). 40 | $(VERBOSE)MAKESILENT = -s 41 | 42 | # Suppress display of executed commands. 43 | $(VERBOSE).SILENT: 44 | 45 | 46 | # A target that is always out of date. 47 | cmake_force: 48 | 49 | .PHONY : cmake_force 50 | 51 | #============================================================================= 52 | # Set environment variables for the build. 53 | 54 | # The shell in which to execute make rules. 55 | SHELL = /bin/sh 56 | 57 | # The CMake executable. 58 | CMAKE_COMMAND = /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake 59 | 60 | # The command to remove a file. 61 | RM = /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake -E rm -f 62 | 63 | # Escaping for special characters. 64 | EQUALS = = 65 | 66 | # The top-level source directory on which CMake was run. 67 | CMAKE_SOURCE_DIR = /home/willer/RepVGG/repvgg_tensorrt_int8 68 | 69 | # The top-level build directory on which CMake was run. 70 | CMAKE_BINARY_DIR = /home/willer/RepVGG/repvgg_tensorrt_int8/build 71 | 72 | #============================================================================= 73 | # Directory level rules for the build root directory 74 | 75 | # The main recursive "all" target. 76 | all: CMakeFiles/RepVGGsEngine.dir/all 77 | 78 | .PHONY : all 79 | 80 | # The main recursive "preinstall" target. 81 | preinstall: 82 | 83 | .PHONY : preinstall 84 | 85 | # The main recursive "clean" target. 86 | clean: CMakeFiles/RepVGGsEngine.dir/clean 87 | 88 | .PHONY : clean 89 | 90 | #============================================================================= 91 | # Target rules for target CMakeFiles/RepVGGsEngine.dir 92 | 93 | # All Build rule for target. 94 | CMakeFiles/RepVGGsEngine.dir/all: 95 | $(MAKE) $(MAKESILENT) -f CMakeFiles/RepVGGsEngine.dir/build.make CMakeFiles/RepVGGsEngine.dir/depend 96 | $(MAKE) $(MAKESILENT) -f CMakeFiles/RepVGGsEngine.dir/build.make CMakeFiles/RepVGGsEngine.dir/build 97 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles --progress-num=1,2 "Built target RepVGGsEngine" 98 | .PHONY : CMakeFiles/RepVGGsEngine.dir/all 99 | 100 | # Build rule for subdir invocation for target. 101 | CMakeFiles/RepVGGsEngine.dir/rule: cmake_check_build_system 102 | $(CMAKE_COMMAND) -E cmake_progress_start /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles 2 103 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/RepVGGsEngine.dir/all 104 | $(CMAKE_COMMAND) -E cmake_progress_start /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles 0 105 | .PHONY : CMakeFiles/RepVGGsEngine.dir/rule 106 | 107 | # Convenience name for target. 108 | RepVGGsEngine: CMakeFiles/RepVGGsEngine.dir/rule 109 | 110 | .PHONY : RepVGGsEngine 111 | 112 | # clean rule for target. 113 | CMakeFiles/RepVGGsEngine.dir/clean: 114 | $(MAKE) $(MAKESILENT) -f CMakeFiles/RepVGGsEngine.dir/build.make CMakeFiles/RepVGGsEngine.dir/clean 115 | .PHONY : CMakeFiles/RepVGGsEngine.dir/clean 116 | 117 | #============================================================================= 118 | # Special targets to cleanup operation of make. 119 | 120 | # Special rule to run CMake to check the build system integrity. 121 | # No rule that depends on this can have commands that come from listfiles 122 | # because they might be regenerated. 123 | cmake_check_build_system: 124 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 125 | .PHONY : cmake_check_build_system 126 | 127 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import time 4 | import torch 5 | import torch.nn as nn 6 | import torch.nn.parallel 7 | import torch.backends.cudnn as cudnn 8 | import torch.optim 9 | import torch.utils.data 10 | import torch.utils.data.distributed 11 | import torchvision.transforms as transforms 12 | import torchvision.datasets as datasets 13 | from utils import accuracy, ProgressMeter, AverageMeter 14 | 15 | from repvgg import get_RepVGG_func_by_name 16 | 17 | parser = argparse.ArgumentParser(description='PyTorch ImageNet Test') 18 | parser.add_argument('data', metavar='DIR', help='path to dataset') 19 | parser.add_argument('mode', metavar='MODE', default='train', choices=['train', 'deploy'], help='train or deploy') 20 | parser.add_argument('weights', metavar='WEIGHTS', help='path to the weights file') 21 | parser.add_argument('-a', '--arch', metavar='ARCH', default='RepVGG-A0') 22 | parser.add_argument('-j', '--workers', default=4, type=int, metavar='N', 23 | help='number of data loading workers (default: 4)') 24 | parser.add_argument('-b', '--batch-size', default=100, type=int, 25 | metavar='N', 26 | help='mini-batch size (default: 100) for test') 27 | 28 | def test(): 29 | args = parser.parse_args() 30 | 31 | repvgg_build_func = get_RepVGG_func_by_name(args.arch) 32 | 33 | model = repvgg_build_func(deploy=args.mode=='deploy') 34 | 35 | if not torch.cuda.is_available(): 36 | print('using CPU, this will be slow') 37 | use_gpu = False 38 | else: 39 | model = model.cuda() 40 | use_gpu = True 41 | 42 | # define loss function (criterion) and optimizer 43 | criterion = nn.CrossEntropyLoss().cuda() 44 | 45 | if os.path.isfile(args.weights): 46 | print("=> loading checkpoint '{}'".format(args.weights)) 47 | checkpoint = torch.load(args.weights) 48 | if 'state_dict' in checkpoint: 49 | checkpoint = checkpoint['state_dict'] 50 | ckpt = {k.replace('module.', ''):v for k,v in checkpoint.items()} # strip the names 51 | model.load_state_dict(ckpt) 52 | else: 53 | print("=> no checkpoint found at '{}'".format(args.weights)) 54 | 55 | 56 | cudnn.benchmark = True 57 | 58 | # Data loading code 59 | valdir = os.path.join(args.data, 'val') 60 | normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], 61 | std=[0.229, 0.224, 0.225]) 62 | 63 | val_loader = torch.utils.data.DataLoader( 64 | datasets.ImageFolder(valdir, transforms.Compose([ 65 | transforms.Resize(256), 66 | transforms.CenterCrop(224), 67 | transforms.ToTensor(), 68 | normalize, 69 | ])), 70 | batch_size=args.batch_size, shuffle=False, 71 | num_workers=args.workers, pin_memory=True) 72 | 73 | validate(val_loader, model, criterion, use_gpu) 74 | 75 | 76 | def validate(val_loader, model, criterion, use_gpu): 77 | batch_time = AverageMeter('Time', ':6.3f') 78 | losses = AverageMeter('Loss', ':.4e') 79 | top1 = AverageMeter('Acc@1', ':6.2f') 80 | top5 = AverageMeter('Acc@5', ':6.2f') 81 | progress = ProgressMeter( 82 | len(val_loader), 83 | [batch_time, losses, top1, top5], 84 | prefix='Test: ') 85 | 86 | # switch to evaluate mode 87 | model.eval() 88 | 89 | with torch.no_grad(): 90 | end = time.time() 91 | for i, (images, target) in enumerate(val_loader): 92 | if use_gpu: 93 | images = images.cuda(non_blocking=True) 94 | target = target.cuda(non_blocking=True) 95 | 96 | # compute output 97 | output = model(images) 98 | loss = criterion(output, target) 99 | 100 | # measure accuracy and record loss 101 | acc1, acc5 = accuracy(output, target, topk=(1, 2)) 102 | losses.update(loss.item(), images.size(0)) 103 | top1.update(acc1[0], images.size(0)) 104 | top5.update(acc5[0], images.size(0)) 105 | 106 | # measure elapsed time 107 | batch_time.update(time.time() - end) 108 | end = time.time() 109 | 110 | if i % 10 == 0: 111 | progress.display(i) 112 | 113 | print(' * Acc@1 {top1.avg:.3f} Acc@5 {top5.avg:.3f}' 114 | .format(top1=top1, top5=top5)) 115 | 116 | return top1.avg 117 | 118 | 119 | 120 | 121 | if __name__ == '__main__': 122 | test() 123 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/include/my_common.h: -------------------------------------------------------------------------------- 1 | #ifndef _MY_COMMON_H_ 2 | #define _MY_COMMON_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | #include 10 | 11 | typedef signed char my_s8; 12 | typedef unsigned char my_u8; 13 | typedef signed short my_s16; 14 | typedef unsigned short my_u16; 15 | typedef signed int my_s32; 16 | typedef unsigned int my_u32; 17 | typedef signed char MY_BOOL; 18 | 19 | #define TRUE 1 20 | #define FALSE 0 21 | 22 | //#define DEBUG_ON 23 | 24 | #ifdef DEBUG_ON 25 | #define MY_DEBUG(...) \ 26 | do \ 27 | { \ 28 | fprintf(stdout, "[DEBUG] %s %s (Line %d) : ", __FILE__, __FUNCTION__, __LINE__); \ 29 | fprintf(stdout, __VA_ARGS__); \ 30 | } while (0) 31 | #else 32 | #define MY_DEBUG(...) 33 | #endif 34 | 35 | #define MY_ERROR(...) \ 36 | do \ 37 | { \ 38 | fprintf(stderr, "[ERROR] %s %s (Line %d) : ", __FILE__, __FUNCTION__, __LINE__); \ 39 | fprintf(stderr, __VA_ARGS__); \ 40 | } while (0) 41 | 42 | #define MY_CHECK_NULL(a, errcode) \ 43 | do \ 44 | { \ 45 | if (NULL == (a)) \ 46 | { \ 47 | MY_ERROR("NULL DATA \n"); \ 48 | return errcode; \ 49 | } \ 50 | } while (0) 51 | 52 | typedef enum 53 | { 54 | MY_SUCCESS = 0, //成功 55 | MY_FAILED, //失败 56 | MY_PARAM_NULL, //参数为空 57 | MY_PARAM_SET_ERROR, 58 | MY_FILE_NOT_EXIST, //文件不存在 59 | MY_MEMORY_MALLOC_FAILED, //内存分配失败 60 | MY_MODEL_LOAD_FAILED, //模型加载失败 61 | MY_TENSOR_ALLOC_FAILED, //tensor内存分配失败 62 | } result_t; 63 | 64 | typedef enum { 65 | CPU_MEM_ALLOC = 0, //Tensor在cpu上 66 | CPU_MEM_NO_ALLOC, //上层cpu的数据不会释放,由调用函数保证 67 | GPU_MEM_ALLOC, //内部在gpu上分配显存 68 | GPU_MEM_NO_ALLOC //由上层分配显存, 69 | } tensor_memory_type_t; 70 | 71 | typedef struct 72 | { 73 | char visibleCard[32]; //设置哪些GPU卡是可见的 74 | int gpu_id; //虚拟的gpu id 75 | char model_path[256]; //模型的路径名 76 | MY_BOOL bIsCipher; //模型文件是否加密 77 | int encStartPoint; 78 | int encLength; 79 | int maxBatchSize; 80 | bool bInt8; 81 | bool bInt16; 82 | } model_params_t; 83 | 84 | typedef struct 85 | { 86 | void *model_handle; //模型句柄 87 | } model_handle_t; 88 | 89 | typedef enum 90 | { 91 | DT_INVALID = 0, 92 | DT_FLOAT = 1, 93 | DT_DOUBLE = 2, 94 | DT_INT32 = 3, 95 | DT_UINT8 = 4, 96 | DT_INT16 = 5, 97 | DT_INT8 = 6, 98 | DT_STRING = 7, 99 | DT_INT64 = 9, 100 | DT_BOOL = 10, 101 | } tensor_types_t; 102 | 103 | //Tensor参数的数据结构 104 | typedef struct 105 | { 106 | tensor_types_t type; //Tensor的类型 107 | char aTensorName[256]; //Tensor的名字 108 | int nDims; //Tensor的rank 109 | int pShape[8]; //shape 110 | int nElementSize; //多少个元素 111 | int nLength; //多少个字节长度 112 | 113 | tensor_memory_type_t tensorMemoryType; 114 | bool bIsOutput; 115 | } tensor_params_t; 116 | 117 | //定义Tensor的数据结构 118 | typedef struct 119 | { 120 | tensor_params_t *pTensorInfo; 121 | void *pValue; 122 | } tensor_t; 123 | 124 | typedef struct 125 | { 126 | int nArraySize; 127 | tensor_params_t *pTensorParamArray; 128 | char pcSignatureDef[256]; //函数签名 129 | } tensor_params_array_t; 130 | 131 | typedef struct 132 | { 133 | int nArraySize; 134 | tensor_t *pTensorArray; 135 | char pcSignatureDef[256]; //函数签名 136 | } tensor_array_t; 137 | 138 | #ifdef __cplusplus 139 | } 140 | #endif 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/usr/bin/c++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "7.5.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "Linux") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_CXX_SIMULATE_VERSION "") 19 | 20 | 21 | 22 | set(CMAKE_AR "/usr/bin/ar") 23 | set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-7") 24 | set(CMAKE_RANLIB "/usr/bin/ranlib") 25 | set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-7") 26 | set(CMAKE_LINKER "/usr/bin/ld") 27 | set(CMAKE_MT "") 28 | set(CMAKE_COMPILER_IS_GNUCXX 1) 29 | set(CMAKE_CXX_COMPILER_LOADED 1) 30 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 31 | set(CMAKE_CXX_ABI_COMPILED TRUE) 32 | set(CMAKE_COMPILER_IS_MINGW ) 33 | set(CMAKE_COMPILER_IS_CYGWIN ) 34 | if(CMAKE_COMPILER_IS_CYGWIN) 35 | set(CYGWIN 1) 36 | set(UNIX 1) 37 | endif() 38 | 39 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 40 | 41 | if(CMAKE_COMPILER_IS_MINGW) 42 | set(MINGW 1) 43 | endif() 44 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 46 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 47 | 48 | foreach (lang C OBJC OBJCXX) 49 | if (CMAKE_${lang}_COMPILER_ID_RUN) 50 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 51 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 52 | endforeach() 53 | endif() 54 | endforeach() 55 | 56 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 57 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 58 | 59 | # Save compiler ABI information. 60 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 61 | set(CMAKE_CXX_COMPILER_ABI "ELF") 62 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 63 | 64 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 65 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 66 | endif() 67 | 68 | if(CMAKE_CXX_COMPILER_ABI) 69 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 70 | endif() 71 | 72 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 73 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 74 | endif() 75 | 76 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 77 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 78 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 79 | endif() 80 | 81 | 82 | 83 | 84 | 85 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include") 86 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") 87 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/opt/intel/openvino_2020.4.287/data_processing/dl_streamer/lib;/opt/intel/openvino_2020.4.287/data_processing/gstreamer/lib;/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 88 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 89 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Disable VCS-based implicit rules. 16 | % : %,v 17 | 18 | 19 | # Disable VCS-based implicit rules. 20 | % : RCS/% 21 | 22 | 23 | # Disable VCS-based implicit rules. 24 | % : RCS/%,v 25 | 26 | 27 | # Disable VCS-based implicit rules. 28 | % : SCCS/s.% 29 | 30 | 31 | # Disable VCS-based implicit rules. 32 | % : s.% 33 | 34 | 35 | .SUFFIXES: .hpux_make_needs_suffix_list 36 | 37 | 38 | # Command-line flag to silence nested $(MAKE). 39 | $(VERBOSE)MAKESILENT = -s 40 | 41 | # Suppress display of executed commands. 42 | $(VERBOSE).SILENT: 43 | 44 | 45 | # A target that is always out of date. 46 | cmake_force: 47 | 48 | .PHONY : cmake_force 49 | 50 | #============================================================================= 51 | # Set environment variables for the build. 52 | 53 | # The shell in which to execute make rules. 54 | SHELL = /bin/sh 55 | 56 | # The CMake executable. 57 | CMAKE_COMMAND = /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake 58 | 59 | # The command to remove a file. 60 | RM = /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake -E rm -f 61 | 62 | # Escaping for special characters. 63 | EQUALS = = 64 | 65 | # The top-level source directory on which CMake was run. 66 | CMAKE_SOURCE_DIR = /home/willer/RepVGG/repvgg_tensorrt_int8 67 | 68 | # The top-level build directory on which CMake was run. 69 | CMAKE_BINARY_DIR = /home/willer/RepVGG/repvgg_tensorrt_int8/build 70 | 71 | # Include any dependencies generated for this target. 72 | include CMakeFiles/RepVGGsEngine.dir/depend.make 73 | 74 | # Include the progress variables for this target. 75 | include CMakeFiles/RepVGGsEngine.dir/progress.make 76 | 77 | # Include the compile flags for this target's objects. 78 | include CMakeFiles/RepVGGsEngine.dir/flags.make 79 | 80 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: CMakeFiles/RepVGGsEngine.dir/flags.make 81 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: ../repvgg_infer.cc 82 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o" 83 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o -c /home/willer/RepVGG/repvgg_tensorrt_int8/repvgg_infer.cc 84 | 85 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.i: cmake_force 86 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.i" 87 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/willer/RepVGG/repvgg_tensorrt_int8/repvgg_infer.cc > CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.i 88 | 89 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.s: cmake_force 90 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.s" 91 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/willer/RepVGG/repvgg_tensorrt_int8/repvgg_infer.cc -o CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.s 92 | 93 | # Object files for target RepVGGsEngine 94 | RepVGGsEngine_OBJECTS = \ 95 | "CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o" 96 | 97 | # External object files for target RepVGGsEngine 98 | RepVGGsEngine_EXTERNAL_OBJECTS = 99 | 100 | RepVGGsEngine: CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o 101 | RepVGGsEngine: CMakeFiles/RepVGGsEngine.dir/build.make 102 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_dnn.so.4.4.0 103 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_gapi.so.4.4.0 104 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_highgui.so.4.4.0 105 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_ml.so.4.4.0 106 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_objdetect.so.4.4.0 107 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_photo.so.4.4.0 108 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_stitching.so.4.4.0 109 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_video.so.4.4.0 110 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_videoio.so.4.4.0 111 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_imgcodecs.so.4.4.0 112 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_calib3d.so.4.4.0 113 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_features2d.so.4.4.0 114 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_imgproc.so.4.4.0 115 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_flann.so.4.4.0 116 | RepVGGsEngine: /opt/intel/openvino_2020.4.287/opencv/lib/libopencv_core.so.4.4.0 117 | RepVGGsEngine: CMakeFiles/RepVGGsEngine.dir/link.txt 118 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable RepVGGsEngine" 119 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/RepVGGsEngine.dir/link.txt --verbose=$(VERBOSE) 120 | 121 | # Rule to build all files generated by this target. 122 | CMakeFiles/RepVGGsEngine.dir/build: RepVGGsEngine 123 | 124 | .PHONY : CMakeFiles/RepVGGsEngine.dir/build 125 | 126 | CMakeFiles/RepVGGsEngine.dir/clean: 127 | $(CMAKE_COMMAND) -P CMakeFiles/RepVGGsEngine.dir/cmake_clean.cmake 128 | .PHONY : CMakeFiles/RepVGGsEngine.dir/clean 129 | 130 | CMakeFiles/RepVGGsEngine.dir/depend: 131 | cd /home/willer/RepVGG/repvgg_tensorrt_int8/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/willer/RepVGG/repvgg_tensorrt_int8 /home/willer/RepVGG/repvgg_tensorrt_int8 /home/willer/RepVGG/repvgg_tensorrt_int8/build /home/willer/RepVGG/repvgg_tensorrt_int8/build /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/DependInfo.cmake --color=$(COLOR) 132 | .PHONY : CMakeFiles/RepVGGsEngine.dir/depend 133 | 134 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Disable VCS-based implicit rules. 21 | % : %,v 22 | 23 | 24 | # Disable VCS-based implicit rules. 25 | % : RCS/% 26 | 27 | 28 | # Disable VCS-based implicit rules. 29 | % : RCS/%,v 30 | 31 | 32 | # Disable VCS-based implicit rules. 33 | % : SCCS/s.% 34 | 35 | 36 | # Disable VCS-based implicit rules. 37 | % : s.% 38 | 39 | 40 | .SUFFIXES: .hpux_make_needs_suffix_list 41 | 42 | 43 | # Command-line flag to silence nested $(MAKE). 44 | $(VERBOSE)MAKESILENT = -s 45 | 46 | # Suppress display of executed commands. 47 | $(VERBOSE).SILENT: 48 | 49 | 50 | # A target that is always out of date. 51 | cmake_force: 52 | 53 | .PHONY : cmake_force 54 | 55 | #============================================================================= 56 | # Set environment variables for the build. 57 | 58 | # The shell in which to execute make rules. 59 | SHELL = /bin/sh 60 | 61 | # The CMake executable. 62 | CMAKE_COMMAND = /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake 63 | 64 | # The command to remove a file. 65 | RM = /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake -E rm -f 66 | 67 | # Escaping for special characters. 68 | EQUALS = = 69 | 70 | # The top-level source directory on which CMake was run. 71 | CMAKE_SOURCE_DIR = /home/willer/RepVGG/repvgg_tensorrt_int8 72 | 73 | # The top-level build directory on which CMake was run. 74 | CMAKE_BINARY_DIR = /home/willer/RepVGG/repvgg_tensorrt_int8/build 75 | 76 | #============================================================================= 77 | # Targets provided globally by CMake. 78 | 79 | # Special rule for the target rebuild_cache 80 | rebuild_cache: 81 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 82 | /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 83 | .PHONY : rebuild_cache 84 | 85 | # Special rule for the target rebuild_cache 86 | rebuild_cache/fast: rebuild_cache 87 | 88 | .PHONY : rebuild_cache/fast 89 | 90 | # Special rule for the target edit_cache 91 | edit_cache: 92 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." 93 | /home/willer/clion-2020.3/bin/cmake/linux/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 94 | .PHONY : edit_cache 95 | 96 | # Special rule for the target edit_cache 97 | edit_cache/fast: edit_cache 98 | 99 | .PHONY : edit_cache/fast 100 | 101 | # The main all target 102 | all: cmake_check_build_system 103 | $(CMAKE_COMMAND) -E cmake_progress_start /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles/progress.marks 104 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all 105 | $(CMAKE_COMMAND) -E cmake_progress_start /home/willer/RepVGG/repvgg_tensorrt_int8/build/CMakeFiles 0 106 | .PHONY : all 107 | 108 | # The main clean target 109 | clean: 110 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean 111 | .PHONY : clean 112 | 113 | # The main clean target 114 | clean/fast: clean 115 | 116 | .PHONY : clean/fast 117 | 118 | # Prepare targets for installation. 119 | preinstall: all 120 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall 121 | .PHONY : preinstall 122 | 123 | # Prepare targets for installation. 124 | preinstall/fast: 125 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall 126 | .PHONY : preinstall/fast 127 | 128 | # clear depends 129 | depend: 130 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 131 | .PHONY : depend 132 | 133 | #============================================================================= 134 | # Target rules for targets named RepVGGsEngine 135 | 136 | # Build rule for target. 137 | RepVGGsEngine: cmake_check_build_system 138 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 RepVGGsEngine 139 | .PHONY : RepVGGsEngine 140 | 141 | # fast build rule for target. 142 | RepVGGsEngine/fast: 143 | $(MAKE) $(MAKESILENT) -f CMakeFiles/RepVGGsEngine.dir/build.make CMakeFiles/RepVGGsEngine.dir/build 144 | .PHONY : RepVGGsEngine/fast 145 | 146 | repvgg_infer.o: repvgg_infer.cc.o 147 | 148 | .PHONY : repvgg_infer.o 149 | 150 | # target to build an object file 151 | repvgg_infer.cc.o: 152 | $(MAKE) $(MAKESILENT) -f CMakeFiles/RepVGGsEngine.dir/build.make CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o 153 | .PHONY : repvgg_infer.cc.o 154 | 155 | repvgg_infer.i: repvgg_infer.cc.i 156 | 157 | .PHONY : repvgg_infer.i 158 | 159 | # target to preprocess a source file 160 | repvgg_infer.cc.i: 161 | $(MAKE) $(MAKESILENT) -f CMakeFiles/RepVGGsEngine.dir/build.make CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.i 162 | .PHONY : repvgg_infer.cc.i 163 | 164 | repvgg_infer.s: repvgg_infer.cc.s 165 | 166 | .PHONY : repvgg_infer.s 167 | 168 | # target to generate assembly for a file 169 | repvgg_infer.cc.s: 170 | $(MAKE) $(MAKESILENT) -f CMakeFiles/RepVGGsEngine.dir/build.make CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.s 171 | .PHONY : repvgg_infer.cc.s 172 | 173 | # Help Target 174 | help: 175 | @echo "The following are some of the valid targets for this Makefile:" 176 | @echo "... all (the default if no target is provided)" 177 | @echo "... clean" 178 | @echo "... depend" 179 | @echo "... edit_cache" 180 | @echo "... rebuild_cache" 181 | @echo "... RepVGGsEngine" 182 | @echo "... repvgg_infer.o" 183 | @echo "... repvgg_infer.i" 184 | @echo "... repvgg_infer.s" 185 | .PHONY : help 186 | 187 | 188 | 189 | #============================================================================= 190 | # Special targets to cleanup operation of make. 191 | 192 | # Special rule to run CMake to check the build system integrity. 193 | # No rule that depends on this can have commands that come from listfiles 194 | # because they might be regenerated. 195 | cmake_check_build_system: 196 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 197 | .PHONY : cmake_check_build_system 198 | 199 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/repvgg_infer.cc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "my_interface.h" 8 | #include 9 | #include 10 | #include 11 | 12 | #define INPUT_W 224 13 | #define INPUT_H 224 14 | #define NUM_CLASS 2 15 | char* output_name = "100"; 16 | char* trt_model_path = "../models/RepVGG-A0_int8.trt"; 17 | std::string test_img = "../test_imgs/dog.33.jpg"; 18 | std::vector img_mean = {0.485, 0.456, 0.406}; 19 | std::vector img_std = { 0.229, 0.224, 0.225 }; 20 | 21 | using namespace cv; 22 | using namespace std; 23 | 24 | void cudaResize(cv::Mat &image, cv::Mat &rsz_img) 25 | { 26 | int outsize = rsz_img.cols * rsz_img.rows * sizeof(uchar3); 27 | 28 | int inwidth = image.cols; 29 | int inheight = image.rows; 30 | int memSize = inwidth * inheight * sizeof(uchar3); 31 | 32 | NppiSize srcsize = {inwidth, inheight}; 33 | NppiRect srcroi = {0, 0, inwidth, inheight}; 34 | NppiSize dstsize = {rsz_img.cols, rsz_img.rows}; 35 | NppiRect dstroi = {0, 0, rsz_img.cols, rsz_img.rows}; 36 | 37 | uchar3* d_src = NULL; 38 | uchar3* d_dst = NULL; 39 | cudaMalloc((void**)&d_src, memSize); 40 | cudaMalloc((void**)&d_dst, outsize); 41 | cudaMemcpy(d_src, image.data, memSize, cudaMemcpyHostToDevice); 42 | 43 | // nvidia npp 图像处理 44 | nppiResize_8u_C3R( (Npp8u*)d_src, inwidth * 3, srcsize, srcroi, 45 | (Npp8u*)d_dst, rsz_img.cols * 3, dstsize, dstroi, 46 | NPPI_INTER_LINEAR ); 47 | 48 | 49 | cudaMemcpy(rsz_img.data, d_dst, outsize, cudaMemcpyDeviceToHost); 50 | 51 | cudaFree(d_src); 52 | cudaFree(d_dst); 53 | } 54 | 55 | std::vector prepareImage(cv::Mat &src_img) { 56 | std::vector result(INPUT_W * INPUT_H * 3); 57 | float *data = result.data(); 58 | float ratio = float(INPUT_W) / float(src_img.cols) < float(INPUT_H) / float(src_img.rows) ? float(INPUT_W) / float(src_img.cols) : float(INPUT_H) / float(src_img.rows); 59 | cv::Mat flt_img = cv::Mat::zeros(cv::Size(INPUT_W, INPUT_H), CV_8UC3); 60 | cv::Mat rsz_img = cv::Mat::zeros(cv::Size(src_img.cols*ratio, src_img.rows*ratio), CV_8UC3); 61 | cudaResize(src_img, rsz_img); 62 | rsz_img.copyTo(flt_img(cv::Rect(0, 0, rsz_img.cols, rsz_img.rows))); 63 | flt_img.convertTo(flt_img, CV_32FC3); 64 | 65 | int channelLength = INPUT_W * INPUT_H; 66 | std::vector split_img = { 67 | cv::Mat(INPUT_W, INPUT_H, CV_32FC1, data + channelLength * 2), 68 | cv::Mat(INPUT_W, INPUT_H, CV_32FC1, data + channelLength), 69 | cv::Mat(INPUT_W, INPUT_H, CV_32FC1, data) 70 | }; 71 | 72 | 73 | auto pr_start = std::chrono::high_resolution_clock::now(); 74 | cv::split(flt_img, split_img); 75 | for (int i = 0; i < 3; i++) { 76 | split_img[i] = (split_img[i]/255 - img_mean[i]) / img_std[i]; 77 | } 78 | auto pr_end = std::chrono::high_resolution_clock::now(); 79 | 80 | auto po_ms = std::chrono::duration(pr_end - pr_start).count(); 81 | std::cout << "********** " << po_ms << " ms." << "********** " << std::endl; 82 | return result; 83 | } 84 | 85 | 86 | int main(int argc, const char *argv[]) { 87 | float total = 0, ms, pr_ms, po_ms; 88 | int test_echo = 20; 89 | 90 | // 创建输入输出tensor结构体 91 | tensor_params_array_t in_tensor_params_ar = {0}; 92 | tensor_params_array_t out_tensor_params_ar = {0}; 93 | tensor_array_t *input_tensor_array = NULL; 94 | tensor_array_t *ouput_tensor_array = NULL; 95 | 96 | /****************** */ 97 | // 定义输入tensor 98 | in_tensor_params_ar.nArraySize = 1; 99 | in_tensor_params_ar.pTensorParamArray = (tensor_params_t *) malloc( 100 | in_tensor_params_ar.nArraySize * sizeof(tensor_params_t)); 101 | memset(in_tensor_params_ar.pTensorParamArray, 0, in_tensor_params_ar.nArraySize * sizeof(tensor_params_t)); 102 | 103 | tensor_params_t *cur_in_tensor_params = in_tensor_params_ar.pTensorParamArray; 104 | 105 | // 第一个输入tensor 106 | cur_in_tensor_params[0].nDims = 4; 107 | cur_in_tensor_params[0].type = DT_FLOAT; 108 | cur_in_tensor_params[0].pShape[0] = 1; //batch size can't set to -1 109 | cur_in_tensor_params[0].pShape[1] = 3; 110 | cur_in_tensor_params[0].pShape[2] = INPUT_H; 111 | cur_in_tensor_params[0].pShape[3] = INPUT_W; 112 | strcpy(cur_in_tensor_params[0].aTensorName, "input.1"); 113 | cur_in_tensor_params[0].tensorMemoryType = CPU_MEM_ALLOC; 114 | 115 | /*************** */ 116 | // 定义输出tensor 117 | out_tensor_params_ar.nArraySize = 1; 118 | out_tensor_params_ar.pTensorParamArray = (tensor_params_t *) malloc( 119 | out_tensor_params_ar.nArraySize * sizeof(tensor_params_t)); 120 | memset(out_tensor_params_ar.pTensorParamArray, 0, out_tensor_params_ar.nArraySize * sizeof(tensor_params_t)); 121 | 122 | tensor_params_t *cur_out_tensor_params = out_tensor_params_ar.pTensorParamArray; 123 | 124 | cur_out_tensor_params[0].nDims = 2; 125 | cur_out_tensor_params[0].type = DT_FLOAT; 126 | cur_out_tensor_params[0].pShape[0] = 1; 127 | cur_out_tensor_params[0].pShape[1] = NUM_CLASS; 128 | cur_out_tensor_params[0].tensorMemoryType = CPU_MEM_ALLOC; 129 | strcpy(cur_out_tensor_params[0].aTensorName, output_name); 130 | 131 | // 初始化输入输出结构体,分配内存 132 | if (my_init_tensors(&in_tensor_params_ar, &out_tensor_params_ar, 133 | &input_tensor_array, &ouput_tensor_array) != MY_SUCCESS) { 134 | printf("Open Internal memory error!\n"); 135 | } 136 | 137 | //===================obtain Handle========================================= 138 | model_params_t tModelParam = {0}; //model input parameter 139 | model_handle_t tModelHandle = {0}; 140 | 141 | strcpy(tModelParam.visibleCard, "0"); 142 | tModelParam.gpu_id = 0; //GPU 0 143 | tModelParam.bIsCipher = FALSE; 144 | tModelParam.maxBatchSize = 1; 145 | 146 | strcpy(tModelParam.model_path, trt_model_path); 147 | 148 | //call API open model 149 | if (my_load_model(&tModelParam, 150 | input_tensor_array, 151 | ouput_tensor_array, 152 | &tModelHandle) != MY_SUCCESS) { 153 | printf("Open model error!\n"); 154 | } 155 | std::cout << "Load model sucess\n"; 156 | 157 | 158 | string file_name = test_img; 159 | tensor_t *cur_input_tensor_image = &(input_tensor_array->pTensorArray[0]); 160 | 161 | cv::Mat cImage; 162 | cImage = cv::imread(file_name); 163 | std::cout << "Read img finished!\n"; 164 | cv::Mat showImage = cImage.clone(); 165 | 166 | 167 | auto pr_start = std::chrono::high_resolution_clock::now(); 168 | vector pr_img = prepareImage(cImage); 169 | auto pr_end = std::chrono::high_resolution_clock::now(); 170 | pr_ms = std::chrono::duration(pr_end - pr_start).count(); 171 | 172 | memcpy((float *) (cur_input_tensor_image->pValue), 173 | pr_img.data(), 3 * INPUT_H * INPUT_W * sizeof(float)); 174 | 175 | 176 | printf("----->memcpy data is success......\n"); 177 | for (int j = 0; j < test_echo; ++j) { 178 | auto t_start = std::chrono::high_resolution_clock::now(); 179 | 180 | my_inference_tensors(&tModelHandle); 181 | 182 | auto t_end = std::chrono::high_resolution_clock::now(); 183 | ms = std::chrono::duration(t_end - t_start).count(); 184 | total += ms; 185 | std::cout << "[ " << j << " ] " << ms << " ms." << std::endl; 186 | } 187 | 188 | total /= test_echo; 189 | std::cout << "Average over " << test_echo << " runs is " << total << " ms." << std::endl; 190 | 191 | tensor_t *cur_output_tensor = &(ouput_tensor_array->pTensorArray[0]); 192 | float * output = static_cast(cur_output_tensor->pValue); 193 | 194 | int outSize = cur_output_tensor->pTensorInfo->nElementSize; 195 | //std::cout << "outSize:" << outSize << std::endl; 196 | 197 | int index = 0; 198 | float max = output[0]; 199 | for (int i = 0; i < outSize; i++) { 200 | if (max < output[i]) { 201 | max = output[i]; 202 | index = i; 203 | } 204 | } 205 | 206 | std::cout << "prob: " << index << std::endl; 207 | //std::cout << "prob:" << output[0] << " " << output[1] << std::endl; 208 | 209 | my_deinit_tensors(input_tensor_array, ouput_tensor_array); 210 | 211 | my_release_model(&tModelHandle); 212 | 213 | 214 | 215 | std::cout << "complete!!!" << std::endl; 216 | 217 | return 0; 218 | } 219 | -------------------------------------------------------------------------------- /repvgg.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | import numpy as np 3 | import torch 4 | 5 | def conv_bn(in_channels, out_channels, kernel_size, stride, padding, groups=1): 6 | result = nn.Sequential() 7 | result.add_module('conv', nn.Conv2d(in_channels=in_channels, out_channels=out_channels, 8 | kernel_size=kernel_size, stride=stride, padding=padding, groups=groups, bias=False)) 9 | result.add_module('bn', nn.BatchNorm2d(num_features=out_channels)) 10 | return result 11 | 12 | class RepVGGBlock(nn.Module): 13 | 14 | def __init__(self, in_channels, out_channels, kernel_size, 15 | stride=1, padding=0, dilation=1, groups=1, padding_mode='zeros', deploy=False): 16 | super(RepVGGBlock, self).__init__() 17 | self.deploy = deploy 18 | self.groups = groups 19 | self.in_channels = in_channels 20 | 21 | assert kernel_size == 3 22 | assert padding == 1 23 | 24 | padding_11 = padding - kernel_size // 2 25 | 26 | self.nonlinearity = nn.ReLU() 27 | 28 | if deploy: 29 | self.rbr_reparam = nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=kernel_size, stride=stride, 30 | padding=padding, dilation=dilation, groups=groups, bias=True, padding_mode=padding_mode) 31 | 32 | else: 33 | self.rbr_identity = nn.BatchNorm2d(num_features=in_channels) if out_channels == in_channels and stride == 1 else None 34 | self.rbr_dense = conv_bn(in_channels=in_channels, out_channels=out_channels, kernel_size=kernel_size, stride=stride, padding=padding, groups=groups) 35 | self.rbr_1x1 = conv_bn(in_channels=in_channels, out_channels=out_channels, kernel_size=1, stride=stride, padding=padding_11, groups=groups) 36 | print('RepVGG Block, identity = ', self.rbr_identity) 37 | 38 | 39 | def forward(self, inputs): 40 | if hasattr(self, 'rbr_reparam'): 41 | return self.nonlinearity(self.rbr_reparam(inputs)) 42 | 43 | if self.rbr_identity is None: 44 | id_out = 0 45 | else: 46 | id_out = self.rbr_identity(inputs) 47 | 48 | return self.nonlinearity(self.rbr_dense(inputs) + self.rbr_1x1(inputs) + id_out) 49 | 50 | 51 | 52 | # This func derives the equivalent kernel and bias in a DIFFERENTIABLE way. 53 | # You can get the equivalent kernel and bias at any time and do whatever you want, 54 | # for example, apply some penalties or constraints during training, just like you do to the other models. 55 | # May be useful for quantization or pruning. 56 | def get_equivalent_kernel_bias(self): 57 | kernel3x3, bias3x3 = self._fuse_bn_tensor(self.rbr_dense) 58 | kernel1x1, bias1x1 = self._fuse_bn_tensor(self.rbr_1x1) 59 | kernelid, biasid = self._fuse_bn_tensor(self.rbr_identity) 60 | return kernel3x3 + self._pad_1x1_to_3x3_tensor(kernel1x1) + kernelid, bias3x3 + bias1x1 + biasid 61 | 62 | def _pad_1x1_to_3x3_tensor(self, kernel1x1): 63 | if kernel1x1 is None: 64 | return 0 65 | else: 66 | return torch.nn.functional.pad(kernel1x1, [1,1,1,1]) 67 | 68 | def _fuse_bn_tensor(self, branch): 69 | if branch is None: 70 | return 0, 0 71 | if isinstance(branch, nn.Sequential): 72 | kernel = branch.conv.weight 73 | running_mean = branch.bn.running_mean 74 | running_var = branch.bn.running_var 75 | gamma = branch.bn.weight 76 | beta = branch.bn.bias 77 | eps = branch.bn.eps 78 | else: 79 | assert isinstance(branch, nn.BatchNorm2d) 80 | if not hasattr(self, 'id_tensor'): 81 | input_dim = self.in_channels // self.groups 82 | kernel_value = np.zeros((self.in_channels, input_dim, 3, 3), dtype=np.float32) 83 | for i in range(self.in_channels): 84 | kernel_value[i, i % input_dim, 1, 1] = 1 85 | self.id_tensor = torch.from_numpy(kernel_value).to(branch.weight.device) 86 | kernel = self.id_tensor 87 | running_mean = branch.running_mean 88 | running_var = branch.running_var 89 | gamma = branch.weight 90 | beta = branch.bias 91 | eps = branch.eps 92 | std = (running_var + eps).sqrt() 93 | t = (gamma / std).reshape(-1, 1, 1, 1) 94 | return kernel * t, beta - running_mean * gamma / std 95 | 96 | def repvgg_convert(self): 97 | kernel, bias = self.get_equivalent_kernel_bias() 98 | return kernel.detach().cpu().numpy(), bias.detach().cpu().numpy(), 99 | 100 | 101 | 102 | class RepVGG(nn.Module): 103 | 104 | def __init__(self, num_blocks, num_classes=1000, width_multiplier=None, override_groups_map=None, deploy=False): 105 | super(RepVGG, self).__init__() 106 | 107 | assert len(width_multiplier) == 4 108 | 109 | self.deploy = deploy 110 | self.override_groups_map = override_groups_map or dict() 111 | 112 | assert 0 not in self.override_groups_map 113 | 114 | self.in_planes = min(64, int(64 * width_multiplier[0])) 115 | 116 | self.stage0 = RepVGGBlock(in_channels=3, out_channels=self.in_planes, kernel_size=3, stride=2, padding=1, deploy=self.deploy) 117 | self.cur_layer_idx = 1 118 | self.stage1 = self._make_stage(int(64 * width_multiplier[0]), num_blocks[0], stride=2) 119 | self.stage2 = self._make_stage(int(128 * width_multiplier[1]), num_blocks[1], stride=2) 120 | self.stage3 = self._make_stage(int(256 * width_multiplier[2]), num_blocks[2], stride=2) 121 | self.stage4 = self._make_stage(int(512 * width_multiplier[3]), num_blocks[3], stride=2) 122 | self.gap = nn.AdaptiveAvgPool2d(output_size=1) 123 | self.linear = nn.Linear(int(512 * width_multiplier[3]), num_classes) 124 | 125 | 126 | def _make_stage(self, planes, num_blocks, stride): 127 | strides = [stride] + [1]*(num_blocks-1) 128 | blocks = [] 129 | for stride in strides: 130 | cur_groups = self.override_groups_map.get(self.cur_layer_idx, 1) 131 | blocks.append(RepVGGBlock(in_channels=self.in_planes, out_channels=planes, kernel_size=3, 132 | stride=stride, padding=1, groups=cur_groups, deploy=self.deploy)) 133 | self.in_planes = planes 134 | self.cur_layer_idx += 1 135 | return nn.Sequential(*blocks) 136 | 137 | def forward(self, x): 138 | out = self.stage0(x) 139 | out = self.stage1(out) 140 | out = self.stage2(out) 141 | out = self.stage3(out) 142 | out = self.stage4(out) 143 | out = self.gap(out) 144 | out = out.view(out.size(0), -1) 145 | out = self.linear(out) 146 | return out 147 | 148 | 149 | optional_groupwise_layers = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26] 150 | g2_map = {l: 2 for l in optional_groupwise_layers} 151 | g4_map = {l: 4 for l in optional_groupwise_layers} 152 | 153 | def create_RepVGG_A0(deploy=False): 154 | return RepVGG(num_blocks=[2, 4, 14, 1], num_classes=2, 155 | width_multiplier=[0.75, 0.75, 0.75, 2.5], override_groups_map=None, deploy=deploy) 156 | 157 | def create_RepVGG_A1(deploy=False): 158 | return RepVGG(num_blocks=[2, 4, 14, 1], num_classes=1000, 159 | width_multiplier=[1, 1, 1, 2.5], override_groups_map=None, deploy=deploy) 160 | 161 | def create_RepVGG_A2(deploy=False): 162 | return RepVGG(num_blocks=[2, 4, 14, 1], num_classes=1000, 163 | width_multiplier=[1.5, 1.5, 1.5, 2.75], override_groups_map=None, deploy=deploy) 164 | 165 | def create_RepVGG_B0(deploy=False): 166 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 167 | width_multiplier=[1, 1, 1, 2.5], override_groups_map=None, deploy=deploy) 168 | 169 | def create_RepVGG_B1(deploy=False): 170 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 171 | width_multiplier=[2, 2, 2, 4], override_groups_map=None, deploy=deploy) 172 | 173 | def create_RepVGG_B1g2(deploy=False): 174 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 175 | width_multiplier=[2, 2, 2, 4], override_groups_map=g2_map, deploy=deploy) 176 | 177 | def create_RepVGG_B1g4(deploy=False): 178 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 179 | width_multiplier=[2, 2, 2, 4], override_groups_map=g4_map, deploy=deploy) 180 | 181 | 182 | def create_RepVGG_B2(deploy=False): 183 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 184 | width_multiplier=[2.5, 2.5, 2.5, 5], override_groups_map=None, deploy=deploy) 185 | 186 | def create_RepVGG_B2g2(deploy=False): 187 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 188 | width_multiplier=[2.5, 2.5, 2.5, 5], override_groups_map=g2_map, deploy=deploy) 189 | 190 | def create_RepVGG_B2g4(deploy=False): 191 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 192 | width_multiplier=[2.5, 2.5, 2.5, 5], override_groups_map=g4_map, deploy=deploy) 193 | 194 | 195 | def create_RepVGG_B3(deploy=False): 196 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 197 | width_multiplier=[3, 3, 3, 5], override_groups_map=None, deploy=deploy) 198 | 199 | def create_RepVGG_B3g2(deploy=False): 200 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 201 | width_multiplier=[3, 3, 3, 5], override_groups_map=g2_map, deploy=deploy) 202 | 203 | def create_RepVGG_B3g4(deploy=False): 204 | return RepVGG(num_blocks=[4, 6, 16, 1], num_classes=1000, 205 | width_multiplier=[3, 3, 3, 5], override_groups_map=g4_map, deploy=deploy) 206 | 207 | 208 | func_dict = { 209 | 'RepVGG-A0': create_RepVGG_A0, 210 | 'RepVGG-A1': create_RepVGG_A1, 211 | 'RepVGG-A2': create_RepVGG_A2, 212 | 'RepVGG-B0': create_RepVGG_B0, 213 | 'RepVGG-B1': create_RepVGG_B1, 214 | 'RepVGG-B1g2': create_RepVGG_B1g2, 215 | 'RepVGG-B1g4': create_RepVGG_B1g4, 216 | 'RepVGG-B2': create_RepVGG_B2, 217 | 'RepVGG-B2g2': create_RepVGG_B2g2, 218 | 'RepVGG-B2g4': create_RepVGG_B2g4, 219 | 'RepVGG-B3': create_RepVGG_B3, 220 | 'RepVGG-B3g2': create_RepVGG_B3g2, 221 | 'RepVGG-B3g4': create_RepVGG_B3g4, 222 | } 223 | def get_RepVGG_func_by_name(name): 224 | return func_dict[name] 225 | 226 | 227 | # Use like this: 228 | # train_model = create_RepVGG_A0(deploy=False) 229 | # train train_model 230 | # deploy_model = repvgg_convert(train_model, create_RepVGG_A0, save_path='repvgg_deploy.pth') 231 | def repvgg_model_convert(model:torch.nn.Module, build_func, save_path=None): 232 | converted_weights = {} 233 | for name, module in model.named_modules(): 234 | if hasattr(module, 'repvgg_convert'): 235 | kernel, bias = module.repvgg_convert() 236 | converted_weights[name + '.rbr_reparam.weight'] = kernel 237 | converted_weights[name + '.rbr_reparam.bias'] = bias 238 | elif isinstance(module, torch.nn.Linear): 239 | converted_weights[name + '.weight'] = module.weight.detach().cpu().numpy() 240 | converted_weights[name + '.bias'] = module.bias.detach().cpu().numpy() 241 | del model 242 | 243 | deploy_model = build_func(deploy=True) 244 | for name, param in deploy_model.named_parameters(): 245 | print('deploy param: ', name, param.size(), np.mean(converted_weights[name])) 246 | param.data = torch.from_numpy(converted_weights[name]).float() 247 | 248 | if save_path is not None: 249 | torch.save(deploy_model.state_dict(), save_path) 250 | 251 | return deploy_model 252 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o 5 | ../include/my_common.h 6 | ../include/my_interface.h 7 | /home/willer/RepVGG/repvgg_tensorrt_int8/repvgg_infer.cc 8 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/calib3d.hpp 9 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core.hpp 10 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/affine.hpp 11 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/async.hpp 12 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/base.hpp 13 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/bufferpool.hpp 14 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/check.hpp 15 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cuda.hpp 16 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cuda.inl.hpp 17 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cuda_types.hpp 18 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cv_cpu_dispatch.h 19 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cv_cpu_helper.h 20 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvdef.h 21 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvstd.hpp 22 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvstd.inl.hpp 23 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvstd_wrapper.hpp 24 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/fast_math.hpp 25 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/hal/interface.h 26 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/hal/msa_macros.h 27 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/mat.hpp 28 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/mat.inl.hpp 29 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/matx.hpp 30 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/neon_utils.hpp 31 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/operations.hpp 32 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/optim.hpp 33 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/ovx.hpp 34 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/persistence.hpp 35 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/saturate.hpp 36 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/traits.hpp 37 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/types.hpp 38 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/utility.hpp 39 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/utils/instrumentation.hpp 40 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/utils/tls.hpp 41 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/version.hpp 42 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/vsx_utils.hpp 43 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn.hpp 44 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/dict.hpp 45 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/dnn.hpp 46 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/dnn.inl.hpp 47 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/layer.hpp 48 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/utils/inference_engine.hpp 49 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/version.hpp 50 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/features2d.hpp 51 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann.hpp 52 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/all_indices.h 53 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/allocator.h 54 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/any.h 55 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/autotuned_index.h 56 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/composite_index.h 57 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/config.h 58 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/defines.h 59 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/dist.h 60 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/dynamic_bitset.h 61 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/flann_base.hpp 62 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/general.h 63 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/ground_truth.h 64 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/heap.h 65 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/hierarchical_clustering_index.h 66 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/index_testing.h 67 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/kdtree_index.h 68 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/kdtree_single_index.h 69 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/kmeans_index.h 70 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/linear_index.h 71 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/logger.h 72 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/lsh_index.h 73 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/lsh_table.h 74 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/matrix.h 75 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/miniflann.hpp 76 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/nn_index.h 77 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/params.h 78 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/random.h 79 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/result_set.h 80 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/sampling.h 81 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/saving.h 82 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/timer.h 83 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/highgui.hpp 84 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/imgcodecs.hpp 85 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/imgproc.hpp 86 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/ml.hpp 87 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/ml/ml.inl.hpp 88 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/objdetect.hpp 89 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/objdetect/detection_based_tracker.hpp 90 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/opencv.hpp 91 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/opencv_modules.hpp 92 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/photo.hpp 93 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching.hpp 94 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/blenders.hpp 95 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/camera.hpp 96 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp 97 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/matchers.hpp 98 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/motion_estimators.hpp 99 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/seam_finders.hpp 100 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/util.hpp 101 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/util_inl.hpp 102 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/warpers.hpp 103 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/warpers_inl.hpp 104 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/warpers.hpp 105 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/video.hpp 106 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/video/background_segm.hpp 107 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/video/tracking.hpp 108 | /opt/intel/openvino_2020.4.287/opencv/include/opencv2/videoio.hpp 109 | /usr/local/cuda-11.0/include/builtin_types.h 110 | /usr/local/cuda-11.0/include/channel_descriptor.h 111 | /usr/local/cuda-11.0/include/crt/common_functions.h 112 | /usr/local/cuda-11.0/include/crt/device_double_functions.h 113 | /usr/local/cuda-11.0/include/crt/device_double_functions.hpp 114 | /usr/local/cuda-11.0/include/crt/device_functions.h 115 | /usr/local/cuda-11.0/include/crt/device_functions.hpp 116 | /usr/local/cuda-11.0/include/crt/func_macro.h 117 | /usr/local/cuda-11.0/include/crt/host_config.h 118 | /usr/local/cuda-11.0/include/crt/host_defines.h 119 | /usr/local/cuda-11.0/include/crt/math_functions.h 120 | /usr/local/cuda-11.0/include/crt/math_functions.hpp 121 | /usr/local/cuda-11.0/include/crt/sm_70_rt.h 122 | /usr/local/cuda-11.0/include/crt/sm_70_rt.hpp 123 | /usr/local/cuda-11.0/include/crt/sm_80_rt.h 124 | /usr/local/cuda-11.0/include/crt/sm_80_rt.hpp 125 | /usr/local/cuda-11.0/include/cuda_device_runtime_api.h 126 | /usr/local/cuda-11.0/include/cuda_runtime.h 127 | /usr/local/cuda-11.0/include/cuda_runtime_api.h 128 | /usr/local/cuda-11.0/include/cuda_surface_types.h 129 | /usr/local/cuda-11.0/include/cuda_texture_types.h 130 | /usr/local/cuda-11.0/include/device_atomic_functions.h 131 | /usr/local/cuda-11.0/include/device_atomic_functions.hpp 132 | /usr/local/cuda-11.0/include/device_launch_parameters.h 133 | /usr/local/cuda-11.0/include/device_types.h 134 | /usr/local/cuda-11.0/include/driver_functions.h 135 | /usr/local/cuda-11.0/include/driver_types.h 136 | /usr/local/cuda-11.0/include/library_types.h 137 | /usr/local/cuda-11.0/include/math_constants.h 138 | /usr/local/cuda-11.0/include/npp.h 139 | /usr/local/cuda-11.0/include/nppcore.h 140 | /usr/local/cuda-11.0/include/nppdefs.h 141 | /usr/local/cuda-11.0/include/nppi.h 142 | /usr/local/cuda-11.0/include/nppi_arithmetic_and_logical_operations.h 143 | /usr/local/cuda-11.0/include/nppi_color_conversion.h 144 | /usr/local/cuda-11.0/include/nppi_data_exchange_and_initialization.h 145 | /usr/local/cuda-11.0/include/nppi_filtering_functions.h 146 | /usr/local/cuda-11.0/include/nppi_geometry_transforms.h 147 | /usr/local/cuda-11.0/include/nppi_linear_transforms.h 148 | /usr/local/cuda-11.0/include/nppi_morphological_operations.h 149 | /usr/local/cuda-11.0/include/nppi_statistics_functions.h 150 | /usr/local/cuda-11.0/include/nppi_support_functions.h 151 | /usr/local/cuda-11.0/include/nppi_threshold_and_compare_operations.h 152 | /usr/local/cuda-11.0/include/npps.h 153 | /usr/local/cuda-11.0/include/npps_arithmetic_and_logical_operations.h 154 | /usr/local/cuda-11.0/include/npps_conversion_functions.h 155 | /usr/local/cuda-11.0/include/npps_filtering_functions.h 156 | /usr/local/cuda-11.0/include/npps_initialization.h 157 | /usr/local/cuda-11.0/include/npps_statistics_functions.h 158 | /usr/local/cuda-11.0/include/npps_support_functions.h 159 | /usr/local/cuda-11.0/include/sm_20_atomic_functions.h 160 | /usr/local/cuda-11.0/include/sm_20_atomic_functions.hpp 161 | /usr/local/cuda-11.0/include/sm_20_intrinsics.h 162 | /usr/local/cuda-11.0/include/sm_20_intrinsics.hpp 163 | /usr/local/cuda-11.0/include/sm_30_intrinsics.h 164 | /usr/local/cuda-11.0/include/sm_30_intrinsics.hpp 165 | /usr/local/cuda-11.0/include/sm_32_atomic_functions.h 166 | /usr/local/cuda-11.0/include/sm_32_atomic_functions.hpp 167 | /usr/local/cuda-11.0/include/sm_32_intrinsics.h 168 | /usr/local/cuda-11.0/include/sm_32_intrinsics.hpp 169 | /usr/local/cuda-11.0/include/sm_35_atomic_functions.h 170 | /usr/local/cuda-11.0/include/sm_35_intrinsics.h 171 | /usr/local/cuda-11.0/include/sm_60_atomic_functions.h 172 | /usr/local/cuda-11.0/include/sm_60_atomic_functions.hpp 173 | /usr/local/cuda-11.0/include/sm_61_intrinsics.h 174 | /usr/local/cuda-11.0/include/sm_61_intrinsics.hpp 175 | /usr/local/cuda-11.0/include/surface_functions.h 176 | /usr/local/cuda-11.0/include/surface_indirect_functions.h 177 | /usr/local/cuda-11.0/include/surface_types.h 178 | /usr/local/cuda-11.0/include/texture_fetch_functions.h 179 | /usr/local/cuda-11.0/include/texture_indirect_functions.h 180 | /usr/local/cuda-11.0/include/texture_types.h 181 | /usr/local/cuda-11.0/include/vector_functions.h 182 | /usr/local/cuda-11.0/include/vector_functions.hpp 183 | /usr/local/cuda-11.0/include/vector_types.h 184 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeCache.txt: -------------------------------------------------------------------------------- 1 | # This is the CMakeCache file. 2 | # For build in directory: /home/willer/RepVGG/repvgg_tensorrt_int8/build 3 | # It was generated by CMake: /home/willer/clion-2020.3/bin/cmake/linux/bin/cmake 4 | # You can edit this file to change values found and used by cmake. 5 | # If you do not want to change any of the values, simply exit the editor. 6 | # If you do want to change a value, simply edit, save, and exit the editor. 7 | # The syntax for the file is as follows: 8 | # KEY:TYPE=VALUE 9 | # KEY is the name of a variable in the cache. 10 | # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. 11 | # VALUE is the current value for the KEY. 12 | 13 | ######################## 14 | # EXTERNAL cache entries 15 | ######################## 16 | 17 | //Path to a program. 18 | CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line 19 | 20 | //Path to a program. 21 | CMAKE_AR:FILEPATH=/usr/bin/ar 22 | 23 | //Choose the type of build, options are: None Debug Release RelWithDebInfo 24 | // MinSizeRel ... 25 | CMAKE_BUILD_TYPE:STRING= 26 | 27 | //Enable/Disable color output during build. 28 | CMAKE_COLOR_MAKEFILE:BOOL=ON 29 | 30 | //CXX compiler 31 | CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ 32 | 33 | //A wrapper around 'ar' adding the appropriate '--plugin' option 34 | // for the GCC compiler 35 | CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7 36 | 37 | //A wrapper around 'ranlib' adding the appropriate '--plugin' option 38 | // for the GCC compiler 39 | CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7 40 | 41 | //Flags used by the CXX compiler during all build types. 42 | CMAKE_CXX_FLAGS:STRING= 43 | 44 | //Flags used by the CXX compiler during DEBUG builds. 45 | CMAKE_CXX_FLAGS_DEBUG:STRING=-g 46 | 47 | //Flags used by the CXX compiler during MINSIZEREL builds. 48 | CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG 49 | 50 | //Flags used by the CXX compiler during RELEASE builds. 51 | CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG 52 | 53 | //Flags used by the CXX compiler during RELWITHDEBINFO builds. 54 | CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG 55 | 56 | //C compiler 57 | CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc 58 | 59 | //A wrapper around 'ar' adding the appropriate '--plugin' option 60 | // for the GCC compiler 61 | CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7 62 | 63 | //A wrapper around 'ranlib' adding the appropriate '--plugin' option 64 | // for the GCC compiler 65 | CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7 66 | 67 | //Flags used by the C compiler during all build types. 68 | CMAKE_C_FLAGS:STRING= 69 | 70 | //Flags used by the C compiler during DEBUG builds. 71 | CMAKE_C_FLAGS_DEBUG:STRING=-g 72 | 73 | //Flags used by the C compiler during MINSIZEREL builds. 74 | CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG 75 | 76 | //Flags used by the C compiler during RELEASE builds. 77 | CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG 78 | 79 | //Flags used by the C compiler during RELWITHDEBINFO builds. 80 | CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG 81 | 82 | //Path to a program. 83 | CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND 84 | 85 | //Flags used by the linker during all build types. 86 | CMAKE_EXE_LINKER_FLAGS:STRING= 87 | 88 | //Flags used by the linker during DEBUG builds. 89 | CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= 90 | 91 | //Flags used by the linker during MINSIZEREL builds. 92 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= 93 | 94 | //Flags used by the linker during RELEASE builds. 95 | CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= 96 | 97 | //Flags used by the linker during RELWITHDEBINFO builds. 98 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 99 | 100 | //Enable/Disable output of compile commands during generation. 101 | CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= 102 | 103 | //Install path prefix, prepended onto install directories. 104 | CMAKE_INSTALL_PREFIX:PATH=/usr/local 105 | 106 | //Path to a program. 107 | CMAKE_LINKER:FILEPATH=/usr/bin/ld 108 | 109 | //Path to a program. 110 | CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make 111 | 112 | //Flags used by the linker during the creation of modules during 113 | // all build types. 114 | CMAKE_MODULE_LINKER_FLAGS:STRING= 115 | 116 | //Flags used by the linker during the creation of modules during 117 | // DEBUG builds. 118 | CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= 119 | 120 | //Flags used by the linker during the creation of modules during 121 | // MINSIZEREL builds. 122 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= 123 | 124 | //Flags used by the linker during the creation of modules during 125 | // RELEASE builds. 126 | CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= 127 | 128 | //Flags used by the linker during the creation of modules during 129 | // RELWITHDEBINFO builds. 130 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 131 | 132 | //Path to a program. 133 | CMAKE_NM:FILEPATH=/usr/bin/nm 134 | 135 | //Path to a program. 136 | CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy 137 | 138 | //Path to a program. 139 | CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump 140 | 141 | //Value Computed by CMake 142 | CMAKE_PROJECT_DESCRIPTION:STATIC= 143 | 144 | //Value Computed by CMake 145 | CMAKE_PROJECT_HOMEPAGE_URL:STATIC= 146 | 147 | //Value Computed by CMake 148 | CMAKE_PROJECT_NAME:STATIC=RepVGGsEngine 149 | 150 | //Path to a program. 151 | CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib 152 | 153 | //Path to a program. 154 | CMAKE_READELF:FILEPATH=/usr/bin/readelf 155 | 156 | //Flags used by the linker during the creation of shared libraries 157 | // during all build types. 158 | CMAKE_SHARED_LINKER_FLAGS:STRING= 159 | 160 | //Flags used by the linker during the creation of shared libraries 161 | // during DEBUG builds. 162 | CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= 163 | 164 | //Flags used by the linker during the creation of shared libraries 165 | // during MINSIZEREL builds. 166 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= 167 | 168 | //Flags used by the linker during the creation of shared libraries 169 | // during RELEASE builds. 170 | CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= 171 | 172 | //Flags used by the linker during the creation of shared libraries 173 | // during RELWITHDEBINFO builds. 174 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= 175 | 176 | //If set, runtime paths are not added when installing shared libraries, 177 | // but are added when building. 178 | CMAKE_SKIP_INSTALL_RPATH:BOOL=NO 179 | 180 | //If set, runtime paths are not added when using shared libraries. 181 | CMAKE_SKIP_RPATH:BOOL=NO 182 | 183 | //Flags used by the linker during the creation of static libraries 184 | // during all build types. 185 | CMAKE_STATIC_LINKER_FLAGS:STRING= 186 | 187 | //Flags used by the linker during the creation of static libraries 188 | // during DEBUG builds. 189 | CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= 190 | 191 | //Flags used by the linker during the creation of static libraries 192 | // during MINSIZEREL builds. 193 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= 194 | 195 | //Flags used by the linker during the creation of static libraries 196 | // during RELEASE builds. 197 | CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= 198 | 199 | //Flags used by the linker during the creation of static libraries 200 | // during RELWITHDEBINFO builds. 201 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= 202 | 203 | //Path to a program. 204 | CMAKE_STRIP:FILEPATH=/usr/bin/strip 205 | 206 | //If this value is on, makefiles will be generated without the 207 | // .SILENT directive, and all commands will be echoed to the console 208 | // during the make. This is useful for debugging only. With Visual 209 | // Studio IDE projects all commands are done without /nologo. 210 | CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE 211 | 212 | //The directory containing a CMake configuration file for OpenCV. 213 | OpenCV_DIR:PATH=/opt/intel/openvino_2020.4.287/opencv/cmake 214 | 215 | //Value Computed by CMake 216 | RepVGGsEngine_BINARY_DIR:STATIC=/home/willer/RepVGG/repvgg_tensorrt_int8/build 217 | 218 | //Value Computed by CMake 219 | RepVGGsEngine_SOURCE_DIR:STATIC=/home/willer/RepVGG/repvgg_tensorrt_int8 220 | 221 | 222 | ######################## 223 | # INTERNAL cache entries 224 | ######################## 225 | 226 | //ADVANCED property for variable: CMAKE_ADDR2LINE 227 | CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 228 | //ADVANCED property for variable: CMAKE_AR 229 | CMAKE_AR-ADVANCED:INTERNAL=1 230 | //This is the directory where this CMakeCache.txt was created 231 | CMAKE_CACHEFILE_DIR:INTERNAL=/home/willer/RepVGG/repvgg_tensorrt_int8/build 232 | //Major version of cmake used to create the current loaded cache 233 | CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 234 | //Minor version of cmake used to create the current loaded cache 235 | CMAKE_CACHE_MINOR_VERSION:INTERNAL=17 236 | //Patch version of cmake used to create the current loaded cache 237 | CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 238 | //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE 239 | CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 240 | //Path to CMake executable. 241 | CMAKE_COMMAND:INTERNAL=/home/willer/clion-2020.3/bin/cmake/linux/bin/cmake 242 | //Path to cpack program executable. 243 | CMAKE_CPACK_COMMAND:INTERNAL=/home/willer/clion-2020.3/bin/cmake/linux/bin/cpack 244 | //Path to ctest program executable. 245 | CMAKE_CTEST_COMMAND:INTERNAL=/home/willer/clion-2020.3/bin/cmake/linux/bin/ctest 246 | //ADVANCED property for variable: CMAKE_CXX_COMPILER 247 | CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 248 | //ADVANCED property for variable: CMAKE_CXX_COMPILER_AR 249 | CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 250 | //ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB 251 | CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 252 | //ADVANCED property for variable: CMAKE_CXX_FLAGS 253 | CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 254 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG 255 | CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 256 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL 257 | CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 258 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE 259 | CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 260 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO 261 | CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 262 | //ADVANCED property for variable: CMAKE_C_COMPILER 263 | CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 264 | //ADVANCED property for variable: CMAKE_C_COMPILER_AR 265 | CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 266 | //ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB 267 | CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 268 | //ADVANCED property for variable: CMAKE_C_FLAGS 269 | CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 270 | //ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG 271 | CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 272 | //ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL 273 | CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 274 | //ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE 275 | CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 276 | //ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO 277 | CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 278 | //ADVANCED property for variable: CMAKE_DLLTOOL 279 | CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 280 | //Path to cache edit program executable. 281 | CMAKE_EDIT_COMMAND:INTERNAL=/home/willer/clion-2020.3/bin/cmake/linux/bin/ccmake 282 | //Executable file format 283 | CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF 284 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS 285 | CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 286 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG 287 | CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 288 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL 289 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 290 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE 291 | CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 292 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO 293 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 294 | //ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS 295 | CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 296 | //Name of external makefile project generator. 297 | CMAKE_EXTRA_GENERATOR:INTERNAL= 298 | //Name of generator. 299 | CMAKE_GENERATOR:INTERNAL=Unix Makefiles 300 | //Generator instance identifier. 301 | CMAKE_GENERATOR_INSTANCE:INTERNAL= 302 | //Name of generator platform. 303 | CMAKE_GENERATOR_PLATFORM:INTERNAL= 304 | //Name of generator toolset. 305 | CMAKE_GENERATOR_TOOLSET:INTERNAL= 306 | //Source directory with the top level CMakeLists.txt file for this 307 | // project 308 | CMAKE_HOME_DIRECTORY:INTERNAL=/home/willer/RepVGG/repvgg_tensorrt_int8 309 | //Install .so files without execute permission. 310 | CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 311 | //ADVANCED property for variable: CMAKE_LINKER 312 | CMAKE_LINKER-ADVANCED:INTERNAL=1 313 | //ADVANCED property for variable: CMAKE_MAKE_PROGRAM 314 | CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 315 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS 316 | CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 317 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG 318 | CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 319 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL 320 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 321 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE 322 | CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 323 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO 324 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 325 | //ADVANCED property for variable: CMAKE_NM 326 | CMAKE_NM-ADVANCED:INTERNAL=1 327 | //number of local generators 328 | CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 329 | //ADVANCED property for variable: CMAKE_OBJCOPY 330 | CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 331 | //ADVANCED property for variable: CMAKE_OBJDUMP 332 | CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 333 | //Platform information initialized 334 | CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 335 | //ADVANCED property for variable: CMAKE_RANLIB 336 | CMAKE_RANLIB-ADVANCED:INTERNAL=1 337 | //ADVANCED property for variable: CMAKE_READELF 338 | CMAKE_READELF-ADVANCED:INTERNAL=1 339 | //Path to CMake installation. 340 | CMAKE_ROOT:INTERNAL=/home/willer/clion-2020.3/bin/cmake/linux/share/cmake-3.17 341 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS 342 | CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 343 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG 344 | CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 345 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL 346 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 347 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE 348 | CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 349 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO 350 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 351 | //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH 352 | CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 353 | //ADVANCED property for variable: CMAKE_SKIP_RPATH 354 | CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 355 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS 356 | CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 357 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG 358 | CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 359 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL 360 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 361 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE 362 | CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 363 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO 364 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 365 | //ADVANCED property for variable: CMAKE_STRIP 366 | CMAKE_STRIP-ADVANCED:INTERNAL=1 367 | //uname command 368 | CMAKE_UNAME:INTERNAL=/bin/uname 369 | //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE 370 | CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 371 | //Details about finding OpenCV 372 | FIND_PACKAGE_MESSAGE_DETAILS_OpenCV:INTERNAL=[/opt/intel/openvino_2020.4.287/opencv][v4.4.0()] 373 | 374 | -------------------------------------------------------------------------------- /train.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import random 4 | import shutil 5 | import time 6 | import warnings 7 | 8 | import torch 9 | import torch.nn as nn 10 | import torch.nn.parallel 11 | import torch.backends.cudnn as cudnn 12 | import torch.distributed as dist 13 | import torch.optim 14 | import torch.multiprocessing as mp 15 | import torch.utils.data 16 | import torch.utils.data.distributed 17 | import torchvision.transforms as transforms 18 | import torchvision.datasets as datasets 19 | from torch.optim.lr_scheduler import CosineAnnealingLR 20 | from utils import AverageMeter, accuracy, ProgressMeter 21 | 22 | from repvgg import get_RepVGG_func_by_name 23 | 24 | IMAGENET_TRAINSET_SIZE = 22500 25 | 26 | 27 | parser = argparse.ArgumentParser(description='PyTorch ImageNet Training') 28 | parser.add_argument('--data', default="dogs-vs-cats", type=str, 29 | help='path to dataset') 30 | parser.add_argument('-a', '--arch', metavar='ARCH', default='RepVGG-A0') 31 | parser.add_argument('-j', '--workers', default=8, type=int, metavar='N', 32 | help='number of data loading workers (default: 4)') 33 | parser.add_argument('--epochs', default=10, type=int, metavar='N', 34 | help='number of total epochs to run') 35 | parser.add_argument('--start-epoch', default=0, type=int, metavar='N', 36 | help='manual epoch number (useful on restarts)') 37 | parser.add_argument('-b', '--batch-size', default=64, type=int, 38 | metavar='N', 39 | help='mini-batch size (default: 256), this is the total ' 40 | 'batch size of all GPUs on the current node when ' 41 | 'using Data Parallel or Distributed Data Parallel') 42 | parser.add_argument('--lr', '--learning-rate', default=0.01, type=float, 43 | metavar='LR', help='initial learning rate', dest='lr') 44 | parser.add_argument('--momentum', default=0.9, type=float, metavar='M', 45 | help='momentum') 46 | parser.add_argument('--wd', '--weight-decay', default=1e-4, type=float, 47 | metavar='W', help='weight decay (default: 1e-4)', 48 | dest='weight_decay') 49 | parser.add_argument('-p', '--print-freq', default=1, type=int, 50 | metavar='N', help='print frequency (default: 10)') 51 | parser.add_argument('--model_path', default="./models/RepVGG-A0-classes2.pth", type=str, 52 | help='loading pretrained model') 53 | parser.add_argument('--resume', default='', type=str, metavar='PATH', 54 | help='path to latest checkpoint (default: none)') 55 | parser.add_argument('-e', '--evaluate', dest='evaluate', action='store_true', 56 | help='evaluate model on validation set') 57 | parser.add_argument('--pretrained', dest='pretrained', action='store_true', 58 | help='use pre-trained model') 59 | parser.add_argument('--world-size', default=-1, type=int, 60 | help='number of nodes for distributed training') 61 | parser.add_argument('--rank', default=-1, type=int, 62 | help='node rank for distributed training') 63 | parser.add_argument('--dist-url', default='tcp://224.66.41.62:23456', type=str, 64 | help='url used to set up distributed training') 65 | parser.add_argument('--dist-backend', default='nccl', type=str, 66 | help='distributed backend') 67 | parser.add_argument('--seed', default=None, type=int, 68 | help='seed for initializing training. ') 69 | parser.add_argument('--gpu', default=None, type=int, 70 | help='GPU id to use.') 71 | parser.add_argument('--multiprocessing-distributed', action='store_true', 72 | help='Use multi-processing distributed training to launch ' 73 | 'N processes per node, which has N GPUs. This is the ' 74 | 'fastest way to use PyTorch for either single node or ' 75 | 'multi node data parallel training') 76 | 77 | best_acc1 = 0 78 | 79 | 80 | def sgd_optimizer(model, lr, momentum, weight_decay): 81 | params = [] 82 | for key, value in model.named_parameters(): 83 | if not value.requires_grad: 84 | continue 85 | apply_weight_decay = weight_decay 86 | apply_lr = lr 87 | if 'bias' in key or 'bn' in key: 88 | apply_weight_decay = 0 89 | print('set weight decay=0 for {}'.format(key)) 90 | if 'bias' in key: 91 | apply_lr = 2 * lr # Just a Caffe-style common practice. Made no difference. 92 | params += [{'params': [value], 'lr': apply_lr, 'weight_decay': apply_weight_decay}] 93 | optimizer = torch.optim.SGD(params, lr, momentum=momentum) 94 | return optimizer 95 | 96 | def main(): 97 | args = parser.parse_args() 98 | 99 | if args.seed is not None: 100 | random.seed(args.seed) 101 | torch.manual_seed(args.seed) 102 | cudnn.deterministic = True 103 | warnings.warn('You have chosen to seed training. ' 104 | 'This will turn on the CUDNN deterministic setting, ' 105 | 'which can slow down your training considerably! ' 106 | 'You may see unexpected behavior when restarting ' 107 | 'from checkpoints.') 108 | 109 | if args.gpu is not None: 110 | warnings.warn('You have chosen a specific GPU. This will completely ' 111 | 'disable data parallelism.') 112 | 113 | if args.dist_url == "env://" and args.world_size == -1: 114 | args.world_size = int(os.environ["WORLD_SIZE"]) 115 | 116 | args.distributed = args.world_size > 1 or args.multiprocessing_distributed 117 | 118 | ngpus_per_node = torch.cuda.device_count() 119 | if args.multiprocessing_distributed: 120 | # Since we have ngpus_per_node processes per node, the total world_size 121 | # needs to be adjusted accordingly 122 | args.world_size = ngpus_per_node * args.world_size 123 | # Use torch.multiprocessing.spawn to launch distributed processes: the 124 | # main_worker process function 125 | mp.spawn(main_worker, nprocs=ngpus_per_node, args=(ngpus_per_node, args)) 126 | else: 127 | # Simply call main_worker function 128 | main_worker(args.gpu, ngpus_per_node, args) 129 | 130 | 131 | def main_worker(gpu, ngpus_per_node, args): 132 | global best_acc1 133 | args.gpu = gpu 134 | 135 | if args.gpu is not None: 136 | print("Use GPU: {} for training".format(args.gpu)) 137 | 138 | if args.distributed: 139 | if args.dist_url == "env://" and args.rank == -1: 140 | args.rank = int(os.environ["RANK"]) 141 | if args.multiprocessing_distributed: 142 | # For multiprocessing distributed training, rank needs to be the 143 | # global rank among all the processes 144 | args.rank = args.rank * ngpus_per_node + gpu 145 | dist.init_process_group(backend=args.dist_backend, init_method=args.dist_url, 146 | world_size=args.world_size, rank=args.rank) 147 | 148 | repvgg_build_func = get_RepVGG_func_by_name(args.arch) 149 | 150 | model = repvgg_build_func(deploy=False) 151 | 152 | if not torch.cuda.is_available(): 153 | print('using CPU, this will be slow') 154 | elif args.distributed: 155 | # For multiprocessing distributed, DistributedDataParallel constructor 156 | # should always set the single device scope, otherwise, 157 | # DistributedDataParallel will use all available devices. 158 | if args.gpu is not None: 159 | torch.cuda.set_device(args.gpu) 160 | model.cuda(args.gpu) 161 | # When using a single GPU per process and per 162 | # DistributedDataParallel, we need to divide the batch size 163 | # ourselves based on the total number of GPUs we have 164 | args.batch_size = int(args.batch_size / ngpus_per_node) 165 | args.workers = int((args.workers + ngpus_per_node - 1) / ngpus_per_node) 166 | model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[args.gpu]) 167 | else: 168 | model.cuda() 169 | # DistributedDataParallel will divide and allocate batch_size to all 170 | # available GPUs if device_ids are not set 171 | model = torch.nn.parallel.DistributedDataParallel(model) 172 | elif args.gpu is not None: 173 | torch.cuda.set_device(args.gpu) 174 | model = model.cuda(args.gpu) 175 | else: 176 | # DataParallel will divide and allocate batch_size to all available GPUs 177 | model = torch.nn.DataParallel(model).cuda() 178 | if args.model_path!=" ": 179 | print("loading pretrained model from " + args.model_path) 180 | model.load_state_dict(torch.load(args.model_path)) 181 | # define loss function (criterion) and optimizer 182 | criterion = nn.CrossEntropyLoss().cuda(args.gpu) 183 | 184 | optimizer = sgd_optimizer(model, args.lr, args.momentum, args.weight_decay) 185 | 186 | lr_scheduler = CosineAnnealingLR(optimizer=optimizer, T_max=args.epochs * IMAGENET_TRAINSET_SIZE // args.batch_size // ngpus_per_node) 187 | 188 | # optionally resume from a checkpoint 189 | if args.resume: 190 | if os.path.isfile(args.resume): 191 | print("=> loading checkpoint '{}'".format(args.resume)) 192 | if args.gpu is None: 193 | checkpoint = torch.load(args.resume) 194 | else: 195 | # Map model to be loaded to specified single gpu. 196 | loc = 'cuda:{}'.format(args.gpu) 197 | checkpoint = torch.load(args.resume, map_location=loc) 198 | args.start_epoch = checkpoint['epoch'] 199 | best_acc1 = checkpoint['best_acc1'] 200 | if args.gpu is not None: 201 | # best_acc1 may be from a checkpoint from a different GPU 202 | best_acc1 = best_acc1.to(args.gpu) 203 | model.load_state_dict(checkpoint['state_dict']) 204 | optimizer.load_state_dict(checkpoint['optimizer']) 205 | lr_scheduler.load_state_dict(checkpoint['scheduler']) 206 | print("=> loaded checkpoint '{}' (epoch {})" 207 | .format(args.resume, checkpoint['epoch'])) 208 | else: 209 | print("=> no checkpoint found at '{}'".format(args.resume)) 210 | 211 | cudnn.benchmark = True 212 | 213 | # Data loading code 214 | traindir = os.path.join(args.data, 'train') 215 | valdir = os.path.join(args.data, 'val') 216 | normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], 217 | std=[0.229, 0.224, 0.225]) 218 | 219 | train_dataset = datasets.ImageFolder( 220 | traindir, 221 | transforms.Compose([ 222 | transforms.RandomResizedCrop(224), 223 | transforms.RandomHorizontalFlip(), 224 | transforms.ToTensor(), 225 | normalize, 226 | ])) 227 | 228 | if args.distributed: 229 | train_sampler = torch.utils.data.distributed.DistributedSampler(train_dataset) 230 | else: 231 | train_sampler = None 232 | 233 | train_loader = torch.utils.data.DataLoader( 234 | train_dataset, batch_size=args.batch_size, shuffle=(train_sampler is None), 235 | num_workers=args.workers, pin_memory=True, sampler=train_sampler) 236 | 237 | 238 | val_dataset = datasets.ImageFolder(valdir, transforms.Compose([ 239 | transforms.Resize(256), 240 | transforms.CenterCrop(224), 241 | transforms.ToTensor(), 242 | normalize, 243 | ])) 244 | val_loader = torch.utils.data.DataLoader( 245 | val_dataset, 246 | batch_size=args.batch_size, shuffle=False, 247 | num_workers=args.workers, pin_memory=True) 248 | 249 | 250 | if args.evaluate: 251 | validate(val_loader, model, criterion, args) 252 | return 253 | 254 | for epoch in range(args.start_epoch, args.epochs): 255 | if args.distributed: 256 | train_sampler.set_epoch(epoch) 257 | # adjust_learning_rate(optimizer, epoch, args) 258 | 259 | # train for one epoch 260 | train(train_loader, model, criterion, optimizer, epoch, args, lr_scheduler) 261 | 262 | # evaluate on validation set 263 | acc1 = validate(val_loader, model, criterion, args) 264 | 265 | # remember best acc@1 and save checkpoint 266 | is_best = acc1 > best_acc1 267 | best_acc1 = max(acc1, best_acc1) 268 | 269 | if not args.multiprocessing_distributed or (args.multiprocessing_distributed 270 | and args.rank % ngpus_per_node == 0): 271 | save_checkpoint({ 272 | 'epoch': epoch + 1, 273 | 'arch': args.arch, 274 | 'state_dict': model.state_dict(), 275 | 'best_acc1': best_acc1, 276 | 'optimizer' : optimizer.state_dict(), 277 | 'scheduler': lr_scheduler.state_dict(), 278 | }, is_best) 279 | 280 | 281 | def train(train_loader, model, criterion, optimizer, epoch, args, lr_scheduler): 282 | batch_time = AverageMeter('Time', ':6.3f') 283 | data_time = AverageMeter('Data', ':6.3f') 284 | losses = AverageMeter('Loss', ':.4e') 285 | top1 = AverageMeter('Acc@1', ':6.2f') 286 | top5 = AverageMeter('Acc@5', ':6.2f') 287 | progress = ProgressMeter( 288 | len(train_loader), 289 | [batch_time, data_time, losses, top1, top5, ], 290 | prefix="Epoch: [{}]".format(epoch)) 291 | 292 | # switch to train mode 293 | model.train() 294 | 295 | end = time.time() 296 | for i, (images, target) in enumerate(train_loader): 297 | # measure data loading time 298 | data_time.update(time.time() - end) 299 | 300 | if args.gpu is not None: 301 | images = images.cuda(args.gpu, non_blocking=True) 302 | if torch.cuda.is_available(): 303 | target = target.cuda(args.gpu, non_blocking=True) 304 | 305 | # compute output 306 | output = model(images) 307 | loss = criterion(output, target) 308 | 309 | # measure accuracy and record loss 310 | acc1, acc5 = accuracy(output, target, topk=(1, 2)) 311 | losses.update(loss.item(), images.size(0)) 312 | top1.update(acc1[0], images.size(0)) 313 | top5.update(acc5[0], images.size(0)) 314 | 315 | # compute gradient and do SGD step 316 | optimizer.zero_grad() 317 | loss.backward() 318 | optimizer.step() 319 | 320 | # measure elapsed time 321 | batch_time.update(time.time() - end) 322 | end = time.time() 323 | 324 | lr_scheduler.step() 325 | 326 | if i % args.print_freq == 0: 327 | progress.display(i) 328 | if i % 1000 == 0: 329 | print('cur lr: ', lr_scheduler.get_lr()[0]) 330 | 331 | 332 | 333 | 334 | def validate(val_loader, model, criterion, args): 335 | batch_time = AverageMeter('Time', ':6.3f') 336 | losses = AverageMeter('Loss', ':.4e') 337 | top1 = AverageMeter('Acc@1', ':6.2f') 338 | top5 = AverageMeter('Acc@5', ':6.2f') 339 | progress = ProgressMeter( 340 | len(val_loader), 341 | [batch_time, losses, top1, top5], 342 | prefix='Test: ') 343 | 344 | # switch to evaluate mode 345 | model.eval() 346 | 347 | with torch.no_grad(): 348 | end = time.time() 349 | for i, (images, target) in enumerate(val_loader): 350 | if args.gpu is not None: 351 | images = images.cuda(args.gpu, non_blocking=True) 352 | if torch.cuda.is_available(): 353 | target = target.cuda(args.gpu, non_blocking=True) 354 | 355 | # compute output 356 | output = model(images) 357 | loss = criterion(output, target) 358 | 359 | # measure accuracy and record loss 360 | acc1, acc5 = accuracy(output, target, topk=(1, 2)) 361 | losses.update(loss.item(), images.size(0)) 362 | top1.update(acc1[0], images.size(0)) 363 | top5.update(acc5[0], images.size(0)) 364 | 365 | # measure elapsed time 366 | batch_time.update(time.time() - end) 367 | end = time.time() 368 | 369 | if i % args.print_freq == 0: 370 | progress.display(i) 371 | 372 | 373 | # TODO: this should also be done with the ProgressMeter 374 | print(' * Acc@1 {top1.avg:.3f} Acc@5 {top5.avg:.3f}' 375 | .format(top1=top1, top5=top5)) 376 | 377 | return top1.avg 378 | 379 | 380 | def save_checkpoint(state, is_best, filename='checkpoint.pth.tar'): 381 | torch.save(state, filename) 382 | if is_best: 383 | shutil.copyfile(filename, 'model_best.pth.tar') 384 | 385 | 386 | 387 | 388 | if __name__ == '__main__': 389 | main() 390 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/RepVGGsEngine.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.17 3 | 4 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: ../include/my_common.h 5 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: ../include/my_interface.h 6 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: ../repvgg_infer.cc 7 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/calib3d.hpp 8 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core.hpp 9 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/affine.hpp 10 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/async.hpp 11 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/base.hpp 12 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/bufferpool.hpp 13 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/check.hpp 14 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cuda.hpp 15 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cuda.inl.hpp 16 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cuda_types.hpp 17 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cv_cpu_dispatch.h 18 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cv_cpu_helper.h 19 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvdef.h 20 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvstd.hpp 21 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvstd.inl.hpp 22 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/cvstd_wrapper.hpp 23 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/fast_math.hpp 24 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/hal/interface.h 25 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/hal/msa_macros.h 26 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/mat.hpp 27 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/mat.inl.hpp 28 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/matx.hpp 29 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/neon_utils.hpp 30 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/operations.hpp 31 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/optim.hpp 32 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/ovx.hpp 33 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/persistence.hpp 34 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/saturate.hpp 35 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/traits.hpp 36 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/types.hpp 37 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/utility.hpp 38 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/utils/instrumentation.hpp 39 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/utils/tls.hpp 40 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/version.hpp 41 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/core/vsx_utils.hpp 42 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn.hpp 43 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/dict.hpp 44 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/dnn.hpp 45 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/dnn.inl.hpp 46 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/layer.hpp 47 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/utils/inference_engine.hpp 48 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/dnn/version.hpp 49 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/features2d.hpp 50 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann.hpp 51 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/all_indices.h 52 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/allocator.h 53 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/any.h 54 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/autotuned_index.h 55 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/composite_index.h 56 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/config.h 57 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/defines.h 58 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/dist.h 59 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/dynamic_bitset.h 60 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/flann_base.hpp 61 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/general.h 62 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/ground_truth.h 63 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/heap.h 64 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/hierarchical_clustering_index.h 65 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/index_testing.h 66 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/kdtree_index.h 67 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/kdtree_single_index.h 68 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/kmeans_index.h 69 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/linear_index.h 70 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/logger.h 71 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/lsh_index.h 72 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/lsh_table.h 73 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/matrix.h 74 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/miniflann.hpp 75 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/nn_index.h 76 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/params.h 77 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/random.h 78 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/result_set.h 79 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/sampling.h 80 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/saving.h 81 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/flann/timer.h 82 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/highgui.hpp 83 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/imgcodecs.hpp 84 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/imgproc.hpp 85 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/ml.hpp 86 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/ml/ml.inl.hpp 87 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/objdetect.hpp 88 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/objdetect/detection_based_tracker.hpp 89 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/opencv.hpp 90 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/opencv_modules.hpp 91 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/photo.hpp 92 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching.hpp 93 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/blenders.hpp 94 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/camera.hpp 95 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp 96 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/matchers.hpp 97 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/motion_estimators.hpp 98 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/seam_finders.hpp 99 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/util.hpp 100 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/util_inl.hpp 101 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/warpers.hpp 102 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/detail/warpers_inl.hpp 103 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/stitching/warpers.hpp 104 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/video.hpp 105 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/video/background_segm.hpp 106 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/video/tracking.hpp 107 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /opt/intel/openvino_2020.4.287/opencv/include/opencv2/videoio.hpp 108 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/builtin_types.h 109 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/channel_descriptor.h 110 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/common_functions.h 111 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/device_double_functions.h 112 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/device_double_functions.hpp 113 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/device_functions.h 114 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/device_functions.hpp 115 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/func_macro.h 116 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/host_config.h 117 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/host_defines.h 118 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/math_functions.h 119 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/math_functions.hpp 120 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/sm_70_rt.h 121 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/sm_70_rt.hpp 122 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/sm_80_rt.h 123 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/crt/sm_80_rt.hpp 124 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/cuda_device_runtime_api.h 125 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/cuda_runtime.h 126 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/cuda_runtime_api.h 127 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/cuda_surface_types.h 128 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/cuda_texture_types.h 129 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/device_atomic_functions.h 130 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/device_atomic_functions.hpp 131 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/device_launch_parameters.h 132 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/device_types.h 133 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/driver_functions.h 134 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/driver_types.h 135 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/library_types.h 136 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/math_constants.h 137 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npp.h 138 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppcore.h 139 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppdefs.h 140 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi.h 141 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_arithmetic_and_logical_operations.h 142 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_color_conversion.h 143 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_data_exchange_and_initialization.h 144 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_filtering_functions.h 145 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_geometry_transforms.h 146 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_linear_transforms.h 147 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_morphological_operations.h 148 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_statistics_functions.h 149 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_support_functions.h 150 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/nppi_threshold_and_compare_operations.h 151 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npps.h 152 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npps_arithmetic_and_logical_operations.h 153 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npps_conversion_functions.h 154 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npps_filtering_functions.h 155 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npps_initialization.h 156 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npps_statistics_functions.h 157 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/npps_support_functions.h 158 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_20_atomic_functions.h 159 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_20_atomic_functions.hpp 160 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_20_intrinsics.h 161 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_20_intrinsics.hpp 162 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_30_intrinsics.h 163 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_30_intrinsics.hpp 164 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_32_atomic_functions.h 165 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_32_atomic_functions.hpp 166 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_32_intrinsics.h 167 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_32_intrinsics.hpp 168 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_35_atomic_functions.h 169 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_35_intrinsics.h 170 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_60_atomic_functions.h 171 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_60_atomic_functions.hpp 172 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_61_intrinsics.h 173 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/sm_61_intrinsics.hpp 174 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/surface_functions.h 175 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/surface_indirect_functions.h 176 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/surface_types.h 177 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/texture_fetch_functions.h 178 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/texture_indirect_functions.h 179 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/texture_types.h 180 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/vector_functions.h 181 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/vector_functions.hpp 182 | CMakeFiles/RepVGGsEngine.dir/repvgg_infer.cc.o: /usr/local/cuda-11.0/include/vector_types.h 183 | 184 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CompilerIdCXX/CMakeCXXCompilerId.cpp: -------------------------------------------------------------------------------- 1 | /* This source file must have a .cpp extension so that all C++ compilers 2 | recognize the extension without flags. Borland does not know .cxx for 3 | example. */ 4 | #ifndef __cplusplus 5 | # error "A C compiler has been selected for C++." 6 | #endif 7 | 8 | 9 | /* Version number components: V=Version, R=Revision, P=Patch 10 | Version date components: YYYY=Year, MM=Month, DD=Day */ 11 | 12 | #if defined(__COMO__) 13 | # define COMPILER_ID "Comeau" 14 | /* __COMO_VERSION__ = VRR */ 15 | # define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) 16 | # define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) 17 | 18 | #elif defined(__INTEL_COMPILER) || defined(__ICC) 19 | # define COMPILER_ID "Intel" 20 | # if defined(_MSC_VER) 21 | # define SIMULATE_ID "MSVC" 22 | # endif 23 | # if defined(__GNUC__) 24 | # define SIMULATE_ID "GNU" 25 | # endif 26 | /* __INTEL_COMPILER = VRP */ 27 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 28 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 29 | # if defined(__INTEL_COMPILER_UPDATE) 30 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 31 | # else 32 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 33 | # endif 34 | # if defined(__INTEL_COMPILER_BUILD_DATE) 35 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 36 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 37 | # endif 38 | # if defined(_MSC_VER) 39 | /* _MSC_VER = VVRR */ 40 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 41 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 42 | # endif 43 | # if defined(__GNUC__) 44 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 45 | # elif defined(__GNUG__) 46 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 47 | # endif 48 | # if defined(__GNUC_MINOR__) 49 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 50 | # endif 51 | # if defined(__GNUC_PATCHLEVEL__) 52 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 53 | # endif 54 | 55 | #elif defined(__PATHCC__) 56 | # define COMPILER_ID "PathScale" 57 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 58 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 59 | # if defined(__PATHCC_PATCHLEVEL__) 60 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 61 | # endif 62 | 63 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 64 | # define COMPILER_ID "Embarcadero" 65 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 66 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 67 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 68 | 69 | #elif defined(__BORLANDC__) 70 | # define COMPILER_ID "Borland" 71 | /* __BORLANDC__ = 0xVRR */ 72 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 73 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 74 | 75 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 76 | # define COMPILER_ID "Watcom" 77 | /* __WATCOMC__ = VVRR */ 78 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 79 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 80 | # if (__WATCOMC__ % 10) > 0 81 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 82 | # endif 83 | 84 | #elif defined(__WATCOMC__) 85 | # define COMPILER_ID "OpenWatcom" 86 | /* __WATCOMC__ = VVRP + 1100 */ 87 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 88 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 89 | # if (__WATCOMC__ % 10) > 0 90 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 91 | # endif 92 | 93 | #elif defined(__SUNPRO_CC) 94 | # define COMPILER_ID "SunPro" 95 | # if __SUNPRO_CC >= 0x5100 96 | /* __SUNPRO_CC = 0xVRRP */ 97 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) 98 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) 99 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 100 | # else 101 | /* __SUNPRO_CC = 0xVRP */ 102 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) 103 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) 104 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 105 | # endif 106 | 107 | #elif defined(__HP_aCC) 108 | # define COMPILER_ID "HP" 109 | /* __HP_aCC = VVRRPP */ 110 | # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) 111 | # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) 112 | # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) 113 | 114 | #elif defined(__DECCXX) 115 | # define COMPILER_ID "Compaq" 116 | /* __DECCXX_VER = VVRRTPPPP */ 117 | # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) 118 | # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) 119 | # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) 120 | 121 | #elif defined(__IBMCPP__) && defined(__COMPILER_VER__) 122 | # define COMPILER_ID "zOS" 123 | /* __IBMCPP__ = VRP */ 124 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 125 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 126 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 127 | 128 | #elif defined(__ibmxl__) && defined(__clang__) 129 | # define COMPILER_ID "XLClang" 130 | # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) 131 | # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) 132 | # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) 133 | # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) 134 | 135 | 136 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 137 | # define COMPILER_ID "XL" 138 | /* __IBMCPP__ = VRP */ 139 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 140 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 141 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 142 | 143 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 144 | # define COMPILER_ID "VisualAge" 145 | /* __IBMCPP__ = VRP */ 146 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 147 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 148 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 149 | 150 | #elif defined(__PGI) 151 | # define COMPILER_ID "PGI" 152 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 153 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 154 | # if defined(__PGIC_PATCHLEVEL__) 155 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 156 | # endif 157 | 158 | #elif defined(_CRAYC) 159 | # define COMPILER_ID "Cray" 160 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 161 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 162 | 163 | #elif defined(__TI_COMPILER_VERSION__) 164 | # define COMPILER_ID "TI" 165 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 166 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 167 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 168 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 169 | 170 | #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) 171 | # define COMPILER_ID "Fujitsu" 172 | 173 | #elif defined(__ghs__) 174 | # define COMPILER_ID "GHS" 175 | /* __GHS_VERSION_NUMBER = VVVVRP */ 176 | # ifdef __GHS_VERSION_NUMBER 177 | # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) 178 | # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) 179 | # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) 180 | # endif 181 | 182 | #elif defined(__SCO_VERSION__) 183 | # define COMPILER_ID "SCO" 184 | 185 | #elif defined(__ARMCC_VERSION) && !defined(__clang__) 186 | # define COMPILER_ID "ARMCC" 187 | #if __ARMCC_VERSION >= 1000000 188 | /* __ARMCC_VERSION = VRRPPPP */ 189 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 190 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 191 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 192 | #else 193 | /* __ARMCC_VERSION = VRPPPP */ 194 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 195 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 196 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 197 | #endif 198 | 199 | 200 | #elif defined(__clang__) && defined(__apple_build_version__) 201 | # define COMPILER_ID "AppleClang" 202 | # if defined(_MSC_VER) 203 | # define SIMULATE_ID "MSVC" 204 | # endif 205 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 206 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 207 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 208 | # if defined(_MSC_VER) 209 | /* _MSC_VER = VVRR */ 210 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 211 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 212 | # endif 213 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 214 | 215 | #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) 216 | # define COMPILER_ID "ARMClang" 217 | # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) 218 | # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) 219 | # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) 220 | # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) 221 | 222 | #elif defined(__clang__) 223 | # define COMPILER_ID "Clang" 224 | # if defined(_MSC_VER) 225 | # define SIMULATE_ID "MSVC" 226 | # endif 227 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 228 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 229 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 230 | # if defined(_MSC_VER) 231 | /* _MSC_VER = VVRR */ 232 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 233 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 234 | # endif 235 | 236 | #elif defined(__GNUC__) || defined(__GNUG__) 237 | # define COMPILER_ID "GNU" 238 | # if defined(__GNUC__) 239 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 240 | # else 241 | # define COMPILER_VERSION_MAJOR DEC(__GNUG__) 242 | # endif 243 | # if defined(__GNUC_MINOR__) 244 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 245 | # endif 246 | # if defined(__GNUC_PATCHLEVEL__) 247 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 248 | # endif 249 | 250 | #elif defined(_MSC_VER) 251 | # define COMPILER_ID "MSVC" 252 | /* _MSC_VER = VVRR */ 253 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 254 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 255 | # if defined(_MSC_FULL_VER) 256 | # if _MSC_VER >= 1400 257 | /* _MSC_FULL_VER = VVRRPPPPP */ 258 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 259 | # else 260 | /* _MSC_FULL_VER = VVRRPPPP */ 261 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 262 | # endif 263 | # endif 264 | # if defined(_MSC_BUILD) 265 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 266 | # endif 267 | 268 | #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 269 | # define COMPILER_ID "ADSP" 270 | #if defined(__VISUALDSPVERSION__) 271 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 272 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 273 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 274 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 275 | #endif 276 | 277 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 278 | # define COMPILER_ID "IAR" 279 | # if defined(__VER__) && defined(__ICCARM__) 280 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) 281 | # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) 282 | # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) 283 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 284 | # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) 285 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) 286 | # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) 287 | # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) 288 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 289 | # endif 290 | 291 | 292 | /* These compilers are either not known or too old to define an 293 | identification macro. Try to identify the platform and guess that 294 | it is the native compiler. */ 295 | #elif defined(__hpux) || defined(__hpua) 296 | # define COMPILER_ID "HP" 297 | 298 | #else /* unknown compiler */ 299 | # define COMPILER_ID "" 300 | #endif 301 | 302 | /* Construct the string literal in pieces to prevent the source from 303 | getting matched. Store it in a pointer rather than an array 304 | because some compilers will just produce instructions to fill the 305 | array rather than assigning a pointer to a static array. */ 306 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 307 | #ifdef SIMULATE_ID 308 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 309 | #endif 310 | 311 | #ifdef __QNXNTO__ 312 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 313 | #endif 314 | 315 | #if defined(__CRAYXE) || defined(__CRAYXC) 316 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 317 | #endif 318 | 319 | #define STRINGIFY_HELPER(X) #X 320 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 321 | 322 | /* Identify known platforms by name. */ 323 | #if defined(__linux) || defined(__linux__) || defined(linux) 324 | # define PLATFORM_ID "Linux" 325 | 326 | #elif defined(__CYGWIN__) 327 | # define PLATFORM_ID "Cygwin" 328 | 329 | #elif defined(__MINGW32__) 330 | # define PLATFORM_ID "MinGW" 331 | 332 | #elif defined(__APPLE__) 333 | # define PLATFORM_ID "Darwin" 334 | 335 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 336 | # define PLATFORM_ID "Windows" 337 | 338 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 339 | # define PLATFORM_ID "FreeBSD" 340 | 341 | #elif defined(__NetBSD__) || defined(__NetBSD) 342 | # define PLATFORM_ID "NetBSD" 343 | 344 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 345 | # define PLATFORM_ID "OpenBSD" 346 | 347 | #elif defined(__sun) || defined(sun) 348 | # define PLATFORM_ID "SunOS" 349 | 350 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 351 | # define PLATFORM_ID "AIX" 352 | 353 | #elif defined(__hpux) || defined(__hpux__) 354 | # define PLATFORM_ID "HP-UX" 355 | 356 | #elif defined(__HAIKU__) 357 | # define PLATFORM_ID "Haiku" 358 | 359 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 360 | # define PLATFORM_ID "BeOS" 361 | 362 | #elif defined(__QNX__) || defined(__QNXNTO__) 363 | # define PLATFORM_ID "QNX" 364 | 365 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 366 | # define PLATFORM_ID "Tru64" 367 | 368 | #elif defined(__riscos) || defined(__riscos__) 369 | # define PLATFORM_ID "RISCos" 370 | 371 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 372 | # define PLATFORM_ID "SINIX" 373 | 374 | #elif defined(__UNIX_SV__) 375 | # define PLATFORM_ID "UNIX_SV" 376 | 377 | #elif defined(__bsdos__) 378 | # define PLATFORM_ID "BSDOS" 379 | 380 | #elif defined(_MPRAS) || defined(MPRAS) 381 | # define PLATFORM_ID "MP-RAS" 382 | 383 | #elif defined(__osf) || defined(__osf__) 384 | # define PLATFORM_ID "OSF1" 385 | 386 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 387 | # define PLATFORM_ID "SCO_SV" 388 | 389 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 390 | # define PLATFORM_ID "ULTRIX" 391 | 392 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 393 | # define PLATFORM_ID "Xenix" 394 | 395 | #elif defined(__WATCOMC__) 396 | # if defined(__LINUX__) 397 | # define PLATFORM_ID "Linux" 398 | 399 | # elif defined(__DOS__) 400 | # define PLATFORM_ID "DOS" 401 | 402 | # elif defined(__OS2__) 403 | # define PLATFORM_ID "OS2" 404 | 405 | # elif defined(__WINDOWS__) 406 | # define PLATFORM_ID "Windows3x" 407 | 408 | # else /* unknown platform */ 409 | # define PLATFORM_ID 410 | # endif 411 | 412 | #elif defined(__INTEGRITY) 413 | # if defined(INT_178B) 414 | # define PLATFORM_ID "Integrity178" 415 | 416 | # else /* regular Integrity */ 417 | # define PLATFORM_ID "Integrity" 418 | # endif 419 | 420 | #else /* unknown platform */ 421 | # define PLATFORM_ID 422 | 423 | #endif 424 | 425 | /* For windows compilers MSVC and Intel we can determine 426 | the architecture of the compiler being used. This is because 427 | the compilers do not have flags that can change the architecture, 428 | but rather depend on which compiler is being used 429 | */ 430 | #if defined(_WIN32) && defined(_MSC_VER) 431 | # if defined(_M_IA64) 432 | # define ARCHITECTURE_ID "IA64" 433 | 434 | # elif defined(_M_X64) || defined(_M_AMD64) 435 | # define ARCHITECTURE_ID "x64" 436 | 437 | # elif defined(_M_IX86) 438 | # define ARCHITECTURE_ID "X86" 439 | 440 | # elif defined(_M_ARM64) 441 | # define ARCHITECTURE_ID "ARM64" 442 | 443 | # elif defined(_M_ARM) 444 | # if _M_ARM == 4 445 | # define ARCHITECTURE_ID "ARMV4I" 446 | # elif _M_ARM == 5 447 | # define ARCHITECTURE_ID "ARMV5I" 448 | # else 449 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 450 | # endif 451 | 452 | # elif defined(_M_MIPS) 453 | # define ARCHITECTURE_ID "MIPS" 454 | 455 | # elif defined(_M_SH) 456 | # define ARCHITECTURE_ID "SHx" 457 | 458 | # else /* unknown architecture */ 459 | # define ARCHITECTURE_ID "" 460 | # endif 461 | 462 | #elif defined(__WATCOMC__) 463 | # if defined(_M_I86) 464 | # define ARCHITECTURE_ID "I86" 465 | 466 | # elif defined(_M_IX86) 467 | # define ARCHITECTURE_ID "X86" 468 | 469 | # else /* unknown architecture */ 470 | # define ARCHITECTURE_ID "" 471 | # endif 472 | 473 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 474 | # if defined(__ICCARM__) 475 | # define ARCHITECTURE_ID "ARM" 476 | 477 | # elif defined(__ICCRX__) 478 | # define ARCHITECTURE_ID "RX" 479 | 480 | # elif defined(__ICCRH850__) 481 | # define ARCHITECTURE_ID "RH850" 482 | 483 | # elif defined(__ICCRL78__) 484 | # define ARCHITECTURE_ID "RL78" 485 | 486 | # elif defined(__ICCRISCV__) 487 | # define ARCHITECTURE_ID "RISCV" 488 | 489 | # elif defined(__ICCAVR__) 490 | # define ARCHITECTURE_ID "AVR" 491 | 492 | # elif defined(__ICC430__) 493 | # define ARCHITECTURE_ID "MSP430" 494 | 495 | # elif defined(__ICCV850__) 496 | # define ARCHITECTURE_ID "V850" 497 | 498 | # elif defined(__ICC8051__) 499 | # define ARCHITECTURE_ID "8051" 500 | 501 | # else /* unknown architecture */ 502 | # define ARCHITECTURE_ID "" 503 | # endif 504 | 505 | #elif defined(__ghs__) 506 | # if defined(__PPC64__) 507 | # define ARCHITECTURE_ID "PPC64" 508 | 509 | # elif defined(__ppc__) 510 | # define ARCHITECTURE_ID "PPC" 511 | 512 | # elif defined(__ARM__) 513 | # define ARCHITECTURE_ID "ARM" 514 | 515 | # elif defined(__x86_64__) 516 | # define ARCHITECTURE_ID "x64" 517 | 518 | # elif defined(__i386__) 519 | # define ARCHITECTURE_ID "X86" 520 | 521 | # else /* unknown architecture */ 522 | # define ARCHITECTURE_ID "" 523 | # endif 524 | #else 525 | # define ARCHITECTURE_ID 526 | #endif 527 | 528 | /* Convert integer to decimal digit literals. */ 529 | #define DEC(n) \ 530 | ('0' + (((n) / 10000000)%10)), \ 531 | ('0' + (((n) / 1000000)%10)), \ 532 | ('0' + (((n) / 100000)%10)), \ 533 | ('0' + (((n) / 10000)%10)), \ 534 | ('0' + (((n) / 1000)%10)), \ 535 | ('0' + (((n) / 100)%10)), \ 536 | ('0' + (((n) / 10)%10)), \ 537 | ('0' + ((n) % 10)) 538 | 539 | /* Convert integer to hex digit literals. */ 540 | #define HEX(n) \ 541 | ('0' + ((n)>>28 & 0xF)), \ 542 | ('0' + ((n)>>24 & 0xF)), \ 543 | ('0' + ((n)>>20 & 0xF)), \ 544 | ('0' + ((n)>>16 & 0xF)), \ 545 | ('0' + ((n)>>12 & 0xF)), \ 546 | ('0' + ((n)>>8 & 0xF)), \ 547 | ('0' + ((n)>>4 & 0xF)), \ 548 | ('0' + ((n) & 0xF)) 549 | 550 | /* Construct a string literal encoding the version number components. */ 551 | #ifdef COMPILER_VERSION_MAJOR 552 | char const info_version[] = { 553 | 'I', 'N', 'F', 'O', ':', 554 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 555 | COMPILER_VERSION_MAJOR, 556 | # ifdef COMPILER_VERSION_MINOR 557 | '.', COMPILER_VERSION_MINOR, 558 | # ifdef COMPILER_VERSION_PATCH 559 | '.', COMPILER_VERSION_PATCH, 560 | # ifdef COMPILER_VERSION_TWEAK 561 | '.', COMPILER_VERSION_TWEAK, 562 | # endif 563 | # endif 564 | # endif 565 | ']','\0'}; 566 | #endif 567 | 568 | /* Construct a string literal encoding the internal version number. */ 569 | #ifdef COMPILER_VERSION_INTERNAL 570 | char const info_version_internal[] = { 571 | 'I', 'N', 'F', 'O', ':', 572 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 573 | 'i','n','t','e','r','n','a','l','[', 574 | COMPILER_VERSION_INTERNAL,']','\0'}; 575 | #endif 576 | 577 | /* Construct a string literal encoding the version number components. */ 578 | #ifdef SIMULATE_VERSION_MAJOR 579 | char const info_simulate_version[] = { 580 | 'I', 'N', 'F', 'O', ':', 581 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 582 | SIMULATE_VERSION_MAJOR, 583 | # ifdef SIMULATE_VERSION_MINOR 584 | '.', SIMULATE_VERSION_MINOR, 585 | # ifdef SIMULATE_VERSION_PATCH 586 | '.', SIMULATE_VERSION_PATCH, 587 | # ifdef SIMULATE_VERSION_TWEAK 588 | '.', SIMULATE_VERSION_TWEAK, 589 | # endif 590 | # endif 591 | # endif 592 | ']','\0'}; 593 | #endif 594 | 595 | /* Construct the string literal in pieces to prevent the source from 596 | getting matched. Store it in a pointer rather than an array 597 | because some compilers will just produce instructions to fill the 598 | array rather than assigning a pointer to a static array. */ 599 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 600 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 601 | 602 | 603 | 604 | 605 | #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L 606 | # if defined(__INTEL_CXX11_MODE__) 607 | # if defined(__cpp_aggregate_nsdmi) 608 | # define CXX_STD 201402L 609 | # else 610 | # define CXX_STD 201103L 611 | # endif 612 | # else 613 | # define CXX_STD 199711L 614 | # endif 615 | #elif defined(_MSC_VER) && defined(_MSVC_LANG) 616 | # define CXX_STD _MSVC_LANG 617 | #else 618 | # define CXX_STD __cplusplus 619 | #endif 620 | 621 | const char* info_language_dialect_default = "INFO" ":" "dialect_default[" 622 | #if CXX_STD > 201703L 623 | "20" 624 | #elif CXX_STD >= 201703L 625 | "17" 626 | #elif CXX_STD >= 201402L 627 | "14" 628 | #elif CXX_STD >= 201103L 629 | "11" 630 | #else 631 | "98" 632 | #endif 633 | "]"; 634 | 635 | /*--------------------------------------------------------------------------*/ 636 | 637 | int main(int argc, char* argv[]) 638 | { 639 | int require = 0; 640 | require += info_compiler[argc]; 641 | require += info_platform[argc]; 642 | #ifdef COMPILER_VERSION_MAJOR 643 | require += info_version[argc]; 644 | #endif 645 | #ifdef COMPILER_VERSION_INTERNAL 646 | require += info_version_internal[argc]; 647 | #endif 648 | #ifdef SIMULATE_ID 649 | require += info_simulate[argc]; 650 | #endif 651 | #ifdef SIMULATE_VERSION_MAJOR 652 | require += info_simulate_version[argc]; 653 | #endif 654 | #if defined(__CRAYXE) || defined(__CRAYXC) 655 | require += info_cray[argc]; 656 | #endif 657 | require += info_language_dialect_default[argc]; 658 | (void)argv; 659 | return require; 660 | } 661 | -------------------------------------------------------------------------------- /repvgg_tensorrt_int8/build/CMakeFiles/3.17.3/CompilerIdC/CMakeCCompilerId.c: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | # error "A C++ compiler has been selected for C." 3 | #endif 4 | 5 | #if defined(__18CXX) 6 | # define ID_VOID_MAIN 7 | #endif 8 | #if defined(__CLASSIC_C__) 9 | /* cv-qualifiers did not exist in K&R C */ 10 | # define const 11 | # define volatile 12 | #endif 13 | 14 | 15 | /* Version number components: V=Version, R=Revision, P=Patch 16 | Version date components: YYYY=Year, MM=Month, DD=Day */ 17 | 18 | #if defined(__INTEL_COMPILER) || defined(__ICC) 19 | # define COMPILER_ID "Intel" 20 | # if defined(_MSC_VER) 21 | # define SIMULATE_ID "MSVC" 22 | # endif 23 | # if defined(__GNUC__) 24 | # define SIMULATE_ID "GNU" 25 | # endif 26 | /* __INTEL_COMPILER = VRP */ 27 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 28 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 29 | # if defined(__INTEL_COMPILER_UPDATE) 30 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 31 | # else 32 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 33 | # endif 34 | # if defined(__INTEL_COMPILER_BUILD_DATE) 35 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 36 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 37 | # endif 38 | # if defined(_MSC_VER) 39 | /* _MSC_VER = VVRR */ 40 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 41 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 42 | # endif 43 | # if defined(__GNUC__) 44 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 45 | # elif defined(__GNUG__) 46 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 47 | # endif 48 | # if defined(__GNUC_MINOR__) 49 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 50 | # endif 51 | # if defined(__GNUC_PATCHLEVEL__) 52 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 53 | # endif 54 | 55 | #elif defined(__PATHCC__) 56 | # define COMPILER_ID "PathScale" 57 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 58 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 59 | # if defined(__PATHCC_PATCHLEVEL__) 60 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 61 | # endif 62 | 63 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 64 | # define COMPILER_ID "Embarcadero" 65 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 66 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 67 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 68 | 69 | #elif defined(__BORLANDC__) 70 | # define COMPILER_ID "Borland" 71 | /* __BORLANDC__ = 0xVRR */ 72 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 73 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 74 | 75 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 76 | # define COMPILER_ID "Watcom" 77 | /* __WATCOMC__ = VVRR */ 78 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 79 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 80 | # if (__WATCOMC__ % 10) > 0 81 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 82 | # endif 83 | 84 | #elif defined(__WATCOMC__) 85 | # define COMPILER_ID "OpenWatcom" 86 | /* __WATCOMC__ = VVRP + 1100 */ 87 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 88 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 89 | # if (__WATCOMC__ % 10) > 0 90 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 91 | # endif 92 | 93 | #elif defined(__SUNPRO_C) 94 | # define COMPILER_ID "SunPro" 95 | # if __SUNPRO_C >= 0x5100 96 | /* __SUNPRO_C = 0xVRRP */ 97 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) 98 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) 99 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 100 | # else 101 | /* __SUNPRO_CC = 0xVRP */ 102 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) 103 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) 104 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) 105 | # endif 106 | 107 | #elif defined(__HP_cc) 108 | # define COMPILER_ID "HP" 109 | /* __HP_cc = VVRRPP */ 110 | # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) 111 | # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) 112 | # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) 113 | 114 | #elif defined(__DECC) 115 | # define COMPILER_ID "Compaq" 116 | /* __DECC_VER = VVRRTPPPP */ 117 | # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) 118 | # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) 119 | # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) 120 | 121 | #elif defined(__IBMC__) && defined(__COMPILER_VER__) 122 | # define COMPILER_ID "zOS" 123 | /* __IBMC__ = VRP */ 124 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 125 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 126 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 127 | 128 | #elif defined(__ibmxl__) && defined(__clang__) 129 | # define COMPILER_ID "XLClang" 130 | # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) 131 | # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) 132 | # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) 133 | # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) 134 | 135 | 136 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 137 | # define COMPILER_ID "XL" 138 | /* __IBMC__ = VRP */ 139 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 140 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 141 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 142 | 143 | #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 144 | # define COMPILER_ID "VisualAge" 145 | /* __IBMC__ = VRP */ 146 | # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) 147 | # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) 148 | # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) 149 | 150 | #elif defined(__PGI) 151 | # define COMPILER_ID "PGI" 152 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 153 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 154 | # if defined(__PGIC_PATCHLEVEL__) 155 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 156 | # endif 157 | 158 | #elif defined(_CRAYC) 159 | # define COMPILER_ID "Cray" 160 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 161 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 162 | 163 | #elif defined(__TI_COMPILER_VERSION__) 164 | # define COMPILER_ID "TI" 165 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 166 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 167 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 168 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 169 | 170 | #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) 171 | # define COMPILER_ID "Fujitsu" 172 | 173 | #elif defined(__ghs__) 174 | # define COMPILER_ID "GHS" 175 | /* __GHS_VERSION_NUMBER = VVVVRP */ 176 | # ifdef __GHS_VERSION_NUMBER 177 | # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) 178 | # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) 179 | # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) 180 | # endif 181 | 182 | #elif defined(__TINYC__) 183 | # define COMPILER_ID "TinyCC" 184 | 185 | #elif defined(__BCC__) 186 | # define COMPILER_ID "Bruce" 187 | 188 | #elif defined(__SCO_VERSION__) 189 | # define COMPILER_ID "SCO" 190 | 191 | #elif defined(__ARMCC_VERSION) && !defined(__clang__) 192 | # define COMPILER_ID "ARMCC" 193 | #if __ARMCC_VERSION >= 1000000 194 | /* __ARMCC_VERSION = VRRPPPP */ 195 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 196 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 197 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 198 | #else 199 | /* __ARMCC_VERSION = VRPPPP */ 200 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 201 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 202 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 203 | #endif 204 | 205 | 206 | #elif defined(__clang__) && defined(__apple_build_version__) 207 | # define COMPILER_ID "AppleClang" 208 | # if defined(_MSC_VER) 209 | # define SIMULATE_ID "MSVC" 210 | # endif 211 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 212 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 213 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 214 | # if defined(_MSC_VER) 215 | /* _MSC_VER = VVRR */ 216 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 217 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 218 | # endif 219 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 220 | 221 | #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) 222 | # define COMPILER_ID "ARMClang" 223 | # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) 224 | # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) 225 | # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) 226 | # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) 227 | 228 | #elif defined(__clang__) 229 | # define COMPILER_ID "Clang" 230 | # if defined(_MSC_VER) 231 | # define SIMULATE_ID "MSVC" 232 | # endif 233 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 234 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 235 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 236 | # if defined(_MSC_VER) 237 | /* _MSC_VER = VVRR */ 238 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 239 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 240 | # endif 241 | 242 | #elif defined(__GNUC__) 243 | # define COMPILER_ID "GNU" 244 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 245 | # if defined(__GNUC_MINOR__) 246 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 247 | # endif 248 | # if defined(__GNUC_PATCHLEVEL__) 249 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 250 | # endif 251 | 252 | #elif defined(_MSC_VER) 253 | # define COMPILER_ID "MSVC" 254 | /* _MSC_VER = VVRR */ 255 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 256 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 257 | # if defined(_MSC_FULL_VER) 258 | # if _MSC_VER >= 1400 259 | /* _MSC_FULL_VER = VVRRPPPPP */ 260 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 261 | # else 262 | /* _MSC_FULL_VER = VVRRPPPP */ 263 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 264 | # endif 265 | # endif 266 | # if defined(_MSC_BUILD) 267 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 268 | # endif 269 | 270 | #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 271 | # define COMPILER_ID "ADSP" 272 | #if defined(__VISUALDSPVERSION__) 273 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 274 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 275 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 276 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 277 | #endif 278 | 279 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 280 | # define COMPILER_ID "IAR" 281 | # if defined(__VER__) && defined(__ICCARM__) 282 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) 283 | # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) 284 | # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) 285 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 286 | # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) 287 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) 288 | # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) 289 | # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) 290 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 291 | # endif 292 | 293 | #elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) 294 | # define COMPILER_ID "SDCC" 295 | # if defined(__SDCC_VERSION_MAJOR) 296 | # define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) 297 | # define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) 298 | # define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) 299 | # else 300 | /* SDCC = VRP */ 301 | # define COMPILER_VERSION_MAJOR DEC(SDCC/100) 302 | # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) 303 | # define COMPILER_VERSION_PATCH DEC(SDCC % 10) 304 | # endif 305 | 306 | 307 | /* These compilers are either not known or too old to define an 308 | identification macro. Try to identify the platform and guess that 309 | it is the native compiler. */ 310 | #elif defined(__hpux) || defined(__hpua) 311 | # define COMPILER_ID "HP" 312 | 313 | #else /* unknown compiler */ 314 | # define COMPILER_ID "" 315 | #endif 316 | 317 | /* Construct the string literal in pieces to prevent the source from 318 | getting matched. Store it in a pointer rather than an array 319 | because some compilers will just produce instructions to fill the 320 | array rather than assigning a pointer to a static array. */ 321 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 322 | #ifdef SIMULATE_ID 323 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 324 | #endif 325 | 326 | #ifdef __QNXNTO__ 327 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 328 | #endif 329 | 330 | #if defined(__CRAYXE) || defined(__CRAYXC) 331 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 332 | #endif 333 | 334 | #define STRINGIFY_HELPER(X) #X 335 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 336 | 337 | /* Identify known platforms by name. */ 338 | #if defined(__linux) || defined(__linux__) || defined(linux) 339 | # define PLATFORM_ID "Linux" 340 | 341 | #elif defined(__CYGWIN__) 342 | # define PLATFORM_ID "Cygwin" 343 | 344 | #elif defined(__MINGW32__) 345 | # define PLATFORM_ID "MinGW" 346 | 347 | #elif defined(__APPLE__) 348 | # define PLATFORM_ID "Darwin" 349 | 350 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 351 | # define PLATFORM_ID "Windows" 352 | 353 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 354 | # define PLATFORM_ID "FreeBSD" 355 | 356 | #elif defined(__NetBSD__) || defined(__NetBSD) 357 | # define PLATFORM_ID "NetBSD" 358 | 359 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 360 | # define PLATFORM_ID "OpenBSD" 361 | 362 | #elif defined(__sun) || defined(sun) 363 | # define PLATFORM_ID "SunOS" 364 | 365 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 366 | # define PLATFORM_ID "AIX" 367 | 368 | #elif defined(__hpux) || defined(__hpux__) 369 | # define PLATFORM_ID "HP-UX" 370 | 371 | #elif defined(__HAIKU__) 372 | # define PLATFORM_ID "Haiku" 373 | 374 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 375 | # define PLATFORM_ID "BeOS" 376 | 377 | #elif defined(__QNX__) || defined(__QNXNTO__) 378 | # define PLATFORM_ID "QNX" 379 | 380 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 381 | # define PLATFORM_ID "Tru64" 382 | 383 | #elif defined(__riscos) || defined(__riscos__) 384 | # define PLATFORM_ID "RISCos" 385 | 386 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 387 | # define PLATFORM_ID "SINIX" 388 | 389 | #elif defined(__UNIX_SV__) 390 | # define PLATFORM_ID "UNIX_SV" 391 | 392 | #elif defined(__bsdos__) 393 | # define PLATFORM_ID "BSDOS" 394 | 395 | #elif defined(_MPRAS) || defined(MPRAS) 396 | # define PLATFORM_ID "MP-RAS" 397 | 398 | #elif defined(__osf) || defined(__osf__) 399 | # define PLATFORM_ID "OSF1" 400 | 401 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 402 | # define PLATFORM_ID "SCO_SV" 403 | 404 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 405 | # define PLATFORM_ID "ULTRIX" 406 | 407 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 408 | # define PLATFORM_ID "Xenix" 409 | 410 | #elif defined(__WATCOMC__) 411 | # if defined(__LINUX__) 412 | # define PLATFORM_ID "Linux" 413 | 414 | # elif defined(__DOS__) 415 | # define PLATFORM_ID "DOS" 416 | 417 | # elif defined(__OS2__) 418 | # define PLATFORM_ID "OS2" 419 | 420 | # elif defined(__WINDOWS__) 421 | # define PLATFORM_ID "Windows3x" 422 | 423 | # else /* unknown platform */ 424 | # define PLATFORM_ID 425 | # endif 426 | 427 | #elif defined(__INTEGRITY) 428 | # if defined(INT_178B) 429 | # define PLATFORM_ID "Integrity178" 430 | 431 | # else /* regular Integrity */ 432 | # define PLATFORM_ID "Integrity" 433 | # endif 434 | 435 | #else /* unknown platform */ 436 | # define PLATFORM_ID 437 | 438 | #endif 439 | 440 | /* For windows compilers MSVC and Intel we can determine 441 | the architecture of the compiler being used. This is because 442 | the compilers do not have flags that can change the architecture, 443 | but rather depend on which compiler is being used 444 | */ 445 | #if defined(_WIN32) && defined(_MSC_VER) 446 | # if defined(_M_IA64) 447 | # define ARCHITECTURE_ID "IA64" 448 | 449 | # elif defined(_M_X64) || defined(_M_AMD64) 450 | # define ARCHITECTURE_ID "x64" 451 | 452 | # elif defined(_M_IX86) 453 | # define ARCHITECTURE_ID "X86" 454 | 455 | # elif defined(_M_ARM64) 456 | # define ARCHITECTURE_ID "ARM64" 457 | 458 | # elif defined(_M_ARM) 459 | # if _M_ARM == 4 460 | # define ARCHITECTURE_ID "ARMV4I" 461 | # elif _M_ARM == 5 462 | # define ARCHITECTURE_ID "ARMV5I" 463 | # else 464 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 465 | # endif 466 | 467 | # elif defined(_M_MIPS) 468 | # define ARCHITECTURE_ID "MIPS" 469 | 470 | # elif defined(_M_SH) 471 | # define ARCHITECTURE_ID "SHx" 472 | 473 | # else /* unknown architecture */ 474 | # define ARCHITECTURE_ID "" 475 | # endif 476 | 477 | #elif defined(__WATCOMC__) 478 | # if defined(_M_I86) 479 | # define ARCHITECTURE_ID "I86" 480 | 481 | # elif defined(_M_IX86) 482 | # define ARCHITECTURE_ID "X86" 483 | 484 | # else /* unknown architecture */ 485 | # define ARCHITECTURE_ID "" 486 | # endif 487 | 488 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 489 | # if defined(__ICCARM__) 490 | # define ARCHITECTURE_ID "ARM" 491 | 492 | # elif defined(__ICCRX__) 493 | # define ARCHITECTURE_ID "RX" 494 | 495 | # elif defined(__ICCRH850__) 496 | # define ARCHITECTURE_ID "RH850" 497 | 498 | # elif defined(__ICCRL78__) 499 | # define ARCHITECTURE_ID "RL78" 500 | 501 | # elif defined(__ICCRISCV__) 502 | # define ARCHITECTURE_ID "RISCV" 503 | 504 | # elif defined(__ICCAVR__) 505 | # define ARCHITECTURE_ID "AVR" 506 | 507 | # elif defined(__ICC430__) 508 | # define ARCHITECTURE_ID "MSP430" 509 | 510 | # elif defined(__ICCV850__) 511 | # define ARCHITECTURE_ID "V850" 512 | 513 | # elif defined(__ICC8051__) 514 | # define ARCHITECTURE_ID "8051" 515 | 516 | # else /* unknown architecture */ 517 | # define ARCHITECTURE_ID "" 518 | # endif 519 | 520 | #elif defined(__ghs__) 521 | # if defined(__PPC64__) 522 | # define ARCHITECTURE_ID "PPC64" 523 | 524 | # elif defined(__ppc__) 525 | # define ARCHITECTURE_ID "PPC" 526 | 527 | # elif defined(__ARM__) 528 | # define ARCHITECTURE_ID "ARM" 529 | 530 | # elif defined(__x86_64__) 531 | # define ARCHITECTURE_ID "x64" 532 | 533 | # elif defined(__i386__) 534 | # define ARCHITECTURE_ID "X86" 535 | 536 | # else /* unknown architecture */ 537 | # define ARCHITECTURE_ID "" 538 | # endif 539 | #else 540 | # define ARCHITECTURE_ID 541 | #endif 542 | 543 | /* Convert integer to decimal digit literals. */ 544 | #define DEC(n) \ 545 | ('0' + (((n) / 10000000)%10)), \ 546 | ('0' + (((n) / 1000000)%10)), \ 547 | ('0' + (((n) / 100000)%10)), \ 548 | ('0' + (((n) / 10000)%10)), \ 549 | ('0' + (((n) / 1000)%10)), \ 550 | ('0' + (((n) / 100)%10)), \ 551 | ('0' + (((n) / 10)%10)), \ 552 | ('0' + ((n) % 10)) 553 | 554 | /* Convert integer to hex digit literals. */ 555 | #define HEX(n) \ 556 | ('0' + ((n)>>28 & 0xF)), \ 557 | ('0' + ((n)>>24 & 0xF)), \ 558 | ('0' + ((n)>>20 & 0xF)), \ 559 | ('0' + ((n)>>16 & 0xF)), \ 560 | ('0' + ((n)>>12 & 0xF)), \ 561 | ('0' + ((n)>>8 & 0xF)), \ 562 | ('0' + ((n)>>4 & 0xF)), \ 563 | ('0' + ((n) & 0xF)) 564 | 565 | /* Construct a string literal encoding the version number components. */ 566 | #ifdef COMPILER_VERSION_MAJOR 567 | char const info_version[] = { 568 | 'I', 'N', 'F', 'O', ':', 569 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 570 | COMPILER_VERSION_MAJOR, 571 | # ifdef COMPILER_VERSION_MINOR 572 | '.', COMPILER_VERSION_MINOR, 573 | # ifdef COMPILER_VERSION_PATCH 574 | '.', COMPILER_VERSION_PATCH, 575 | # ifdef COMPILER_VERSION_TWEAK 576 | '.', COMPILER_VERSION_TWEAK, 577 | # endif 578 | # endif 579 | # endif 580 | ']','\0'}; 581 | #endif 582 | 583 | /* Construct a string literal encoding the internal version number. */ 584 | #ifdef COMPILER_VERSION_INTERNAL 585 | char const info_version_internal[] = { 586 | 'I', 'N', 'F', 'O', ':', 587 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 588 | 'i','n','t','e','r','n','a','l','[', 589 | COMPILER_VERSION_INTERNAL,']','\0'}; 590 | #endif 591 | 592 | /* Construct a string literal encoding the version number components. */ 593 | #ifdef SIMULATE_VERSION_MAJOR 594 | char const info_simulate_version[] = { 595 | 'I', 'N', 'F', 'O', ':', 596 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 597 | SIMULATE_VERSION_MAJOR, 598 | # ifdef SIMULATE_VERSION_MINOR 599 | '.', SIMULATE_VERSION_MINOR, 600 | # ifdef SIMULATE_VERSION_PATCH 601 | '.', SIMULATE_VERSION_PATCH, 602 | # ifdef SIMULATE_VERSION_TWEAK 603 | '.', SIMULATE_VERSION_TWEAK, 604 | # endif 605 | # endif 606 | # endif 607 | ']','\0'}; 608 | #endif 609 | 610 | /* Construct the string literal in pieces to prevent the source from 611 | getting matched. Store it in a pointer rather than an array 612 | because some compilers will just produce instructions to fill the 613 | array rather than assigning a pointer to a static array. */ 614 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 615 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 616 | 617 | 618 | 619 | 620 | #if !defined(__STDC__) 621 | # if (defined(_MSC_VER) && !defined(__clang__)) \ 622 | || (defined(__ibmxl__) || defined(__IBMC__)) 623 | # define C_DIALECT "90" 624 | # else 625 | # define C_DIALECT 626 | # endif 627 | #elif __STDC_VERSION__ >= 201000L 628 | # define C_DIALECT "11" 629 | #elif __STDC_VERSION__ >= 199901L 630 | # define C_DIALECT "99" 631 | #else 632 | # define C_DIALECT "90" 633 | #endif 634 | const char* info_language_dialect_default = 635 | "INFO" ":" "dialect_default[" C_DIALECT "]"; 636 | 637 | /*--------------------------------------------------------------------------*/ 638 | 639 | #ifdef ID_VOID_MAIN 640 | void main() {} 641 | #else 642 | # if defined(__CLASSIC_C__) 643 | int main(argc, argv) int argc; char *argv[]; 644 | # else 645 | int main(int argc, char* argv[]) 646 | # endif 647 | { 648 | int require = 0; 649 | require += info_compiler[argc]; 650 | require += info_platform[argc]; 651 | require += info_arch[argc]; 652 | #ifdef COMPILER_VERSION_MAJOR 653 | require += info_version[argc]; 654 | #endif 655 | #ifdef COMPILER_VERSION_INTERNAL 656 | require += info_version_internal[argc]; 657 | #endif 658 | #ifdef SIMULATE_ID 659 | require += info_simulate[argc]; 660 | #endif 661 | #ifdef SIMULATE_VERSION_MAJOR 662 | require += info_simulate_version[argc]; 663 | #endif 664 | #if defined(__CRAYXE) || defined(__CRAYXC) 665 | require += info_cray[argc]; 666 | #endif 667 | require += info_language_dialect_default[argc]; 668 | (void)argv; 669 | return require; 670 | } 671 | #endif 672 | --------------------------------------------------------------------------------