diff options
-rw-r--r-- | Android.bp | 92 | ||||
-rw-r--r-- | METADATA | 19 | ||||
-rw-r--r-- | MODULE_LICENSE_BSD | 0 | ||||
-rw-r--r-- | OWNERS | 11 | ||||
-rw-r--r-- | deps/clog/Android.bp | 30 | ||||
-rw-r--r-- | deps/clog/jni/Android.mk | 17 | ||||
-rw-r--r-- | deps/clog/jni/Application.mk | 3 | ||||
-rw-r--r-- | jni/Android.mk | 66 | ||||
-rw-r--r-- | jni/Application.mk | 4 |
9 files changed, 152 insertions, 90 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..dcec23e --- /dev/null +++ b/Android.bp @@ -0,0 +1,92 @@ +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +cpuinfo_arm_common_src_files = [ + "src/arm/uarch.c", + "src/arm/cache.c", + "src/arm/linux/init.c", + "src/arm/linux/cpuinfo.c", + "src/arm/linux/clusters.c", + "src/arm/linux/chipset.c", + "src/arm/linux/midr.c", + "src/arm/linux/hwcap.c", + "src/arm/android/properties.c", +] + +cpuinfo_x86_common_src_files = [ + "src/x86/init.c", + "src/x86/info.c", + "src/x86/name.c", + "src/x86/isa.c", + "src/x86/vendor.c", + "src/x86/uarch.c", + "src/x86/topology.c", + "src/x86/cache/init.c", + "src/x86/cache/descriptor.c", + "src/x86/cache/deterministic.c", + "src/x86/linux/cpuinfo.c", + "src/x86/linux/init.c", +] + +cc_library_static { + name: "libcpuinfo", + export_include_dirs: ["include"], + vendor_available: true, + sdk_version: "current", + local_include_dirs: [ + "src", + ], + srcs: [ + "src/init.c", + "src/api.c", + "src/cache.c", + "src/linux/processors.c", + "src/linux/smallfile.c", + "src/linux/multiline.c", + "src/linux/cpulist.c", + ], + arch: { + arm: { + srcs: cpuinfo_arm_common_src_files + [ + "src/arm/linux/aarch32-isa.c", + ], + cflags: [ + "-mcpu=generic", + "-march=armv7-a", + ], + }, + arm64: { + srcs: cpuinfo_arm_common_src_files + [ + "src/arm/linux/aarch64-isa.c", + ], + }, + x86: { + srcs: cpuinfo_x86_common_src_files, + }, + x86_64: { + srcs: cpuinfo_x86_common_src_files, + }, + }, + cflags: [ + "-std=c99", + "-Oz", + "-D_GNU_SOURCE=1", + "-Wno-unused-function", + "-Wno-unused-parameter", + "-Wno-missing-field-initializers", + ], + whole_static_libs: [ + "libclog", + ], +} diff --git a/METADATA b/METADATA new file mode 100644 index 0000000..909e4ef --- /dev/null +++ b/METADATA @@ -0,0 +1,19 @@ +name: "cpuinfo" +description: "cpuinfo is a library to detect essential for performance optimization information about host CPU." +third_party { + url { + type: HOMEPAGE + value: "https://github.com/pytorch/cpuinfo" + } + url { + type: GIT + value: "https://github.com/pytorch/cpuinfo" + } + version: "5916273f79a21551890fd3d56fc5375a78d1598d" + license_type: NOTICE + last_upgrade_date { + year: 2020 + month: 12 + day: 22 + } +} diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/MODULE_LICENSE_BSD @@ -0,0 +1,11 @@ +butlermichael@google.com +dgross@google.com +galarragas@google.com +jeanluc@google.com +levp@google.com +maratek@google.com +miaowang@google.com +pszczepaniak@google.com +slavash@google.com +vddang@google.com +xusongw@google.com diff --git a/deps/clog/Android.bp b/deps/clog/Android.bp new file mode 100644 index 0000000..31cab00 --- /dev/null +++ b/deps/clog/Android.bp @@ -0,0 +1,30 @@ +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +cc_library_static { + name: "libclog", + export_include_dirs: ["include"], + vendor_available: true, + sdk_version: "current", + srcs: [ + "src/clog.c", + ], + cflags: [ + "-std=c99", + "-Oz", + ], + shared_libs: [ + "liblog", + ] +} diff --git a/deps/clog/jni/Android.mk b/deps/clog/jni/Android.mk deleted file mode 100644 index f7afb6d..0000000 --- a/deps/clog/jni/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH := $(call my-dir)/.. - -include $(CLEAR_VARS) -LOCAL_MODULE := clog -LOCAL_SRC_FILES := src/clog.c -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDES) -LOCAL_CFLAGS := -std=c99 -Wall -ifeq (,$(findstring 4.9,$(NDK_TOOLCHAIN))) -# Clang compiler supports -Oz -LOCAL_CFLAGS += -Oz -else -# gcc-4.9 compiler supports only -Os -LOCAL_CFLAGS += -Os -endif -LOCAL_EXPORT_LDLIBS := -llog -include $(BUILD_STATIC_LIBRARY) diff --git a/deps/clog/jni/Application.mk b/deps/clog/jni/Application.mk deleted file mode 100644 index 27c8015..0000000 --- a/deps/clog/jni/Application.mk +++ /dev/null @@ -1,3 +0,0 @@ -APP_PLATFORM := android-15 -APP_PIE := true -APP_ABI := all diff --git a/jni/Android.mk b/jni/Android.mk deleted file mode 100644 index 2212625..0000000 --- a/jni/Android.mk +++ /dev/null @@ -1,66 +0,0 @@ -LOCAL_PATH := $(call my-dir)/.. - -include $(CLEAR_VARS) -LOCAL_MODULE := cpuinfo -LOCAL_SRC_FILES := \ - src/init.c \ - src/api.c \ - src/cache.c \ - src/linux/processors.c \ - src/linux/smallfile.c \ - src/linux/multiline.c \ - src/linux/cpulist.c -ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI),armeabi-v7a arm64-v8a)) -LOCAL_SRC_FILES += \ - src/arm/uarch.c \ - src/arm/cache.c \ - src/arm/linux/init.c \ - src/arm/linux/cpuinfo.c \ - src/arm/linux/clusters.c \ - src/arm/linux/chipset.c \ - src/arm/linux/midr.c \ - src/arm/linux/hwcap.c \ - src/arm/android/properties.c -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) -LOCAL_SRC_FILES += src/arm/linux/aarch32-isa.c -endif # armeabi-v7a -ifeq ($(TARGET_ARCH_ABI),arm64-v8a) -LOCAL_SRC_FILES += src/arm/linux/aarch64-isa.c -endif # arm64-v8a -endif # armeabi-v7a, or arm64-v8a -ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI),x86 x86_64)) -LOCAL_SRC_FILES += \ - src/x86/init.c \ - src/x86/info.c \ - src/x86/name.c \ - src/x86/isa.c \ - src/x86/vendor.c \ - src/x86/uarch.c \ - src/x86/topology.c \ - src/x86/cache/init.c \ - src/x86/cache/descriptor.c \ - src/x86/cache/deterministic.c \ - src/x86/linux/cpuinfo.c \ - src/x86/linux/init.c -endif # x86 or x86_64 -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_C_INCLUDES := $(LOCAL_EXPORT_C_INCLUDES) $(LOCAL_PATH)/src -LOCAL_CFLAGS := -std=c99 -Wall -D_GNU_SOURCE=1 -ifeq (,$(findstring 4.9,$(NDK_TOOLCHAIN))) -# Clang compiler supports -Oz -LOCAL_CFLAGS += -Oz -else -# gcc-4.9 compiler supports only -Os -LOCAL_CFLAGS += -Os -endif -ifeq ($(NDK_DEBUG),1) -LOCAL_CFLAGS += -DCPUINFO_LOG_LEVEL=5 -else -LOCAL_CFLAGS += -DCPUINFO_LOG_LEVEL=0 -endif -LOCAL_STATIC_LIBRARIES := clog -include $(BUILD_STATIC_LIBRARY) - -$(call import-add-path,$(LOCAL_PATH)/deps) - -$(call import-module,clog/jni) diff --git a/jni/Application.mk b/jni/Application.mk deleted file mode 100644 index 04f7b0e..0000000 --- a/jni/Application.mk +++ /dev/null @@ -1,4 +0,0 @@ -APP_PLATFORM := android-16 -APP_PIE := true -APP_STL := c++_static -APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 |