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

highway: add version 1.2.0 #24197

Merged
merged 2 commits into from
Jun 17, 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
9 changes: 9 additions & 0 deletions recipes/highway/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.2.0":
url: "https://github.com/google/highway/archive/1.2.0.tar.gz"
sha256: "7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343"
"1.1.0":
url: "https://github.com/google/highway/archive/1.1.0.tar.gz"
sha256: "354a8b4539b588e70b98ec70844273e3f2741302c4c377bcc4e81b3d1866f7c9"
Expand Down Expand Up @@ -32,3 +35,9 @@
"0.12.2":
url: "https://github.com/google/highway/archive/0.12.2.tar.gz"
sha256: "e1d47ce510429fdcf31f41697ca74fb0dcd59d933196e531a86d51751a56f4cc"
patches:
"1.2.0":
- patch_file: "patches/1.2.0-0001-fix-dllexport.patch"
patch_description: "fix incorrect DLLEXPORT"
patch_type: "backport"

Check warning on line 42 in recipes/highway/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. found arbitrary text in patch_type: backport ^ (line: 42)
patch_source: "https://github.com/google/highway/pull/2229"
91 changes: 91 additions & 0 deletions recipes/highway/all/patches/1.2.0-0001-fix-dllexport.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
diff --git a/hwy/contrib/thread_pool/topology.cc b/hwy/contrib/thread_pool/topology.cc
index 3d24f4f..17f3563 100644
--- a/hwy/contrib/thread_pool/topology.cc
+++ b/hwy/contrib/thread_pool/topology.cc
@@ -64,7 +64,7 @@

namespace hwy {

-HWY_DLLEXPORT bool HaveThreadingSupport() {
+HWY_CONTRIB_DLLEXPORT bool HaveThreadingSupport() {
#if HWY_ARCH_WASM
return emscripten_has_threading_support() != 0;
#else
@@ -72,7 +72,7 @@ HWY_DLLEXPORT bool HaveThreadingSupport() {
#endif
}

-HWY_DLLEXPORT size_t TotalLogicalProcessors() {
+HWY_CONTRIB_DLLEXPORT size_t TotalLogicalProcessors() {
size_t lp = 0;
#if HWY_ARCH_WASM
const int num_cores = emscripten_num_logical_cores();
@@ -111,7 +111,7 @@ HWY_DLLEXPORT size_t TotalLogicalProcessors() {
#include <sys/syscall.h>
#endif

-HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) {
+HWY_CONTRIB_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) {
#if HWY_OS_WIN
// Only support the first 64 because WINE does not support processor groups.
const HANDLE hThread = GetCurrentThread();
@@ -173,7 +173,7 @@ HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps) {
#endif
}

-HWY_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps) {
+HWY_CONTRIB_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps) {
#if HWY_OS_WIN
const HANDLE hThread = GetCurrentThread();
const DWORD_PTR prev = SetThreadAffinityMask(hThread, lps.Get64());
@@ -385,7 +385,7 @@ std::vector<PerPackage> DetectPackages(std::vector<Topology::LP>& lps) {
} // namespace
#endif // HWY_OS_LINUX

-HWY_DLLEXPORT Topology::Topology() {
+HWY_CONTRIB_DLLEXPORT Topology::Topology() {
#if HWY_OS_LINUX
lps.resize(TotalLogicalProcessors());
const std::vector<PerPackage>& per_package = DetectPackages(lps);
diff --git a/hwy/contrib/thread_pool/topology.h b/hwy/contrib/thread_pool/topology.h
index 95b0835..f80fc47 100644
--- a/hwy/contrib/thread_pool/topology.h
+++ b/hwy/contrib/thread_pool/topology.h
@@ -28,7 +28,7 @@
namespace hwy {

// Returns false if std::thread should not be used.
-HWY_DLLEXPORT bool HaveThreadingSupport();
+HWY_CONTRIB_DLLEXPORT bool HaveThreadingSupport();

// Upper bound on logical processors, including hyperthreads.
static constexpr size_t kMaxLogicalProcessors = 1024; // matches glibc
@@ -38,12 +38,12 @@ using LogicalProcessorSet = BitSet4096<kMaxLogicalProcessors>;

// Returns false, or sets `lps` to all logical processors which are online and
// available to the current thread.
-HWY_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps);
+HWY_CONTRIB_DLLEXPORT bool GetThreadAffinity(LogicalProcessorSet& lps);

// Ensures the current thread can only run on the logical processors in `lps`.
// Returns false if not supported (in particular on Apple), or if the
// intersection between `lps` and `GetThreadAffinity` is the empty set.
-HWY_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps);
+HWY_CONTRIB_DLLEXPORT bool SetThreadAffinity(const LogicalProcessorSet& lps);

// Returns false, or ensures the current thread will only run on `lp`, which
// must not exceed `TotalLogicalProcessors`. Note that this merely calls
@@ -58,11 +58,11 @@ static inline bool PinThreadToLogicalProcessor(size_t lp) {
// provided by the hardware clamped to `kMaxLogicalProcessors`.
// These processors are not necessarily all usable; you can determine which are
// via GetThreadAffinity().
-HWY_DLLEXPORT size_t TotalLogicalProcessors();
+HWY_CONTRIB_DLLEXPORT size_t TotalLogicalProcessors();

struct Topology {
// Caller must check packages.empty(); if so, do not use any fields.
- HWY_DLLEXPORT Topology();
+ HWY_CONTRIB_DLLEXPORT Topology();

// Clique of cores with lower latency to each other. On Apple M1 these are
// four cores sharing an L2. On Zen4 these 'CCX' are up to eight cores sharing
2 changes: 2 additions & 0 deletions recipes/highway/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.2.0":
folder: all
"1.1.0":
folder: all
"1.0.7":
Expand Down
Loading