OSS cleanup Copyright header, buildifier, lint Change-Id: Icb268e765221b0d7f688c64c9628c06388933070
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6272489 --- /dev/null +++ b/CONTRIBUTING.md
@@ -0,0 +1,28 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to <https://cla.developers.google.com/> to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code Reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows [Google's Open Source Community +Guidelines](https://opensource.google/conduct/).
diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE
@@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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.
diff --git a/WORKSPACE b/WORKSPACE index 86215ec..17f3641 100644 --- a/WORKSPACE +++ b/WORKSPACE
@@ -1,3 +1,15 @@ +# Copyright 2023 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. +# + workspace(name = "kelvin_sw") load("//build_tools/bazel:repos.bzl", "kelvin_sw_repos", "tflm_repos")
diff --git a/build_tools/BUILD b/build_tools/BUILD index bdc0ccd..e1dc3c3 100644 --- a/build_tools/BUILD +++ b/build_tools/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + package(default_visibility = ["//visibility:public"]) exports_files([
diff --git a/build_tools/bazel/BUILD b/build_tools/bazel/BUILD index ffd0fb0..a603184 100644 --- a/build_tools/bazel/BUILD +++ b/build_tools/bazel/BUILD
@@ -1 +1,15 @@ +# Copyright 2023 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. + package(default_visibility = ["//visibility:public"])
diff --git a/build_tools/bazel/kelvin.bzl b/build_tools/bazel/kelvin.bzl index 5b93729..a88afbe 100644 --- a/build_tools/bazel/kelvin.bzl +++ b/build_tools/bazel/kelvin.bzl
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + """Rules to build Kelvin SW objects""" load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")
diff --git a/build_tools/bazel/repos.bzl b/build_tools/bazel/repos.bzl index 1fecab6..8792bfa 100644 --- a/build_tools/bazel/repos.bzl +++ b/build_tools/bazel/repos.bzl
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + """Kelvin dependency repository setup.""" load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") @@ -34,6 +48,7 @@ def tflm_repos(): """Setup Tensorflow Lite For Microcontrollers repositories.""" + # Tensorflow Lite for Microcontrollers native.local_repository( name = "tflite-micro",
diff --git a/build_tools/core_sim_test_runner.sh b/build_tools/core_sim_test_runner.sh index 946d578..fe70012 100755 --- a/build_tools/core_sim_test_runner.sh +++ b/build_tools/core_sim_test_runner.sh
@@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2023 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. + # Test runner for SystemC simulator. Note the input should be the .bin file. function print_usage {
diff --git a/build_tools/test_runner.sh b/build_tools/test_runner.sh index 822606b..d513e66 100755 --- a/build_tools/test_runner.sh +++ b/build_tools/test_runner.sh
@@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2023 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. + function print_usage { echo "Usage: test_runner.sh <elf location>"
diff --git a/crt/BUILD b/crt/BUILD index 58860a6..b3c18ce 100644 --- a/crt/BUILD +++ b/crt/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + package(default_visibility = ["//visibility:public"]) filegroup(
diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt index cefab25..2f45e0d 100644 --- a/crt/CMakeLists.txt +++ b/crt/CMakeLists.txt
@@ -1,7 +1,17 @@ # Copyright 2023 Google LLC -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# 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. + enable_language(ASM)
diff --git a/crt/crt.S b/crt/crt.S index e5c34f5..adebcb6 100644 --- a/crt/crt.S +++ b/crt/crt.S
@@ -1,7 +1,18 @@ -// Copyright 2023 Google LLC. -// Copyright lowRISC contributors. -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ /** * CRT library
diff --git a/crt/kelvin.h b/crt/kelvin.h index 17163dc..a631593 100644 --- a/crt/kelvin.h +++ b/crt/kelvin.h
@@ -1,7 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ // Kelvin helper header #ifndef CRT_KELVIN_H_
diff --git a/crt/kelvin.ld b/crt/kelvin.ld index 7935224..db178f0 100644 --- a/crt/kelvin.ld +++ b/crt/kelvin.ld
@@ -1,6 +1,18 @@ -/* Copyright 2023 Google LLC. */ -/* Licensed under the Apache License, Version 2.0, see LICENSE for details. */ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright 2023 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. + */ /** * A simple linker script for kelvin core.
diff --git a/crt/kelvin_intrinsics.h b/crt/kelvin_intrinsics.h index 0764166..c20e21d 100644 --- a/crt/kelvin_intrinsics.h +++ b/crt/kelvin_intrinsics.h
@@ -1,7 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ // clang-format off // Kelvin instruction intrinsics
diff --git a/crt/kelvin_start.S b/crt/kelvin_start.S index e60af38..9ed259a 100644 --- a/crt/kelvin_start.S +++ b/crt/kelvin_start.S
@@ -1,7 +1,19 @@ -// Copyright 2023 Google LLC. -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ + // A starting functions for simple kelvin programs. /**
diff --git a/crt/log.h b/crt/log.h index d404f5b..2caf8c4 100644 --- a/crt/log.h +++ b/crt/log.h
@@ -1,7 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ // Kelvin logging helper header #ifndef CRT_LOG_H_
diff --git a/crt/printf_traits.h b/crt/printf_traits.h index c7a6f1b..14be9bc 100644 --- a/crt/printf_traits.h +++ b/crt/printf_traits.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef CRT_PRINTF_TRAITS_H_ #define CRT_PRINTF_TRAITS_H_
diff --git a/examples/hello_world/BUILD b/examples/hello_world/BUILD index 2e67534..b0d902a 100644 --- a/examples/hello_world/BUILD +++ b/examples/hello_world/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + load("//build_tools/bazel:kelvin.bzl", "kelvin_binary") kelvin_binary( @@ -7,5 +21,5 @@ ], deps = [ "//crt", - ] + ], )
diff --git a/examples/tflm/person_detection/BUILD b/examples/tflm/person_detection/BUILD index 3228be0..265e0fa 100644 --- a/examples/tflm/person_detection/BUILD +++ b/examples/tflm/person_detection/BUILD
@@ -1,19 +1,34 @@ -load("//build_tools/bazel:kelvin.bzl", "kelvin_binary", "generate_cc_arrays") +# Copyright 2023 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. + +load("//build_tools/bazel:kelvin.bzl", "generate_cc_arrays", "kelvin_binary") + package(default_visibility = ["//visibility:public"]) kelvin_binary( name = "person_detection", srcs = [ - "person_detection.cc", - "person_detect_tflite.cc", "person_bmp.cc", + "person_detect_tflite.cc", + "person_detection.cc", ], hdrs = [ "person_bmp.h", "person_detect_tflite.h", ], deps = [ - "//crt:crt", + "//crt", "@tflite-micro//tensorflow/lite/micro:micro_framework", "@tflite-micro//tensorflow/lite/micro:system_setup", ], @@ -24,6 +39,7 @@ src = "@tflite-micro//tensorflow/lite/micro/examples/person_detection:testdata/person.bmp", out = "person_bmp.cc", ) + generate_cc_arrays( name = "person_bmp_h", src = "@tflite-micro//tensorflow/lite/micro/examples/person_detection:testdata/person.bmp",
diff --git a/examples/tflm/person_detection/person_detection.cc b/examples/tflm/person_detection/person_detection.cc index 4b608c6..de83098 100644 --- a/examples/tflm/person_detection/person_detection.cc +++ b/examples/tflm/person_detection/person_detection.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "examples/tflm/person_detection/person_bmp.h" #include "examples/tflm/person_detection/person_detect_tflite.h"
diff --git a/host_tools/BUILD b/host_tools/BUILD index 2a598d0..902f1b5 100644 --- a/host_tools/BUILD +++ b/host_tools/BUILD
@@ -1,3 +1,16 @@ +# Copyright 2023 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. cc_binary( name = "encoding_bin", @@ -12,8 +25,8 @@ "kelvin-opc.c", "kelvin_intrinsics.h", ], -# encoding_bin is in bazel-out/host/ because of cross-compile. We need to move -# the outputs to $RULEDIR + # encoding_bin is in bazel-out/host/ because of cross-compile. We need to move + # the outputs to $RULEDIR cmd = """ mkdir -p $(RULEDIR) ./$(location :encoding_bin)
diff --git a/platforms/BUILD b/platforms/BUILD index bb7a41a..84897f3 100644 --- a/platforms/BUILD +++ b/platforms/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + licenses(["notice"]) package(
diff --git a/platforms/cpu/BUILD b/platforms/cpu/BUILD index 4a03609..dc5efac 100644 --- a/platforms/cpu/BUILD +++ b/platforms/cpu/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + licenses(["notice"]) package(
diff --git a/platforms/registration.bzl b/platforms/registration.bzl index a8b1c53..e85f806 100644 --- a/platforms/registration.bzl +++ b/platforms/registration.bzl
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + """Kelvin toolchain registration.""" def kelvin_register_toolchain(name = "kelvin"):
diff --git a/platforms/riscv32/BUILD b/platforms/riscv32/BUILD index 39cfec3..0d3a327 100644 --- a/platforms/riscv32/BUILD +++ b/platforms/riscv32/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + package(default_visibility = ["//visibility:public"]) platform(
diff --git a/platforms/riscv32/devices.bzl b/platforms/riscv32/devices.bzl index 21b1beb..e6f0b56 100644 --- a/platforms/riscv32/devices.bzl +++ b/platforms/riscv32/devices.bzl
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + load("@crt//config:device.bzl", "device_config") DEVICES = [
diff --git a/platforms/riscv32/features/BUILD b/platforms/riscv32/features/BUILD index 737a988..5f1e820 100644 --- a/platforms/riscv32/features/BUILD +++ b/platforms/riscv32/features/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + load( "@crt//config:features.bzl", "CPP_ALL_COMPILE_ACTIONS",
diff --git a/tests/cv/BUILD b/tests/cv/BUILD index b9e5832..1e98578 100644 --- a/tests/cv/BUILD +++ b/tests/cv/BUILD
@@ -1,6 +1,14 @@ # Copyright 2023 Google LLC -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# 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. +# # Computer vision examples. load("//build_tools/bazel:kelvin.bzl", "kelvin_test")
diff --git a/tests/cv/diff.cc b/tests/cv/diff.cc index db39296..6422a1c 100644 --- a/tests/cv/diff.cc +++ b/tests/cv/diff.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/diff.h"
diff --git a/tests/cv/diff.h b/tests/cv/diff.h index 19a9c1b..87ab8f9 100644 --- a/tests/cv/diff.h +++ b/tests/cv/diff.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TESTS_CV_DIFF_H_ #define TESTS_CV_DIFF_H_
diff --git a/tests/cv/diff_test.cc b/tests/cv/diff_test.cc index cd20a77..4b13a89 100644 --- a/tests/cv/diff_test.cc +++ b/tests/cv/diff_test.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/diff.h"
diff --git a/tests/cv/downsample.cc b/tests/cv/downsample.cc index eaf9bb6..3230b44 100644 --- a/tests/cv/downsample.cc +++ b/tests/cv/downsample.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/downsample.h"
diff --git a/tests/cv/downsample.h b/tests/cv/downsample.h index 5aecb16..da91fc2 100644 --- a/tests/cv/downsample.h +++ b/tests/cv/downsample.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TESTS_CV_DOWNSAMPLE_H_ #define TESTS_CV_DOWNSAMPLE_H_
diff --git a/tests/cv/downsample_test.cc b/tests/cv/downsample_test.cc index f82a1cc..c61e490 100644 --- a/tests/cv/downsample_test.cc +++ b/tests/cv/downsample_test.cc
@@ -1,7 +1,18 @@ - -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/downsample.h"
diff --git a/tests/cv/extrema.cc b/tests/cv/extrema.cc index e4ade0d..db81396 100644 --- a/tests/cv/extrema.cc +++ b/tests/cv/extrema.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/extrema.h"
diff --git a/tests/cv/extrema.h b/tests/cv/extrema.h index 5872217..f350b4e 100644 --- a/tests/cv/extrema.h +++ b/tests/cv/extrema.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TESTS_CV_EXTREMA_H_ #define TESTS_CV_EXTREMA_H_
diff --git a/tests/cv/extrema_test.cc b/tests/cv/extrema_test.cc index e6ff969..18cf111 100644 --- a/tests/cv/extrema_test.cc +++ b/tests/cv/extrema_test.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/extrema.h"
diff --git a/tests/cv/gaussian.cc b/tests/cv/gaussian.cc index f280746..873c565 100644 --- a/tests/cv/gaussian.cc +++ b/tests/cv/gaussian.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/gaussian.h"
diff --git a/tests/cv/gaussian.h b/tests/cv/gaussian.h index c06f21a..eb701d0 100644 --- a/tests/cv/gaussian.h +++ b/tests/cv/gaussian.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TESTS_CV_GAUSSIAN_H_ #define TESTS_CV_GAUSSIAN_H_
diff --git a/tests/cv/gaussian_test.cc b/tests/cv/gaussian_test.cc index cf6f3c4..c2a10f8 100644 --- a/tests/cv/gaussian_test.cc +++ b/tests/cv/gaussian_test.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/gaussian.h"
diff --git a/tests/cv/shift_gaussian.cc b/tests/cv/shift_gaussian.cc index 95f96f3..207f444 100644 --- a/tests/cv/shift_gaussian.cc +++ b/tests/cv/shift_gaussian.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/shift_gaussian.h"
diff --git a/tests/cv/shift_gaussian.h b/tests/cv/shift_gaussian.h index 4d494d6..b452448 100644 --- a/tests/cv/shift_gaussian.h +++ b/tests/cv/shift_gaussian.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TESTS_CV_SHIFT_GAUSSIAN_H_ #define TESTS_CV_SHIFT_GAUSSIAN_H_
diff --git a/tests/cv/shift_gaussian_test.cc b/tests/cv/shift_gaussian_test.cc index 3ef8f2e..448607a 100644 --- a/tests/cv/shift_gaussian_test.cc +++ b/tests/cv/shift_gaussian_test.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/shift_gaussian.h"
diff --git a/tests/cv/test_helper.h b/tests/cv/test_helper.h index b0e7f8f..932d948 100644 --- a/tests/cv/test_helper.h +++ b/tests/cv/test_helper.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TESTS_CV_TEST_HELPER_H_ #define TESTS_CV_TEST_HELPER_H_
diff --git a/tests/cv/upsample.cc b/tests/cv/upsample.cc index 6c6ea20..2a0b719 100644 --- a/tests/cv/upsample.cc +++ b/tests/cv/upsample.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/upsample.h"
diff --git a/tests/cv/upsample.h b/tests/cv/upsample.h index 1831a28..ab1dde9 100644 --- a/tests/cv/upsample.h +++ b/tests/cv/upsample.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TESTS_CV_UPSAMPLE_H_ #define TESTS_CV_UPSAMPLE_H_
diff --git a/tests/cv/upsample_test.cc b/tests/cv/upsample_test.cc index fc8b628..bf51893 100644 --- a/tests/cv/upsample_test.cc +++ b/tests/cv/upsample_test.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "tests/cv/upsample.h"
diff --git a/tests/kelvin_isa/BUILD b/tests/kelvin_isa/BUILD index 25930b4..8a70de2 100644 --- a/tests/kelvin_isa/BUILD +++ b/tests/kelvin_isa/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + load("//build_tools/bazel:kelvin.bzl", "kelvin_test") cc_library( @@ -6,7 +20,7 @@ "kelvin_test.h", ], deps = [ - "//crt:crt", + "//crt", ], )
diff --git a/tests/kelvin_isa/getvl_test.cc b/tests/kelvin_isa/getvl_test.cc index dea0e75..ddc83e3 100644 --- a/tests/kelvin_isa/getvl_test.cc +++ b/tests/kelvin_isa/getvl_test.cc
@@ -1,7 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ #include <cstdio>
diff --git a/tests/kelvin_isa/kelvin_test.h b/tests/kelvin_isa/kelvin_test.h index 464cb6a..9f49bce 100644 --- a/tests/kelvin_isa/kelvin_test.h +++ b/tests/kelvin_isa/kelvin_test.h
@@ -1,7 +1,19 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ + // Kelvin ISA test common header #ifndef TESTS_KELVIN_ISA_KELVIN_TEST_H_ @@ -15,36 +27,116 @@ constexpr int VLENH = VLEN / 16; constexpr int VLENW = VLEN / 32; -#define getmaxvl(T, d) { if (sizeof(T) == 1) getmaxvl_b(d); if (sizeof(T) == 2) getmaxvl_h(d); if (sizeof(T) == 4) getmaxvl_w(d); } +#define getmaxvl(T, d) \ + { \ + if (sizeof(T) == 1) getmaxvl_b(d); \ + if (sizeof(T) == 2) getmaxvl_h(d); \ + if (sizeof(T) == 4) getmaxvl_w(d); \ + } -#define getmaxvl_m(T, d) { if (sizeof(T) == 1) getmaxvl_b_m(d); if (sizeof(T) == 2) getmaxvl_h_m(d); if (sizeof(T) == 4) getmaxvl_w_m(d); } +#define getmaxvl_m(T, d) \ + { \ + if (sizeof(T) == 1) getmaxvl_b_m(d); \ + if (sizeof(T) == 2) getmaxvl_h_m(d); \ + if (sizeof(T) == 4) getmaxvl_w_m(d); \ + } -#define vld_x(T, Vd, s) { if (sizeof(T) == 1) vld_b_x(Vd, s); if (sizeof(T) == 2) vld_h_x(Vd, s); if (sizeof(T) == 4) vld_w_x(Vd, s); } +#define vld_x(T, Vd, s) \ + { \ + if (sizeof(T) == 1) vld_b_x(Vd, s); \ + if (sizeof(T) == 2) vld_h_x(Vd, s); \ + if (sizeof(T) == 4) vld_w_x(Vd, s); \ + } -#define vst_x(T, Vd, s) { if (sizeof(T) == 1) vst_b_x(Vd, s); if (sizeof(T) == 2) vst_h_x(Vd, s); if (sizeof(T) == 4) vst_w_x(Vd, s); } +#define vst_x(T, Vd, s) \ + { \ + if (sizeof(T) == 1) vst_b_x(Vd, s); \ + if (sizeof(T) == 2) vst_h_x(Vd, s); \ + if (sizeof(T) == 4) vst_w_x(Vd, s); \ + } -#define vld_x_m(T, Vd, s) { if (sizeof(T) == 1) vld_b_x_m(Vd, s); if (sizeof(T) == 2) vld_h_x_m(Vd, s); if (sizeof(T) == 4) vld_w_x_m(Vd, s); } +#define vld_x_m(T, Vd, s) \ + { \ + if (sizeof(T) == 1) vld_b_x_m(Vd, s); \ + if (sizeof(T) == 2) vld_h_x_m(Vd, s); \ + if (sizeof(T) == 4) vld_w_x_m(Vd, s); \ + } -#define vst_x_m(T, Vd, s) { if (sizeof(T) == 1) vst_b_x_m(Vd, s); if (sizeof(T) == 2) vst_h_x_m(Vd, s); if (sizeof(T) == 4) vst_w_x_m(Vd, s); } +#define vst_x_m(T, Vd, s) \ + { \ + if (sizeof(T) == 1) vst_b_x_m(Vd, s); \ + if (sizeof(T) == 2) vst_h_x_m(Vd, s); \ + if (sizeof(T) == 4) vst_w_x_m(Vd, s); \ + } -#define vld_l_xx(T, Vd, s, t) { if (sizeof(T) == 1) vld_b_l_xx(Vd, s, t); if (sizeof(T) == 2) vld_h_l_xx(Vd, s, t); if (sizeof(T) == 4) vld_w_l_xx(Vd, s, t); } +#define vld_l_xx(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vld_b_l_xx(Vd, s, t); \ + if (sizeof(T) == 2) vld_h_l_xx(Vd, s, t); \ + if (sizeof(T) == 4) vld_w_l_xx(Vd, s, t); \ + } -#define vst_l_xx(T, Vd, s, t) { if (sizeof(T) == 1) vst_b_l_xx(Vd, s, t); if (sizeof(T) == 2) vst_h_l_xx(Vd, s, t); if (sizeof(T) == 4) vst_w_l_xx(Vd, s, t); } +#define vst_l_xx(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vst_b_l_xx(Vd, s, t); \ + if (sizeof(T) == 2) vst_h_l_xx(Vd, s, t); \ + if (sizeof(T) == 4) vst_w_l_xx(Vd, s, t); \ + } -#define vld_l_xx_m(T, Vd, s, t) { if (sizeof(T) == 1) vld_b_l_xx_m(Vd, s, t); if (sizeof(T) == 2) vld_h_l_xx_m(Vd, s, t); if (sizeof(T) == 4) vld_w_l_xx_m(Vd, s, t); } +#define vld_l_xx_m(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vld_b_l_xx_m(Vd, s, t); \ + if (sizeof(T) == 2) vld_h_l_xx_m(Vd, s, t); \ + if (sizeof(T) == 4) vld_w_l_xx_m(Vd, s, t); \ + } -#define vst_l_xx_m(T, Vd, s, t) { if (sizeof(T) == 1) vst_b_l_xx_m(Vd, s, t); if (sizeof(T) == 2) vst_h_l_xx_m(Vd, s, t); if (sizeof(T) == 4) vst_w_l_xx_m(Vd, s, t); } +#define vst_l_xx_m(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vst_b_l_xx_m(Vd, s, t); \ + if (sizeof(T) == 2) vst_h_l_xx_m(Vd, s, t); \ + if (sizeof(T) == 4) vst_w_l_xx_m(Vd, s, t); \ + } -#define vld_s_xx(T, Vd, s, t) { if (sizeof(T) == 1) vld_b_s_xx(Vd, s, t); if (sizeof(T) == 2) vld_h_s_xx(Vd, s, t); if (sizeof(T) == 4) vld_w_s_xx(Vd, s, t); } +#define vld_s_xx(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vld_b_s_xx(Vd, s, t); \ + if (sizeof(T) == 2) vld_h_s_xx(Vd, s, t); \ + if (sizeof(T) == 4) vld_w_s_xx(Vd, s, t); \ + } -#define vst_s_xx(T, Vd, s, t) { if (sizeof(T) == 1) vst_b_s_xx(Vd, s, t); if (sizeof(T) == 2) vst_h_s_xx(Vd, s, t); if (sizeof(T) == 4) vst_w_s_xx(Vd, s, t); } +#define vst_s_xx(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vst_b_s_xx(Vd, s, t); \ + if (sizeof(T) == 2) vst_h_s_xx(Vd, s, t); \ + if (sizeof(T) == 4) vst_w_s_xx(Vd, s, t); \ + } -#define vld_s_xx_m(T, Vd, s, t) { if (sizeof(T) == 1) vld_b_s_xx_m(Vd, s, t); if (sizeof(T) == 2) vld_h_s_xx_m(Vd, s, t); if (sizeof(T) == 4) vld_w_s_xx_m(Vd, s, t); } +#define vld_s_xx_m(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vld_b_s_xx_m(Vd, s, t); \ + if (sizeof(T) == 2) vld_h_s_xx_m(Vd, s, t); \ + if (sizeof(T) == 4) vld_w_s_xx_m(Vd, s, t); \ + } -#define vst_s_xx_m(T, Vd, s, t) { if (sizeof(T) == 1) vst_b_s_xx_m(Vd, s, t); if (sizeof(T) == 2) vst_h_s_xx_m(Vd, s, t); if (sizeof(T) == 4) vst_w_s_xx_m(Vd, s, t); } +#define vst_s_xx_m(T, Vd, s, t) \ + { \ + if (sizeof(T) == 1) vst_b_s_xx_m(Vd, s, t); \ + if (sizeof(T) == 2) vst_h_s_xx_m(Vd, s, t); \ + if (sizeof(T) == 4) vst_w_s_xx_m(Vd, s, t); \ + } -#define vdup_x(T, Vd, s) { if (sizeof(T) == 1) vdup_b_x(Vd, s); if (sizeof(T) == 2) vdup_h_x(Vd, s); if (sizeof(T) == 4) vdup_w_x(Vd, s); } +#define vdup_x(T, Vd, s) \ + { \ + if (sizeof(T) == 1) vdup_b_x(Vd, s); \ + if (sizeof(T) == 2) vdup_h_x(Vd, s); \ + if (sizeof(T) == 4) vdup_w_x(Vd, s); \ + } -#define vdup_x_m(T, Vd, s) { if (sizeof(T) == 1) vdup_b_x_m(Vd, s); if (sizeof(T) == 2) vdup_h_x_m(Vd, s); if (sizeof(T) == 4) vdup_w_x_m(Vd, s); } +#define vdup_x_m(T, Vd, s) \ + { \ + if (sizeof(T) == 1) vdup_b_x_m(Vd, s); \ + if (sizeof(T) == 2) vdup_h_x_m(Vd, s); \ + if (sizeof(T) == 4) vdup_w_x_m(Vd, s); \ + } #endif // TESTS_KELVIN_ISA_KELVIN_TEST_H_
diff --git a/tests/kelvin_isa/vdwconv.cc b/tests/kelvin_isa/vdwconv.cc index ff941a1..ec155dc 100644 --- a/tests/kelvin_isa/vdwconv.cc +++ b/tests/kelvin_isa/vdwconv.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include <cstdio> #include <cstring>
diff --git a/tests/kelvin_isa/vdwconv_data.h b/tests/kelvin_isa/vdwconv_data.h index 100709d..f5ecaa5 100644 --- a/tests/kelvin_isa/vdwconv_data.h +++ b/tests/kelvin_isa/vdwconv_data.h
@@ -1,5 +1,21 @@ -#ifndef TESTS_KELVIN_ISA_VDWCONV_H_DATA_ -#define TESTS_KELVIN_ISA_VDWCONV_H_DATA_ +/* + * Copyright 2023 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. + */ + +#ifndef TESTS_KELVIN_ISA_VDWCONV_DATA_H_ +#define TESTS_KELVIN_ISA_VDWCONV_DATA_H_ #include <stdint.h> @@ -1233,4 +1249,4 @@ }}, }; -#endif // TESTS_KELVIN_ISA_VDWCONV_H_DATA_ +#endif // TESTS_KELVIN_ISA_VDWCONV_DATA_H_
diff --git a/tests/kelvin_isa/vld.cc b/tests/kelvin_isa/vld.cc index 0d8d5a3..6f11018 100644 --- a/tests/kelvin_isa/vld.cc +++ b/tests/kelvin_isa/vld.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include <cstdio>
diff --git a/tests/kelvin_isa/vpadd.cc b/tests/kelvin_isa/vpadd.cc index d7bc2ed..f28ad50 100644 --- a/tests/kelvin_isa/vpadd.cc +++ b/tests/kelvin_isa/vpadd.cc
@@ -1,4 +1,18 @@ -// Copyright 2023 Google LLC +/* + * Copyright 2023 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. + */ #include <cstdio>
diff --git a/tests/riscv-tests/BUILD b/tests/riscv-tests/BUILD index 2139115..a59b951 100644 --- a/tests/riscv-tests/BUILD +++ b/tests/riscv-tests/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + # Build riscv-tests based on Kelvin linker script and termination condition. load("//build_tools/bazel:kelvin.bzl", "kelvin_test")
diff --git a/tests/riscv-tests/branch_div_test.cc b/tests/riscv-tests/branch_div_test.cc index 95ba75d..118d623 100644 --- a/tests/riscv-tests/branch_div_test.cc +++ b/tests/riscv-tests/branch_div_test.cc
@@ -1,7 +1,19 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ + // Use the routine of finding the integer part of log_3 to stress test // branch/div op combinations.
diff --git a/tests/riscv-tests/branch_modulo_test.cc b/tests/riscv-tests/branch_modulo_test.cc index faac704..aa1b6f8 100644 --- a/tests/riscv-tests/branch_modulo_test.cc +++ b/tests/riscv-tests/branch_modulo_test.cc
@@ -1,7 +1,19 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 -// +/* + * Copyright 2023 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. + */ + // Use greatest common denominator routine to stress test branch/modulo op // combinations.
diff --git a/tests/tflm/BUILD b/tests/tflm/BUILD index 7b534e6..04063a0 100644 --- a/tests/tflm/BUILD +++ b/tests/tflm/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + load("//build_tools/bazel:kelvin.bzl", "kelvin_test") package(default_visibility = ["//visibility:public"])
diff --git a/tflm/opt/BUILD b/tflm/opt/BUILD index f3f6e7d..f518259 100644 --- a/tflm/opt/BUILD +++ b/tflm/opt/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + package(default_visibility = ["//visibility:public"]) cc_library( @@ -18,7 +32,7 @@ ], target_compatible_with = ["@kelvin_sw//platforms/cpu:kelvin"], deps = [ - "//crt:crt", + "//crt", "@tflite-micro//tensorflow/lite/kernels/internal:common", ], alwayslink = True,
diff --git a/tflm/opt/conv.cc b/tflm/opt/conv.cc index 92b2a31..9ea92bc 100644 --- a/tflm/opt/conv.cc +++ b/tflm/opt/conv.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include <cassert> #include <memory> @@ -22,7 +34,7 @@ 3, 7, 11, 15, }; /* clang-format on */ -} // namespace +} // namespace void conv_per_channel_b32( const tflite::ConvParams& params, const int32_t* output_multiplier,
diff --git a/tflm/opt/depthwise_conv_s16.cc b/tflm/opt/depthwise_conv_s16.cc index 0d04e2a..13ae125 100644 --- a/tflm/opt/depthwise_conv_s16.cc +++ b/tflm/opt/depthwise_conv_s16.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include <algorithm>
diff --git a/tflm/opt/elementwise_add_s16.cc b/tflm/opt/elementwise_add_s16.cc index 8b5370b..e4220f0 100644 --- a/tflm/opt/elementwise_add_s16.cc +++ b/tflm/opt/elementwise_add_s16.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "crt/kelvin.h" #include "tflm/opt/opt.h"
diff --git a/tflm/opt/elementwise_add_s32.cc b/tflm/opt/elementwise_add_s32.cc index ff17fe1..483799a 100644 --- a/tflm/opt/elementwise_add_s32.cc +++ b/tflm/opt/elementwise_add_s32.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "crt/kelvin.h" #include "tflm/opt/opt.h"
diff --git a/tflm/opt/elementwise_add_s8.cc b/tflm/opt/elementwise_add_s8.cc index c34cb55..ac83e1f 100644 --- a/tflm/opt/elementwise_add_s8.cc +++ b/tflm/opt/elementwise_add_s8.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "crt/kelvin.h" #include "tflm/opt/opt.h"
diff --git a/tflm/opt/leaky_relu_s16.cc b/tflm/opt/leaky_relu_s16.cc index e3ac66d..5cd1128 100644 --- a/tflm/opt/leaky_relu_s16.cc +++ b/tflm/opt/leaky_relu_s16.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include <limits>
diff --git a/tflm/opt/leaky_relu_s8.cc b/tflm/opt/leaky_relu_s8.cc index 15b9218..b32d260 100644 --- a/tflm/opt/leaky_relu_s8.cc +++ b/tflm/opt/leaky_relu_s8.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include <limits>
diff --git a/tflm/opt/memcpy.cc b/tflm/opt/memcpy.cc index 24df6f3..4669a83 100644 --- a/tflm/opt/memcpy.cc +++ b/tflm/opt/memcpy.cc
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #include "crt/kelvin.h"
diff --git a/tflm/opt/opt.h b/tflm/opt/opt.h index c721803..17e004a 100644 --- a/tflm/opt/opt.h +++ b/tflm/opt/opt.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TFLM_OPT_OPT_H_ #define TFLM_OPT_OPT_H_
diff --git a/tflm/opt/util.h b/tflm/opt/util.h index f00d089..d94ef3e 100644 --- a/tflm/opt/util.h +++ b/tflm/opt/util.h
@@ -1,6 +1,18 @@ -// Copyright 2023 Google LLC -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 +/* + * Copyright 2023 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. + */ #ifndef TFLM_OPT_UTIL_H_ #define TFLM_OPT_UTIL_H_ @@ -26,7 +38,8 @@ } while (0); #define rescale(Vd, Vs, Vscratch, mult, shift, offset) \ - rescale_internal(Vd, Vs, Vscratch, mult, shift, offset, ); + rescale_internal(Vd, Vs, Vscratch, mult, shift, \ + offset, ); // NOLINT(whitespace/parens) #define rescale_m(Vd, Vs, Vscratch, mult, shift, offset) \ rescale_internal(Vd, Vs, Vscratch, mult, shift, offset, _m);
diff --git a/third_party/kelvin-gcc/BUILD b/third_party/kelvin-gcc/BUILD index 22e7b57..459e3b0 100644 --- a/third_party/kelvin-gcc/BUILD +++ b/third_party/kelvin-gcc/BUILD
@@ -1,3 +1,13 @@ -# Copyright 2023 Google LLC. +# Copyright 2023 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. +# package(default_visibility = ["//visibility:public"])
diff --git a/third_party/ml-models/BUILD b/third_party/ml-models/BUILD deleted file mode 100644 index 3f152f8..0000000 --- a/third_party/ml-models/BUILD +++ /dev/null
@@ -1,6 +0,0 @@ -# Copyright 2023 Google LLC -package(default_visibility = ["//visibility:public"]) - -exports_files( - glob(["quant_models/*.tflite"]) -)
diff --git a/third_party/riscv/BUILD b/third_party/riscv/BUILD index ffd0fb0..a603184 100644 --- a/third_party/riscv/BUILD +++ b/third_party/riscv/BUILD
@@ -1 +1,15 @@ +# Copyright 2023 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. + package(default_visibility = ["//visibility:public"])
diff --git a/third_party/riscv/BUILD.riscv-tests b/third_party/riscv/BUILD.riscv-tests index dcf1177..5ae2341 100644 --- a/third_party/riscv/BUILD.riscv-tests +++ b/third_party/riscv/BUILD.riscv-tests
@@ -1,3 +1,15 @@ +# Copyright 2023 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. +# + package(default_visibility = ["//visibility:public"]) filegroup(
diff --git a/toolchains/kelvin/BUILD b/toolchains/kelvin/BUILD index ef7a6b7..56bed0d 100644 --- a/toolchains/kelvin/BUILD +++ b/toolchains/kelvin/BUILD
@@ -1,6 +1,14 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 +# Copyright 2023 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. +# # Forked from @crt//toolchains/lowrisc_rv32imcb/BUILD.bazel
diff --git a/toolchains/kelvin/wrappers/BUILD b/toolchains/kelvin/wrappers/BUILD index 7121e88..edbfcfb 100644 --- a/toolchains/kelvin/wrappers/BUILD +++ b/toolchains/kelvin/wrappers/BUILD
@@ -1,3 +1,17 @@ +# Copyright 2023 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. + package(default_visibility = ["//visibility:public"]) exports_files(glob(["*"]))
diff --git a/toolchains/kelvin/wrappers/driver.sh b/toolchains/kelvin/wrappers/driver.sh index eb2994e..0084cb4 100755 --- a/toolchains/kelvin/wrappers/driver.sh +++ b/toolchains/kelvin/wrappers/driver.sh
@@ -1,7 +1,15 @@ #!/bin/bash --norc -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 +# Copyright 2023 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. +# PROG=$(basename "$0") DRIVER_DIR=$(dirname "$0")