Date: Sun, 23 Aug 2020 00:43:24 +0000 (UTC) From: Piotr Kubaj <pkubaj@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r545799 - in head/math/onednn: . files Message-ID: <202008230043.07N0hORf075500@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pkubaj Date: Sun Aug 23 00:43:24 2020 New Revision: 545799 URL: https://svnweb.freebsd.org/changeset/ports/545799 Log: math/onednn: enable native powerpc64 In version 1.6, upstream added native support for powerpc64, without using generic code. Enable that instead of using generic code. Also patch platform.cmake not to add -mcpu=native for aarch64. Modified: head/math/onednn/Makefile head/math/onednn/files/patch-CMakeLists.txt head/math/onednn/files/patch-cmake_platform.cmake Modified: head/math/onednn/Makefile ============================================================================== --- head/math/onednn/Makefile Sun Aug 23 00:00:28 2020 (r545798) +++ head/math/onednn/Makefile Sun Aug 23 00:43:24 2020 (r545799) @@ -3,6 +3,7 @@ PORTNAME= onednn DISTVERSIONPREFIX= v DISTVERSION= 1.6.1 +PORTREVISION= CATEGORIES= math # machine-learning MAINTAINER= yuri@FreeBSD.org @@ -33,7 +34,7 @@ CXXFLAGS_i386= -msse4.1 .include <bsd.port.options.mk> -.if ${ARCH} != aarch64 && ${ARCH} != amd64 +.if ${ARCH} != aarch64 && ${ARCH} != amd64 && ${ARCH} != powerpc64 CMAKE_ARGS+= -DDNNL_TARGET_ARCH:STRING="GENERIC" .endif Modified: head/math/onednn/files/patch-CMakeLists.txt ============================================================================== --- head/math/onednn/files/patch-CMakeLists.txt Sun Aug 23 00:00:28 2020 (r545798) +++ head/math/onednn/files/patch-CMakeLists.txt Sun Aug 23 00:43:24 2020 (r545799) @@ -1,6 +1,15 @@ ---- CMakeLists.txt.orig 2020-03-31 16:33:27 UTC +--- CMakeLists.txt.orig 2020-08-06 03:36:08 UTC +++ CMakeLists.txt -@@ -92,7 +92,9 @@ include("cmake/mkldnn_compat.cmake") +@@ -91,7 +91,7 @@ endif() + if(NOT DNNL_TARGET_ARCH) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") + set(DNNL_TARGET_ARCH "AARCH64") +- elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64.*|PPC64.*)") ++ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64.*|PPC64.*|powerpc64.*)") + set(DNNL_TARGET_ARCH "PPC64") + else() + set(DNNL_TARGET_ARCH "X64") +@@ -113,7 +113,9 @@ include("cmake/mkldnn_compat.cmake") include("cmake/utils.cmake") include("cmake/options.cmake") @@ -9,9 +18,9 @@ + include("cmake/OpenMP.cmake") +endif() include("cmake/TBB.cmake") + include("cmake/Threadpool.cmake") include("cmake/OpenCL.cmake") - include("cmake/platform.cmake") -@@ -133,8 +135,12 @@ include(GNUInstallDirs) +@@ -156,8 +158,12 @@ include(GNUInstallDirs) include(CMakePackageConfigHelpers) add_subdirectory(src) Modified: head/math/onednn/files/patch-cmake_platform.cmake ============================================================================== --- head/math/onednn/files/patch-cmake_platform.cmake Sun Aug 23 00:00:28 2020 (r545798) +++ head/math/onednn/files/patch-cmake_platform.cmake Sun Aug 23 00:43:24 2020 (r545799) @@ -1,6 +1,6 @@ ---- cmake/platform.cmake.orig 2020-06-05 21:56:56 UTC +--- cmake/platform.cmake.orig 2020-08-06 03:36:08 UTC +++ cmake/platform.cmake -@@ -104,10 +104,10 @@ elseif(UNIX OR MINGW) +@@ -104,16 +104,16 @@ elseif(UNIX OR MINGW) if(DNNL_TARGET_ARCH STREQUAL "AARCH64") set(DEF_ARCH_OPT_FLAGS "-O3") # For native compilation tune for the host processor @@ -8,13 +8,32 @@ + if (FALSE AND CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) append(DEF_ARCH_OPT_FLAGS "-mcpu=native") endif() + elseif(DNNL_TARGET_ARCH STREQUAL "PPC64") + set(DEF_ARCH_OPT_FLAGS "-O3") + # For native compilation tune for the host processor +- if (CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) ++ if (FALSE AND CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) + append(DEF_ARCH_OPT_FLAGS "-mcpu=native") + endif() - elseif(DNNL_TARGET_ARCH STREQUAL "X64") + elseif(FALSE AND DNNL_TARGET_ARCH STREQUAL "X64") set(DEF_ARCH_OPT_FLAGS "-msse4.1") endif() # Clang cannot vectorize some loops with #pragma omp simd and gets -@@ -159,7 +159,7 @@ elseif(UNIX OR MINGW) - if (CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) +@@ -162,17 +162,17 @@ elseif(UNIX OR MINGW) + if(DNNL_TARGET_ARCH STREQUAL "AARCH64") + set(DEF_ARCH_OPT_FLAGS "-O3") + # For native compilation tune for the host processor +- if (CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) ++ if (FALSE AND CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) + append(DEF_ARCH_OPT_FLAGS "-mcpu=native") + endif() + elseif(DNNL_TARGET_ARCH STREQUAL "PPC64") + set(DEF_ARCH_OPT_FLAGS "-O3") + # In GCC, -ftree-vectorize is turned on under -O3 since 2007. + # For native compilation tune for the host processor +- if (CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) ++ if (FALSE AND CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) append(DEF_ARCH_OPT_FLAGS "-mcpu=native") endif() - elseif(DNNL_TARGET_ARCH STREQUAL "X64")
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008230043.07N0hORf075500>