Skip to content

Commit

Permalink
Bug 1757483 - Update libjxl and highway r=tnikkel
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Mar 1, 2022
1 parent fd7eabc commit 70233d8
Show file tree
Hide file tree
Showing 142 changed files with 13,763 additions and 6,764 deletions.
1 change: 1 addition & 0 deletions media/highway/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ EXPORTS.hwy += [
"/third_party/highway/hwy/detect_targets.h",
"/third_party/highway/hwy/foreach_target.h",
"/third_party/highway/hwy/highway.h",
"/third_party/highway/hwy/highway_export.h",
"/third_party/highway/hwy/targets.h",
]

Expand Down
4 changes: 2 additions & 2 deletions media/highway/moz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ origin:

# Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS"
release: commit e69083a12a05caf037cabecdf1b248b7579705a5 (2021-11-11T08:20:00Z).
release: commit f13e3b956eb226561ac79427893ec0afd66f91a8 (2022-02-15T18:19:21Z).

# Revision to pull in
# Must be a long or short commit SHA (long preferred)
revision: e69083a12a05caf037cabecdf1b248b7579705a5
revision: f13e3b956eb226561ac79427893ec0afd66f91a8

# The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/
Expand Down
4 changes: 2 additions & 2 deletions media/libjxl/moz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ origin:

url: https://github.com/libjxl/libjxl

release: commit 4322679b1c418addc2284c5ea84fc2c3935b4a75 (2022-02-07T20:56:39Z).
release: commit 89875cba4d18485ec9692c80b747b59b73ce712e (2022-02-28T16:03:42Z).

revision: 4322679b1c418addc2284c5ea84fc2c3935b4a75
revision: 89875cba4d18485ec9692c80b747b59b73ce712e

license: Apache-2.0

Expand Down
57 changes: 57 additions & 0 deletions third_party/highway/.github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2021 Google LLC
#
# 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.

name: Build / test
on: [push, pull_request]
jobs:
cmake:
name: Build and test ${{ matrix.name }}
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- name: Clang-5.0
extra_deps: clang-5.0
c_compiler: clang-5.0
cxx_compiler: clang++-5.0

- name: Clang-6.0
extra_deps: clang-6.0
c_compiler: clang-6.0
cxx_compiler: clang++-6.0

steps:
- uses: actions/checkout@v2

- name: Install deps
run: sudo apt-get install ${{ matrix.extra_deps }}

- name: Build and test
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=2
export CTEST_PARALLEL_LEVEL=2
CXXFLAGS=-Werror CC=${{ matrix.c_compiler }} CXX=${{ matrix.cxx_compiler }} cmake -B out .
cmake --build out
ctest --test-dir out
bazel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v1
- uses: actions/cache@v2
with:
path: ~/.cache/bazel
key: bazel-${{ runner.os }}
- run: bazel build //...
106 changes: 65 additions & 41 deletions third_party/highway/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@rules_cc//cc:defs.bzl", "cc_test")

load("@rules_cc//cc:defs.bzl", "cc_test")
package(default_visibility = ["//visibility:public"])

licenses(["notice"])
Expand All @@ -18,6 +18,11 @@ config_setting(
flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc"},
)

config_setting(
name = "compiler_emscripten",
values = {"cpu": "wasm32"},
)

# See https://github.com/bazelbuild/bazel/issues/12707
config_setting(
name = "compiler_gcc_bug",
Expand All @@ -41,13 +46,6 @@ selects.config_setting_group(
],
)

config_setting(
name = "emulate_sve",
values = {
"copt": "-DHWY_EMULATE_SVE",
},
)

# Additional warnings for Clang OR GCC (skip for MSVC)
CLANG_GCC_COPTS = [
"-Wunused-parameter",
Expand Down Expand Up @@ -82,7 +80,7 @@ COPTS = select({
"//conditions:default": CLANG_GCC_COPTS + CLANG_ONLY_COPTS,
}) + select({
"@platforms//cpu:riscv64": [
"-march=rv64gcv0p10",
"-march=rv64gcv1p0",
"-menable-experimental-extensions",
],
"//conditions:default": [
Expand Down Expand Up @@ -112,28 +110,32 @@ cc_library(
"hwy/base.h",
"hwy/cache_control.h",
"hwy/detect_compiler_arch.h", # private
"hwy/detect_targets.h", # private
"hwy/targets.h",
"hwy/highway_export.h",
],
compatible_with = [],
copts = COPTS,
textual_hdrs = [
# These are textual because config macros influence them:
"hwy/detect_targets.h", # private
"hwy/targets.h",
# End of list
"hwy/highway.h", # public
"hwy/foreach_target.h", # public
"hwy/ops/arm_neon-inl.h",
"hwy/ops/arm_sve-inl.h",
"hwy/ops/generic_ops-inl.h",
"hwy/ops/rvv-inl.h",
"hwy/ops/scalar-inl.h",
"hwy/ops/set_macros-inl.h",
"hwy/ops/shared-inl.h",
"hwy/ops/wasm_128-inl.h",
"hwy/ops/x86_128-inl.h",
"hwy/ops/x86_256-inl.h",
"hwy/ops/x86_512-inl.h",
],
deps = select({
":emulate_sve": ["//third_party/farm_sve"],
# Select avoids recompiling native arch if only non-native changed
] + select({
":compiler_emscripten": ["hwy/ops/wasm_128-inl.h"],
"//conditions:default": [],
}) + select({
"@platforms//cpu:riscv64": ["hwy/ops/rvv-inl.h"],
"//conditions:default": [],
}),
)
Expand All @@ -144,7 +146,9 @@ cc_library(
textual_hdrs = [
"hwy/contrib/dot/dot-inl.h",
],
deps = [":hwy"],
deps = [
":hwy",
],
)

cc_library(
Expand All @@ -156,7 +160,9 @@ cc_library(
"hwy/contrib/image/image.h",
],
compatible_with = [],
deps = [":hwy"],
deps = [
":hwy",
],
)

cc_library(
Expand All @@ -165,16 +171,9 @@ cc_library(
textual_hdrs = [
"hwy/contrib/math/math-inl.h",
],
deps = [":hwy"],
)

cc_library(
name = "sort",
compatible_with = [],
textual_hdrs = [
"hwy/contrib/sort/sort-inl.h",
deps = [
":hwy",
],
deps = [":hwy"],
)

# Everything required for tests that use Highway.
Expand All @@ -188,7 +187,9 @@ cc_library(
],
# Must not depend on a gtest variant, which can conflict with the
# GUNIT_INTERNAL_BUILD_MODE defined by the test.
deps = [":hwy"],
deps = [
":hwy",
],
)

cc_library(
Expand All @@ -212,7 +213,9 @@ cc_library(
srcs = ["hwy/examples/skeleton.cc"],
hdrs = ["hwy/examples/skeleton.h"],
textual_hdrs = ["hwy/examples/skeleton-inl.h"],
deps = [":hwy"],
deps = [
":hwy",
],
)

cc_binary(
Expand All @@ -226,7 +229,7 @@ HWY_TESTS = [
("hwy/contrib/dot/", "dot_test"),
("hwy/contrib/image/", "image_test"),
("hwy/contrib/math/", "math_test"),
("hwy/contrib/sort/", "sort_test"),
# contrib/sort has its own BUILD, we add it to GUITAR_TESTS.
("hwy/examples/", "skeleton_test"),
("hwy/", "nanobenchmark_test"),
("hwy/", "aligned_allocator_test"),
Expand All @@ -239,13 +242,27 @@ HWY_TESTS = [
("hwy/tests/", "compare_test"),
("hwy/tests/", "convert_test"),
("hwy/tests/", "crypto_test"),
("hwy/tests/", "demote_test"),
("hwy/tests/", "logical_test"),
("hwy/tests/", "mask_test"),
("hwy/tests/", "memory_test"),
("hwy/tests/", "shift_test"),
("hwy/tests/", "swizzle_test"),
("hwy/tests/", "test_util_test"),
]

HWY_TEST_DEPS = [
":dot",
":hwy",
":hwy_test_util",
":image",
":math",
":nanobenchmark",
":skeleton",
"//hwy/contrib/sort:vqsort",
"@com_google_googletest//:gtest_main",
]

[
[
cc_test(
Expand All @@ -265,24 +282,29 @@ HWY_TESTS = [
"@platforms//cpu:riscv64": ["fully_static_link"],
"//conditions:default": [],
}),
linkopts = select({
":compiler_emscripten": [
"-s ASSERTIONS=2",
"-s ENVIRONMENT=node,shell,web",
"-s ERROR_ON_UNDEFINED_SYMBOLS=1",
"-s DEMANGLE_SUPPORT=1",
"-s EXIT_RUNTIME=1",
"-s ALLOW_MEMORY_GROWTH=1",
"--pre-js $(location :preamble.js.lds)",
],
"//conditions:default": [],
}),
linkstatic = select({
"@platforms//cpu:riscv64": True,
"//conditions:default": False,
}),
local_defines = ["HWY_IS_TEST"],
# for test_suite.
tags = ["hwy_ops_test"],
deps = [
":dot",
":hwy",
":hwy_test_util",
":image",
":math",
":nanobenchmark",
":skeleton",
":sort",
"@com_google_googletest//:gtest_main",
],
deps = HWY_TEST_DEPS + select({
":compiler_emscripten": [":preamble.js.lds"],
"//conditions:default": [],
}),
),
]
for subdir, test in HWY_TESTS
Expand All @@ -293,3 +315,5 @@ test_suite(
name = "hwy_ops_tests",
tags = ["hwy_ops_test"],
)

# Placeholder for integration test, do not remove
Loading

0 comments on commit 70233d8

Please sign in to comment.