Skip to content

Commit

Permalink
Merge pull request #513 from kroma-network/build/add-openmp-flags-to-…
Browse files Browse the repository at this point in the history
…goldilocks

build: add openmp flags to goldilocks
  • Loading branch information
chokobole authored Aug 9, 2024
2 parents e3dc4dd + 3d47cee commit ec6c6f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit ec6c6f8

Please sign in to comment.