Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add openmp flags to goldilocks #513

Merged
merged 2 commits into from
Aug 9, 2024
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
4 changes: 2 additions & 2 deletions bazel/tachyon_cc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def tachyon_rtti(force_rtti):
def tachyon_simd_copts():
return if_linux_x86_64(["-msse3"])

def tachyon_openmp():
def tachyon_openmp_copts():
return select({
"@kroma_network_tachyon//:tachyon_has_openmp_on_macos": ["-Xclang -fopenmp"],
"@kroma_network_tachyon//:tachyon_has_openmp": ["-fopenmp"],
"//conditions:default": [],
})

def tachyon_copts(safe_code = True):
return tachyon_warnings(safe_code) + tachyon_hide_symbols() + tachyon_simd_copts() + tachyon_openmp()
return tachyon_warnings(safe_code) + tachyon_hide_symbols() + tachyon_simd_copts() + tachyon_openmp_copts()

def tachyon_cxxopts(safe_code = True, force_exceptions = False, force_rtti = False):
return tachyon_copts(safe_code) + tachyon_exceptions(force_exceptions) + tachyon_rtti(force_rtti)
Expand Down
4 changes: 3 additions & 1 deletion third_party/goldilocks/goldilocks.BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@kroma_network_tachyon//bazel:tachyon.bzl", "if_has_avx512")
load("@kroma_network_tachyon//bazel:tachyon_cc.bzl", "tachyon_openmp_copts", "tachyon_openmp_linkopts")
load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])
Expand All @@ -19,7 +20,8 @@ cc_library(
copts = if_has_avx512(
["-mavx512f"],
["-mavx2"],
),
) + tachyon_openmp_copts(),
linkopts = tachyon_openmp_linkopts(),
defines = if_has_avx512(["__AVX512__"]),
include_prefix = "third_party/goldilocks/include",
includes = ["src"],
Expand Down