From nobody Sat Oct 30 00:37:59 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DF3A81837653; Sat, 30 Oct 2021 00:38:09 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hh0l55Wlqz3GSf; Sat, 30 Oct 2021 00:38:09 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf1-x431.google.com with SMTP id t184so10709796pfd.0; Fri, 29 Oct 2021 17:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:reply-to:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=gTMkp6IJVCg+eH7dJxp0eH9mnSS/UpFE8EQhq7okPG8=; b=Q56AitnsJoayTAZdg9/VH4GGkZDlyJFZyC3QtC+mDMLgXAxoGO4zripDFxqVv7Wb0U +ko9RSHYiymIdRkAtH3lCp8Kpc/dQLNbIBpZuce1Dz4C2vt2N/0Qc48Km2KkQRxrG6tX CHU7gUQpQUXMtQPzpWCwUFgLuaoY41Zh9JkNKSBnQqk2uxmmLInPFdE3jyJUNkjYUq5f fWRSFbv2DZdf1PVWZZHZ1eS/J0LC/ckc5P3Jcb4zBwWed3GoDfHMFkrYVOSOSyqvS18J he5rHJmVryIfgcZYkfy/zLI04GdH5CzDjHa1119ZI4sXkJ4xVjnm5FZVAxTr7u5QG3HA 7pZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :reply-to:subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=gTMkp6IJVCg+eH7dJxp0eH9mnSS/UpFE8EQhq7okPG8=; b=kW2Vftd7IIx1p5xZLAv1iium0PzthjoLEY7kSGDe7zHj9qwVoAxqllHv0/kLqmWbpK BYwEECA9SqJk5R0Mruv5AnL564WpSUOv729BllehMss9m9ZRhHD2V9XPjSy5IXvqjWXH qyGMFiAcz3+omnKqVPIKKwK/YB/dmw+kHoy7pQvyn920nMUJCo8r1BbuTGopWJ5QJz1+ ugJAMqb12GGLDmMx927JQfB73kxqg+XXLv/D+SLA1ao8fO/63k0zKo7/zuO82pcmXB+8 Deb/tM4jNdUq7Y+ekl7ozJCzMxvXkR/TcEkTyG0kPYnklzHSAnOBGFvPg2O+NXjP8acY 9LSA== X-Gm-Message-State: AOAM530jrDZFiOcj/lzyobyzY4qsYVKnoBlNYxjFB2DGCD4duobdEDnO 9+PG+dbo1XqMT88u9VI8oSAhA6Fa2lQ= X-Google-Smtp-Source: ABdhPJwJyC7xBGxjF0DJZYuFcf8GQttS3M0FloyV+xGMbLPwUg2aJL2/ZOZa7O5UPaWFWbXUEqgbOQ== X-Received: by 2002:a05:6a00:1681:b0:46f:6fc0:e515 with SMTP id k1-20020a056a00168100b0046f6fc0e515mr14078500pfc.11.1635554283166; Fri, 29 Oct 2021 17:38:03 -0700 (PDT) Received: from ?IPV6:2403:5807:1b:1:29fd:8863:3b42:c493? (2403-5807-1b-1-29fd-8863-3b42-c493.ip6.aussiebb.net. [2403:5807:1b:1:29fd:8863:3b42:c493]) by smtp.gmail.com with ESMTPSA id h4sm11564094pjm.14.2021.10.29.17.38.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Oct 2021 17:38:02 -0700 (PDT) Sender: Kubilay Kocak Message-ID: Date: Sat, 30 Oct 2021 11:37:59 +1100 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Thunderbird/95.0a1 Reply-To: koobs@FreeBSD.org Subject: Re: git: 3b8065a2adbf - main - math/fastops: new port had been added (+) Content-Language: en-US To: Alexey Dokuchaev , ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org References: <202110291052.19TAqnQh062468@gitrepo.freebsd.org> From: Kubilay Kocak In-Reply-To: <202110291052.19TAqnQh062468@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Hh0l55Wlqz3GSf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 29/10/2021 9:52 pm, Alexey Dokuchaev wrote: > The branch main has been updated by danfe: > > URL: https://cgit.FreeBSD.org/ports/commit/?id=3b8065a2adbf0f8acae9c980961cb5491034a1ad > > commit 3b8065a2adbf0f8acae9c980961cb5491034a1ad > Author: Alexey Dokuchaev > AuthorDate: 2021-10-29 10:49:48 +0000 > Commit: Alexey Dokuchaev > CommitDate: 2021-10-29 10:49:55 +0000 > > math/fastops: new port had been added (+) For new ports, the COMMENT of the port is great for the git summary Prefixing a [NEW] also saves summary space for new ports [NEW] math/fastops: AVX/AVX2-accelerated bulk call of math functions If one is a stickler/purist for 'imperative' first words: Add math/fastops: AVX/AVX2-accelerated bulk call of math functions > > This small library enables acceleration of bulk calls of certain math > functions on AVX and AVX2 hardware. Currently supported operations are > exp, log, sigmoid, and tanh. The library is designed with extensibility > in mind. > > Restrict the port to amd64 as it's inherently useless anywhere else and > does not even build at least on i386. > > WWW: https://github.com/yandex/fastops > --- > math/Makefile | 1 + > math/fastops/Makefile | 20 ++++++++++++++ > math/fastops/distinfo | 3 +++ > math/fastops/files/patch-CMakeLists.txt | 13 +++++++++ > .../files/patch-fastops_core_SIMDFunctions.h | 10 +++++++ > math/fastops/files/patch-fastops_core_avx__id.cpp | 31 ++++++++++++++++++++++ > math/fastops/pkg-descr | 6 +++++ > math/fastops/pkg-plist | 11 ++++++++ > 8 files changed, 95 insertions(+) > > diff --git a/math/Makefile b/math/Makefile > index d5e545695f82..1fe9497f83f0 100644 > --- a/math/Makefile > +++ b/math/Makefile > @@ -280,6 +280,7 @@ > SUBDIR += facile > SUBDIR += faiss > SUBDIR += fann > + SUBDIR += fastops > SUBDIR += fcl > SUBDIR += fcl05 > SUBDIR += fflas-ffpack > diff --git a/math/fastops/Makefile b/math/fastops/Makefile > new file mode 100644 > index 000000000000..3d039e2b74af > --- /dev/null > +++ b/math/fastops/Makefile > @@ -0,0 +1,20 @@ > +# Created by: Alexey Dokuchaev > + > +PORTNAME= fastops > +PORTVERSION= 1.0.0 > +DISTVERSIONPREFIX= v > +CATEGORIES= math > + > +MAINTAINER= danfe@FreeBSD.org > +COMMENT= AVX/AVX2-accelerated bulk call of math functions > + > +LICENSE= MIT > + > +ONLY_FOR_ARCHS= amd64 > +ONLY_FOR_ARCHS_REASON= uses AVX and AVX2 instructions > + > +USES= cmake compiler:c++17-lang > +USE_GITHUB= yes > +GH_ACCOUNT= yandex > + > +.include > diff --git a/math/fastops/distinfo b/math/fastops/distinfo > new file mode 100644 > index 000000000000..74e54d2875f7 > --- /dev/null > +++ b/math/fastops/distinfo > @@ -0,0 +1,3 @@ > +TIMESTAMP = 1588749823 > +SHA256 (yandex-fastops-v1.0.0_GH0.tar.gz) = 16cd75b85717c60ff9552e140ba59dfc0d49217633a9c8c8614e9d001ce1303b > +SIZE (yandex-fastops-v1.0.0_GH0.tar.gz) = 266428 > diff --git a/math/fastops/files/patch-CMakeLists.txt b/math/fastops/files/patch-CMakeLists.txt > new file mode 100644 > index 000000000000..3198b10cb280 > --- /dev/null > +++ b/math/fastops/files/patch-CMakeLists.txt > @@ -0,0 +1,13 @@ > +--- CMakeLists.txt.orig 2020-05-06 07:23:43 UTC > ++++ CMakeLists.txt > +@@ -3,9 +3,8 @@ cmake_minimum_required(VERSION 2.6) > + project(fastops) > + > + include_directories("${PROJECT_SOURCE_DIR}") > +-set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/install) > + > +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3") > ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") > + > + # Specify the C++ 17 language standard for > + # any version of Microsoft Visual C++ Compiler > diff --git a/math/fastops/files/patch-fastops_core_SIMDFunctions.h b/math/fastops/files/patch-fastops_core_SIMDFunctions.h > new file mode 100644 > index 000000000000..82a90e4559b8 > --- /dev/null > +++ b/math/fastops/files/patch-fastops_core_SIMDFunctions.h > @@ -0,0 +1,10 @@ > +--- fastops/core/SIMDFunctions.h.orig 2020-05-06 07:23:43 UTC > ++++ fastops/core/SIMDFunctions.h > +@@ -9,6 +9,7 @@ > + #include > + #include > + #include > ++#include > + > + #if defined(__clang_major__) && !defined(__apple_build_version__) && __clang_major__ >= 8 > + # define Y_HAVE_NEW_INTRINSICS > diff --git a/math/fastops/files/patch-fastops_core_avx__id.cpp b/math/fastops/files/patch-fastops_core_avx__id.cpp > new file mode 100644 > index 000000000000..0ea3e89ab7ab > --- /dev/null > +++ b/math/fastops/files/patch-fastops_core_avx__id.cpp > @@ -0,0 +1,31 @@ > +--- fastops/core/avx_id.cpp.orig 2020-05-06 07:23:43 UTC > ++++ fastops/core/avx_id.cpp > +@@ -36,23 +36,23 @@ namespace NFastOps { > + // This in EBX of cpuid(7) > + static constexpr uint32_t AVX2_BIT = 0x00000020; > + > +- static void CpuId(int32_t op, int32_t* res) noexcept { > ++ static void CpuId(int32_t op, int32_t sub, int32_t* res) noexcept { > + #if defined(_MSC_VER) && !defined(__clang__) > +- __cpuid((int*)res, op); > ++ __cpuidex((int*)res, op, sub); > + #else > +- __cpuid(op, res[EAX], res[EBX], res[ECX], res[EDX]); > ++ __cpuid_count(op, sub, res[EAX], res[EBX], res[ECX], res[EDX]); > + #endif > + } > + > + bool IsAVXEnabled() noexcept { > + int32_t info[NREGS]; > +- CpuId(1, info); > ++ CpuId(1, 0, info); > + return (info[ECX] & OSXSAVE_BIT) && IsYMMSaveEnabled() && (info[ECX] & AVX_BIT); > + } > + > + bool IsAVX2Enabled() noexcept { > + int32_t info[NREGS]; > +- CpuId(7, info); > ++ CpuId(7, 0, info); > + return info[EBX] & AVX2_BIT; > + } > + } > diff --git a/math/fastops/pkg-descr b/math/fastops/pkg-descr > new file mode 100644 > index 000000000000..b3b4a059be88 > --- /dev/null > +++ b/math/fastops/pkg-descr > @@ -0,0 +1,6 @@ > +This small library enables acceleration of bulk calls of certain math > +functions on AVX and AVX2 hardware. Currently supported operations are > +exp, log, sigmoid, and tanh. The library is designed with extensibility > +in mind. > + > +WWW: https://github.com/yandex/fastops > diff --git a/math/fastops/pkg-plist b/math/fastops/pkg-plist > new file mode 100644 > index 000000000000..736d23848c3a > --- /dev/null > +++ b/math/fastops/pkg-plist > @@ -0,0 +1,11 @@ > +bin/benchmark > +bin/eval > +bin/fastops_test > +include/avx/ops_avx.h > +include/avx2/ops_avx2.h > +include/core/FastIntrinsics.h > +include/core/SIMDFunctions.h > +include/core/avx_id.h > +include/fastops.h > +include/plain/ops_plain.h > +lib/libfastops.a >