Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
common --enable_bzlmod
build --cxxopt='-std=c++17'
build:windows --cxxopt='/std:c++17'
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.6.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ build-*/

# Bazel artifacts
**/bazel-*
MODULE.bazel.lock

# Emacs autosaves
*~
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

4 changes: 2 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Ruy is not BLAS

load("//tools/build_defs/license:license.bzl", "license")
load("@rules_license//rules:license.bzl", "license")

package(
default_applicable_licenses = ["//third_party/ruy:license"],
default_applicable_licenses = ["@com_google_ruy//:license"],
licenses = ["notice"], # Apache 2.0
)

Expand Down
31 changes: 31 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2020 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
#
# https://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.

module(
name = "ruy",
version = "",
repo_name = "com_google_ruy",
)

# -- bazel_dep definitions -- #
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "cpuinfo", version = "0.0.0-20240417-3c8b153")
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.2")
bazel_dep(name = "rules_license", version = "1.0.0")

# -- use_repo_rule statements -- #

# -- repo definitions -- #
58 changes: 44 additions & 14 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,56 @@ workspace(name = "com_google_ruy")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

maybe(
local_repository,
name = "com_google_googletest",
path = "third_party/googletest",
http_archive(
name = "bazel_features",
sha256 = "06a9691becc357c1e4af011b9fb3239097503ce00607d9eb6b11ea0fac304039",
strip_prefix = "bazel_features-1.35.0",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.35.0/bazel_features-v1.35.0.tar.gz",
)

maybe(
new_local_repository,
name = "cpuinfo",
path = "third_party/cpuinfo",
build_file = "@//third_party:cpuinfo.BUILD",
)
load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

# skylib utility for additional bazel functionality.
skylib_version = "0.9.0"
http_archive(
name = "bazel_skylib",
type = "tar.gz",
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel_skylib-{}.tar.gz".format (skylib_version, skylib_version),
sha256 = "1dde365491125a3db70731e25658dfdd3bc5dbdfd11b840b3e987ecf043c7ca0",
sha256 = "51b5105a760b353773f904d2bbc5e664d0987fbaf22265164de65d43e910d8ac",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.8.1/bazel-skylib-1.8.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.1/bazel-skylib-1.8.1.tar.gz",
],
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.check(minimum_bazel_version = "2.0.0")

http_archive(
name = "rules_cc",
sha256 = "e50f24506011841e2ac83d9733a0c7e058eb3a10a6e3e10baa9c7942ff5f4767",
strip_prefix = "rules_cc-0.2.2",
url = "https://github.com/bazelbuild/rules_cc/releases/download/0.2.2/rules_cc-0.2.2.tar.gz",
)

load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")

compatibility_proxy_repo()

http_archive(
name = "com_google_googletest",
sha256 = "65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c",
strip_prefix = "googletest-1.17.0",
url = "https://github.com/google/googletest/releases/download/v1.17.0/googletest-1.17.0.tar.gz",
)

http_archive(
name = "cpuinfo",
sha256 = "87fc79472eb30b734cbe700dfe3edc0bdb96c33e3ce44e48ab327bbd8783f07f",
strip_prefix = "cpuinfo-3c8b1533ac03dd6531ab6e7b9245d488f13a82a5",
url = "https://github.com/pytorch/cpuinfo/archive/3c8b1533ac03dd6531ab6e7b9245d488f13a82a5.tar.gz",
)
17 changes: 17 additions & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2020 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
#
# https://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 file for the Ruy project.

workspace(name = "com_google_ruy")
4 changes: 2 additions & 2 deletions example/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("//third_party/bazel_rules/rules_cc/cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")

package(
default_applicable_licenses = ["//third_party/ruy:license"],
default_applicable_licenses = ["@com_google_ruy//:license"],
licenses = ["notice"], # Apache 2.0
)

Expand Down
10 changes: 4 additions & 6 deletions ruy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//third_party/bazel_rules/rules_cc/cc:cc_library.bzl", "cc_library")
load("//third_party/bazel_rules/rules_cc/cc:cc_test.bzl", "cc_test")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
load(":build_defs.bzl", "ruy_copts", "ruy_copts_avx", "ruy_copts_avx2_fma", "ruy_copts_avx512")
load(":build_defs.oss.bzl", "ruy_linkopts_thread_standard_library")
load(":ruy_test.bzl", "ruy_benchmark", "ruy_test")
load(":ruy_test_ext.oss.bzl", "ruy_test_ext_defines", "ruy_test_ext_deps")

package(
default_applicable_licenses = ["//third_party/ruy:license"],
default_applicable_licenses = ["@com_google_ruy//:license"],
licenses = ["notice"], # Apache 2.0
)

Expand All @@ -34,10 +34,8 @@ config_setting(
name = "windows_msvc",
constraint_values = [
"@platforms//os:windows",
"@bazel_tools//tools/cpp:msvc",
],
flag_values = {
"//tools/cpp:compiler": "msvc",
},
)

config_setting(
Expand Down
2 changes: 1 addition & 1 deletion ruy/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Returns warnings flags to use for all ruy code.
def ruy_copts_warnings():
return select({
"//tools/cc_target_os:windows": [
"@platforms//os:windows": [
# We run into trouble on Windows toolchains with warning flags,
# as mentioned in the comments below on each flag.
# We could be more aggressive in enabling supported warnings on each
Expand Down
2 changes: 1 addition & 1 deletion ruy/build_defs.oss.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ def ruy_linkopts_thread_standard_library():
# with Bazel. Instead we do the following, which is copied from
# https://github.com/abseil/abseil-cpp/blob/1112609635037a32435de7aa70a9188dcb591458/absl/base/BUILD.bazel#L155
return select({
"//tools/cc_target_os:windows": [],
"@platforms//os:windows": [],
"//conditions:default": ["-pthread"],
})
3 changes: 1 addition & 2 deletions ruy/pack_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,7 @@ struct PackImpl<Path::kNeon, FixedKernelLayout<Order::kRowMajor, 1, 4>, float,
}
};
#endif // (RUY_PLATFORM_NEON_32)
#endif // (RUY_PLATFORM_NEON_64 || RUY_PLATFORM_NEON_32) && \
// RUY_OPT(ASM)
#endif // (RUY_PLATFORM_NEON_64 || RUY_PLATFORM_NEON_32) && RUY_OPT(ASM)

#if RUY_PLATFORM_NEON_64 && RUY_OPT(ASM)

Expand Down
6 changes: 3 additions & 3 deletions ruy/profiler/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# A minimalistic profiler sampling pseudo-stacks

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("//ruy:build_defs.oss.bzl", "ruy_linkopts_thread_standard_library")
load("//third_party/bazel_rules/rules_cc/cc:cc_library.bzl", "cc_library")
load("//third_party/bazel_rules/rules_cc/cc:cc_test.bzl", "cc_test")

package(
default_applicable_licenses = ["//third_party/ruy:license"],
default_applicable_licenses = ["@com_google_ruy//:license"],
licenses = ["notice"], # Apache 2.0
)

Expand Down
4 changes: 2 additions & 2 deletions ruy/ruy_test.bzl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Provides the ruy_test macro for type-parametrized tests.
"""ruy_test is a macro for building a test with multiple paths corresponding to tuples of types for LHS, RHS, accumulator and destination."""

load("//third_party/bazel_rules/rules_cc/cc:cc_binary.bzl", "cc_binary")
load("//third_party/bazel_rules/rules_cc/cc:cc_test.bzl", "cc_test")
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_test.bzl", "cc_test")

def ruy_test(name, srcs, lhs_rhs_accum_dst, copts, tags = [], deps = None):
for (lhs, rhs, accum, dst) in lhs_rhs_accum_dst:
Expand Down
Empty file removed third_party/BUILD
Empty file.
5 changes: 0 additions & 5 deletions third_party/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion third_party/cpuinfo
Submodule cpuinfo deleted from 082def
Loading