Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0
9.2.0
2 changes: 1 addition & 1 deletion .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
python-version: "3.12"
- name: Setup system python env
run: |
python -m pip install -r tests/vila/requirements_tvm_ffi_test.txt

Check warning on line 40 in .github/workflows/build-tests.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=llteco_vila&issues=AaBgSiRGoqiKrg7Scz1b&open=AaBgSiRGoqiKrg7Scz1b&pullRequest=15
- uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-cache: true
Expand All @@ -50,6 +50,6 @@
run: |
bazelisk --output_base="${{ matrix.legacy_output_base }}" build --noenable_bzlmod //tests/clim/... //tests/vila/...
- name: Install vila python package
run: python -m pip install -e python[test]
run: python -m pip install -e .[test]

Check warning on line 53 in .github/workflows/build-tests.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=llteco_vila&issues=AaBgSiRGoqiKrg7Scz1c&open=AaBgSiRGoqiKrg7Scz1c&pullRequest=15
- name: Test vila python package
run: python -m pytest --cov=python/vila python/tests
22 changes: 9 additions & 13 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ limitations under the License.
module(name = "vila", version = "1.0.6")

bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "bazel_features", version = "1.43.0")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "bazel_features", version = "1.50.0")
bazel_dep(name = "rules_cc", version = "0.2.22")
bazel_dep(name = "rules_python", version = "1.9.0")
bazel_dep(name = "rules_shell", version = "0.8.0")
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
bazel_dep(name = "googletest", version = "1.18.0", repo_name = "com_google_googletest")
bazel_dep(name = "google_benchmark", version = "1.9.2", repo_name = "com_google_benchmark")
bazel_dep(name = "pybind11_bazel", version = "3.0.0")
bazel_dep(name = "nanobind_bazel", version = "2.10.2")
bazel_dep(name = "fmt", version = "12.1.0")
bazel_dep(name = "platforms", version = "1.0.0") # python config depends platforms
bazel_dep(name = "platforms", version = "1.1.0") # python config depends platforms

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.defaults(python_version = "3.12")
Expand Down Expand Up @@ -59,16 +59,12 @@ use_repo(ittapi_ext, "ittapi")
hedron_ext = use_extension("@vila//bazel/bzlmod:extensions.bzl", "hedron_extension")
use_repo(hedron_ext, "hedron_compile_commands")

sycl_config_ext = use_extension("@vila//bazel/bzlmod:extensions.bzl", "sycl_configure_extension")
use_repo(sycl_config_ext, "local_config_sycl")
# SYCL is opt-in: consumers must configure and register the SYCL toolchain
# explicitly. To enable:
# sycl_config_ext = use_extension("@vila//bazel/bzlmod:extensions.bzl", "sycl_configure_extension")
# use_repo(sycl_config_ext, "local_config_sycl")
# register_toolchains("@local_config_sycl//:cc-toolchain-x64_sycl")

# TVM FFI support (optional - requires: pip install apache-tvm-ffi)
tvm_ffi_ext = use_extension("@vila//bazel/bzlmod:extensions.bzl", "tvm_ffi_extension")
use_repo(tvm_ffi_ext, "tvm_ffi")

register_toolchains(
# to use sycl specify: --config=sycl
"@local_config_sycl//:cc-toolchain-x64_sycl",
# Comment out the following line to use the bullseye on Windows
# "@local_config_bullseye//:cc-toolchain-x64_windows",
)
1 change: 1 addition & 0 deletions bazel/bzlmod/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def load_rangev3(ctx):
rangev3_version = "53c40dd628450c977ee1558285ff43e0613fa7a9"
http_archive(
name = "rangev3",
build_file = "@vila//bazel:rangev3.BUILD",
integrity = "sha256-3uvT1HqOcMb2maFCPul05Ku/AWqCAZEdYFQe4eRWFFQ=",
strip_prefix = "range-v3-%s" % rangev3_version,
url = "https://github.com/ericniebler/range-v3/archive/%s.zip" % rangev3_version,
Expand Down
2 changes: 1 addition & 1 deletion bazel/hlsl/hlsl_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ E-mail: wenyitang@outlook.com
Configure HLSL compilers
"""

load("@bazel_tools//tools/cpp:windows_cc_configure.bzl", "find_vc_path", "setup_vc_env_vars")
load("@rules_cc//cc/private/toolchain:windows_cc_configure.bzl", "find_vc_path", "setup_vc_env_vars")

def _hlsl_configure(ctx):
vc_path = find_vc_path(ctx)
Expand Down
2 changes: 2 additions & 0 deletions bazel/ittapi.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ cc_library(
]),
hdrs = [
"include/ittnotify.h",
"include/ittnotify-zca.h",
"include/jitprofiling.h",
"include/legacy/ittnotify.h",
"include/libittnotify.h",
],
defines = ["VILA_ITT_ENABLED=1"],
Expand Down
8 changes: 5 additions & 3 deletions bazel/pre_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Ref:
3. https://learn.microsoft.com/en-us/cpp/build/reference/yu-use-precompiled-header-file
"""

load("@rules_cc//cc:defs.bzl", "cc_library")

def _make_pch_impl(ctx):
ctx.actions.write(
output = ctx.outputs.pch_cxx,
Expand Down Expand Up @@ -88,11 +90,11 @@ def pch_library(name, pch_hdr, deps = [], cc_library_cb = None):
)
pch_lbl = Label(pch_hdr)
pch_path = "$(BINDIR)/" + pch_lbl.package.replace("/", "_") + "_" + pch_lbl.name + ".pch"
cc_library = native.cc_library if cc_library_cb == None else cc_library_cb
cc_library(
cc_library_rule = cc_library if cc_library_cb == None else cc_library_cb
cc_library_rule(
name = name,
srcs = [":" + name + "_pch"],
hdrs = [pch_header],
hdrs = [pch_header, pch_hdr],
copts = [
"/Yc" + pch_header,
"/FI" + pch_header,
Expand Down
45 changes: 45 additions & 0 deletions bazel/rangev3.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package(default_visibility = ["//visibility:public"])

load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "concepts",
hdrs = glob([
"include/concepts/**/*.hpp",
]),
includes = [
"include",
],
)

cc_library(
name = "meta",
hdrs = glob([
"include/meta/**/*.hpp",
]),
includes = [
"include",
],
)

cc_library(
name = "std",
hdrs = glob([
"include/std/**/*.hpp",
]),
includes = [
"include",
],
)

cc_library(
name = "range-v3",
hdrs = glob([
"include/range/v3/**/*.hpp",
]),
deps = [
":concepts",
":meta",
":std",
],
)
3 changes: 2 additions & 1 deletion bazel/toolchains/BUILD_bullseye.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ E-mail: wenyitang@outlook.com
custom cc toolchains for Windows
"""

load("@bazel_tools//tools/cpp:windows_cc_toolchain_config.bzl", "cc_toolchain_config")
load("@rules_cc//cc/private/toolchain:windows_cc_toolchain_config.bzl", "cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")

package(default_visibility = ["//visibility:public"])

Expand Down
1 change: 1 addition & 0 deletions bazel/toolchains/BUILD_sycl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ custom cc toolchains for Windows
"""

load("@vila//bazel/toolchains:sycl_cc_toolchain_config.bzl", "cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")

package(default_visibility = ["//visibility:public"])

Expand Down
2 changes: 1 addition & 1 deletion bazel/toolchains/BUILD_sycl_unix.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# This becomes the BUILD file for @local_config_cc// under non-BSD unixes.

load(":cc_toolchain_config.bzl", "cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")

package(default_visibility = ["//visibility:public"])

Expand Down
6 changes: 3 additions & 3 deletions bazel/toolchains/bullseye_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def _resolve_labels(repository_ctx, labels):
def _bullseye_configure(repository_ctx):
paths = _resolve_labels(repository_ctx, [
"@vila//bazel/toolchains:BUILD_bullseye.tpl",
"@bazel_tools//tools/cpp:windows_cc_toolchain_config.bzl",
"@bazel_tools//tools/cpp:vc_installation_error.bat.tpl",
"@bazel_tools//tools/cpp:clang_installation_error.bat.tpl",
"@rules_cc//cc/private/toolchain:windows_cc_toolchain_config.bzl",
"@rules_cc//cc/private/toolchain:vc_installation_error.bat.tpl",
"@rules_cc//cc/private/toolchain:clang_installation_error.bat.tpl",
])

if is_windows(repository_ctx):
Expand Down
16 changes: 8 additions & 8 deletions bazel/toolchains/sycl_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ def _sycl_configure(repository_ctx):
"@vila//bazel/toolchains:BUILD_sycl.tpl",
"@vila//bazel/toolchains:BUILD_sycl_unix.tpl",
# required by msvc
"@bazel_tools//tools/cpp:windows_cc_toolchain_config.bzl",
"@bazel_tools//tools/cpp:vc_installation_error.bat.tpl",
"@bazel_tools//tools/cpp:clang_installation_error.bat.tpl",
"@rules_cc//cc/private/toolchain:windows_cc_toolchain_config.bzl",
"@rules_cc//cc/private/toolchain:vc_installation_error.bat.tpl",
"@rules_cc//cc/private/toolchain:clang_installation_error.bat.tpl",
# required by unix
"@bazel_tools//tools/cpp:generate_system_module_map.sh",
"@bazel_tools//tools/cpp:armeabi_cc_toolchain_config.bzl",
"@bazel_tools//tools/cpp:unix_cc_toolchain_config.bzl",
"@bazel_tools//tools/cpp:linux_cc_wrapper.sh.tpl",
"@bazel_tools//tools/cpp:osx_cc_wrapper.sh.tpl",
"@rules_cc//cc/private/toolchain:generate_system_module_map.sh",
"@rules_cc//cc/private/toolchain:armeabi_cc_toolchain_config.bzl",
"@rules_cc//cc/private/toolchain:unix_cc_toolchain_config.bzl",
"@rules_cc//cc/private/toolchain:linux_cc_wrapper.sh.tpl",
"@rules_cc//cc/private/toolchain:osx_cc_wrapper.sh.tpl",
])

repo_name = repository_ctx.name.split("~")[-1]
Expand Down
3 changes: 2 additions & 1 deletion bazel/toolchains/sycl_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A Starlark cc_toolchain configuration rule for Windows.

load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"@rules_cc//cc:cc_toolchain_config_lib.bzl",
"action_config",
"artifact_name_pattern",
"env_entry",
Expand All @@ -32,6 +32,7 @@ load(
"variable_with_value",
"with_feature_set",
)
load("@rules_cc//cc/toolchains:cc_toolchain_config_info.bzl", "CcToolchainConfigInfo")
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")

all_compile_actions = [
Expand Down
10 changes: 5 additions & 5 deletions bazel/toolchains/unix_toolchain_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""Configuring the C++ toolchain on Unix platforms."""

load(
"@bazel_tools//tools/cpp:lib_cc_configure.bzl",
"@rules_cc//cc/private/toolchain:lib_cc_configure.bzl",
"auto_configure_fail",
"auto_configure_warning",
"auto_configure_warning_maybe",
Expand Down Expand Up @@ -314,12 +314,12 @@ def find_cc(repository_ctx, overriden_tools):
def configure_unix_toolchain(repository_ctx, paths, cpu_value, overriden_tools):
"""Configure C++ toolchain on Unix platforms."""
repository_ctx.symlink(
paths["@bazel_tools//tools/cpp:unix_cc_toolchain_config.bzl"],
paths["@rules_cc//cc/private/toolchain:unix_cc_toolchain_config.bzl"],
"cc_toolchain_config.bzl",
)

repository_ctx.symlink(
paths["@bazel_tools//tools/cpp:armeabi_cc_toolchain_config.bzl"],
paths["@rules_cc//cc/private/toolchain:armeabi_cc_toolchain_config.bzl"],
"armeabi_cc_toolchain_config.bzl",
)

Expand Down Expand Up @@ -380,7 +380,7 @@ def configure_unix_toolchain(repository_ctx, paths, cpu_value, overriden_tools):
))

cc_wrapper_src = (
"@bazel_tools//tools/cpp:osx_cc_wrapper.sh.tpl" if darwin else "@bazel_tools//tools/cpp:linux_cc_wrapper.sh.tpl"
"@rules_cc//cc/private/toolchain:osx_cc_wrapper.sh.tpl" if darwin else "@rules_cc//cc/private/toolchain:linux_cc_wrapper.sh.tpl"
)
repository_ctx.template(
"cc_wrapper.sh",
Expand Down Expand Up @@ -524,7 +524,7 @@ def configure_unix_toolchain(repository_ctx, paths, cpu_value, overriden_tools):
repository_ctx.file("module.modulemap", _generate_system_module_map(
repository_ctx,
builtin_include_directories,
paths["@bazel_tools//tools/cpp:generate_system_module_map.sh"],
paths["@rules_cc//cc/private/toolchain:generate_system_module_map.sh"],
))
extra_flags_per_feature = {}
if is_clang:
Expand Down
12 changes: 6 additions & 6 deletions bazel/toolchains/windows_toolchain_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ E-mail: wenyi.tang@intel.com
"""

load(
"@bazel_tools//tools/cpp:lib_cc_configure.bzl",
"@rules_cc//cc/private/toolchain:lib_cc_configure.bzl",
"auto_configure_fail",
"auto_configure_warning",
"auto_configure_warning_maybe",
Expand All @@ -15,7 +15,7 @@ load(
"write_builtin_include_directory_paths",
)
load(
"@bazel_tools//tools/cpp:windows_cc_configure.bzl",
"@rules_cc//cc/private/toolchain:windows_cc_configure.bzl",
"find_llvm_path",
"find_llvm_tool",
"find_msvc_tool",
Expand Down Expand Up @@ -244,7 +244,7 @@ def get_msvc_vars(repository_ctx, paths, target_arch = "x64", msvc_vars_x64 = No
if not vc_path:
repository_ctx.template(
"vc_installation_error_" + target_arch + ".bat",
paths["@bazel_tools//tools/cpp:vc_installation_error.bat.tpl"],
paths["@rules_cc//cc/private/toolchain:vc_installation_error.bat.tpl"],
{"%{vc_error_message}": ""},
)
else:
Expand All @@ -260,7 +260,7 @@ def get_msvc_vars(repository_ctx, paths, target_arch = "x64", msvc_vars_x64 = No
])
repository_ctx.template(
"vc_installation_error_" + target_arch + ".bat",
paths["@bazel_tools//tools/cpp:vc_installation_error.bat.tpl"],
paths["@rules_cc//cc/private/toolchain:vc_installation_error.bat.tpl"],
{"%{vc_error_message}": message},
)

Expand Down Expand Up @@ -356,7 +356,7 @@ def get_clang_cl_vars(repository_ctx, paths, msvc_vars, target_arch):
elif not llvm_path:
repository_ctx.template(
"clang_installation_error.bat",
paths["@bazel_tools//tools/cpp:clang_installation_error.bat.tpl"],
paths["@rules_cc//cc/private/toolchain:clang_installation_error.bat.tpl"],
{"%{clang_error_message}": ""},
)
error_script = "clang_installation_error.bat"
Expand All @@ -372,7 +372,7 @@ def get_clang_cl_vars(repository_ctx, paths, msvc_vars, target_arch):
])
repository_ctx.template(
"clang_installation_error.bat",
paths["@bazel_tools//tools/cpp:clang_installation_error.bat.tpl"],
paths["@rules_cc//cc/private/toolchain:clang_installation_error.bat.tpl"],
{"%{clang_error_message}": message},
)
error_script = "clang_installation_error.bat"
Expand Down
Loading
Loading