diff --git a/.gitignore b/.gitignore index 271193c4..6ac289d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +_site tmp pdfs tex2pdf* diff --git a/build_with_docker.sh b/build_with_docker.sh index f9fe472f..5288e3ad 100755 --- a/build_with_docker.sh +++ b/build_with_docker.sh @@ -39,7 +39,8 @@ echo " $commithash" set -x IMAGE_NAME=acle_build # Build the image. -docker build -t $IMAGE_NAME tools/docker +docker build -t $IMAGE_NAME --network host tools/docker # Run the image, mounting the current folder into the /src folder of # the docker image. Run as the host user so that the output files are owned by them. docker run --rm -u $(id -u):$(id -g) --mount type=bind,source="$(pwd)",target=/src $IMAGE_NAME $finalversion $commithash $cleanrepo +rm -rf ./tmp diff --git a/mve_intrinsics/mve.template.md b/mve_intrinsics/mve.template.md index 6a0c9378..14c6dac3 100644 --- a/mve_intrinsics/mve.template.md +++ b/mve_intrinsics/mve.template.md @@ -22,7 +22,7 @@ to generate the Table of Contents via Jekyll. They are automatically removed by the scripts that generate the pdfs. --> * TOC -{{:toc}} +{:toc} # Preface ## Abstract diff --git a/neon_intrinsics/advsimd.template.md b/neon_intrinsics/advsimd.template.md index 10f74dd9..2737d884 100644 --- a/neon_intrinsics/advsimd.template.md +++ b/neon_intrinsics/advsimd.template.md @@ -23,7 +23,7 @@ to generate the Table of Contents via Jekyll. They are automatically removed by the scripts that generate the pdfs. --> * TOC -{{:toc}} +{:toc} # Preface ## Abstract diff --git a/tools/build-github-pages.sh b/tools/build-github-pages.sh index 1d7b17f5..4de86240 100755 --- a/tools/build-github-pages.sh +++ b/tools/build-github-pages.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2023, 2026 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 ########################### BUILD GITHUB PAGES ################################ @@ -81,7 +81,8 @@ trap cleanup EXIT cd $TEMPDIR git clone --depth 1 https://github.com/github/pages-gem.git cd pages-gem -docker build -t gh-pages --build-arg RUBY_VERSION=3.2 . +docker image inspect gh-pages >/dev/null 2>&1 || \ + docker build -t gh-pages --build-arg RUBY_VERSION=3.2 . cd $ROOTDIR echo -e "plugins:\n \ - jekyll-coffeescript\n \ @@ -102,6 +103,7 @@ docker_run_params="--rm \ -w /src/site \ --entrypoint /usr/local/bin/ruby \ gh-pages \ + -r/src/site/tools/jekyll-page-timing.rb \ /usr/local/bundle/bin/jekyll" if [ "$mode" == "build" ]; then diff --git a/tools/gen-intrinsics-specs.py b/tools/gen-intrinsics-specs.py index a43dad95..5d11c285 100755 --- a/tools/gen-intrinsics-specs.py +++ b/tools/gen-intrinsics-specs.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# SPDX-FileCopyrightText: Copyright 2021, 2023 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2021, 2023, 2026 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -965,7 +965,8 @@ def get_intrinsics_db(path): intrinsics_db = get_intrinsics_db(cli_args.intrinsic_defs) doc_template = read_template(cli_args.template) intrinsic_table = process_db(intrinsics_db, classification_map, cli_args.workflow) - md_output = doc_template.format(intrinsic_table=intrinsic_table) + normalized_template = doc_template.replace("{{", "{").replace("}}", "}") + md_output = normalized_template.replace("{intrinsic_table}", intrinsic_table) with (open(cli_args.outfile, 'w')) as f: f.write(md_output) # Always run the unit tests. diff --git a/tools/generate-pdfs.sh b/tools/generate-pdfs.sh index 8c9acc98..ec425162 100755 --- a/tools/generate-pdfs.sh +++ b/tools/generate-pdfs.sh @@ -75,3 +75,4 @@ generate_pdfs_from_md ./morello/morello.md ./pdfs/morello.pdf generate_pdfs_from_md ./main/acle.md ./pdfs/acle.pdf generate_pdfs_from_md ./tmp/mve.for-pdf.md ./pdfs/mve.pdf generate_pdfs_from_md ./tmp/advsimd.for-pdf.md ./pdfs/advsimd.pdf +rm -rf ./tmp diff --git a/tools/jekyll-page-timing.rb b/tools/jekyll-page-timing.rb new file mode 100644 index 00000000..cf522736 --- /dev/null +++ b/tools/jekyll-page-timing.rb @@ -0,0 +1,64 @@ +# SPDX-FileCopyrightText: Copyright 2026 Arm Limited and/or its affiliates +# SPDX-License-Identifier: Apache-2.0 +# +# 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. + +# frozen_string_literal: true + +require "jekyll" + +module JekyllPageTiming + @start_times = {} + + def self.name(item) + if item.respond_to?(:relative_path) && item.relative_path + item.relative_path + elsif item.respond_to?(:path) && item.path + item.path + elsif item.respond_to?(:url) && item.url + item.url + else + item.inspect + end + end + + def self.start(item) + @start_times[item.object_id] = + Process.clock_gettime(Process::CLOCK_MONOTONIC) + + warn "START PAGE: #{name(item)}" + end + + def self.finish(item) + started_at = @start_times.delete(item.object_id) + + if started_at + elapsed = + Process.clock_gettime(Process::CLOCK_MONOTONIC) - started_at + + warn format("END PAGE: %s (%.3fs)", name(item), elapsed) + else + warn "END PAGE: #{name(item)}" + end + end +end + +[:pages, :documents].each do |owner| + Jekyll::Hooks.register owner, :pre_render do |item| + JekyllPageTiming.start(item) + end + + Jekyll::Hooks.register owner, :post_render do |item| + JekyllPageTiming.finish(item) + end +end \ No newline at end of file