From owner-svn-ports-head@freebsd.org Fri Nov 6 18:51:37 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 646E34468D3; Fri, 6 Nov 2020 18:51:37 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CSTy12VBXz4cYh; Fri, 6 Nov 2020 18:51:37 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 486D429BBE; Fri, 6 Nov 2020 18:51:37 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A6Ipb2Q078049; Fri, 6 Nov 2020 18:51:37 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A6Ipadu078046; Fri, 6 Nov 2020 18:51:36 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <202011061851.0A6Ipadu078046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Fri, 6 Nov 2020 18:51:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r554310 - in head/math/onednn: . files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/math/onednn: . files X-SVN-Commit-Revision: 554310 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2020 18:51:37 -0000 Author: yuri Date: Fri Nov 6 18:51:36 2020 New Revision: 554310 URL: https://svnweb.freebsd.org/changeset/ports/554310 Log: math/onednn: Add options for SIMD optimization level; Use standard BUILD_TESTING cmake variable instead of BUILD_TESTS 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 Fri Nov 6 18:38:46 2020 (r554309) +++ head/math/onednn/Makefile Fri Nov 6 18:51:36 2020 (r554310) @@ -3,7 +3,7 @@ PORTNAME= onednn DISTVERSIONPREFIX= v DISTVERSION= 1.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= math # machine-learning MAINTAINER= yuri@FreeBSD.org @@ -23,30 +23,39 @@ GH_ACCOUNT= oneapi-src GH_PROJECT= oneDNN USE_LDCONFIG= yes +CMAKE_OFF= BUILD_TESTING + OPTIONS_DEFINE= OPENMP -OPTIONS_DEFAULT= OPENMP +OPTIONS_DEFAULT= OPENMP SIMD_DEFAULT +OPTIONS_SINGLE= SIMD +OPTIONS_SINGLE_SIMD= SIMD_DEFAULT SIMD_NATIVE OPENMP_CMAKE_BOOL= USE_OPENMP OPENMP_BROKEN_OFF= still requires omp.h, see https://github.com/intel/mkl-dnn/issues/581 -CXXFLAGS_amd64= -msse4.1 -CXXFLAGS_i386= -msse4.1 +SIMD_DEFAULT_DESC= Default, no non-default SIMD instructions are used -CXXFLAGS:= ${CXXFLAGS:S/-O2/-O3/} # clang writes wrong binary code when -O2 optimization is used and one testcase is failing, see https://github.com/oneapi-src/oneDNN/issues/873#issuecomment-722778910 +SIMD_NATIVE_DESC= Optimize for this CPU +SIMD_NATIVE_CXXFLAGS= -march=native -.include +SIMD_SSE41_DESC= Use SSE4.1 instructions +SIMD_SSE41_CXXFLAGS= -msse4.1 -.if ${ARCH} != aarch64 && ${ARCH} != amd64 && ${ARCH} != powerpc64 -CMAKE_ARGS+= -DDNNL_TARGET_ARCH:STRING="GENERIC" +ARCH_LOCAL!= /usr/bin/uname -p # because OPTIONS_SINGLE_SIMD doesn't support per-ARCH values OPTIONS_SINGLE_SIMD_{arch}, like OPTIONS_DEFINE_{arch} + +.if ${ARCH_LOCAL} == i386 || ${ARCH_LOCAL} == amd64 +OPTIONS_SINGLE_SIMD+= SIMD_SSE41 .endif +CXXFLAGS:= ${CXXFLAGS:S/-O2/-O3/} # clang writes wrong binary code when -O2 optimization is used and one testcase is failing, see https://github.com/oneapi-src/oneDNN/issues/873#issuecomment-722778910 + post-install: @${RM} -r ${STAGEDIR}${PREFIX}/share/doc do-test: # some tests are known to fail: https://github.com/intel/mkl-dnn/issues/350 (the upstream failed to reproduce it and closed the report) @${REINPLACE_CMD} 's| /bin/bash | ${LOCALBASE}/bin/bash |' ${WRKSRC}/tests/CMakeLists.txt @cd ${BUILD_WRKSRC} && \ - ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DBUILD_TESTS=ON ${CMAKE_SOURCE_PATH} && \ + ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DBUILD_TESTING=ON ${CMAKE_SOURCE_PATH} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} test Modified: head/math/onednn/files/patch-CMakeLists.txt ============================================================================== --- head/math/onednn/files/patch-CMakeLists.txt Fri Nov 6 18:38:46 2020 (r554309) +++ head/math/onednn/files/patch-CMakeLists.txt Fri Nov 6 18:51:36 2020 (r554310) @@ -20,7 +20,7 @@ +if(BUILD_EXAMPLES) + add_subdirectory(examples) +endif() -+if(BUILD_TESTS) ++if(BUILD_TESTING) + add_subdirectory(tests) +endif() Modified: head/math/onednn/files/patch-cmake_platform.cmake ============================================================================== --- head/math/onednn/files/patch-cmake_platform.cmake Fri Nov 6 18:38:46 2020 (r554309) +++ head/math/onednn/files/patch-cmake_platform.cmake Fri Nov 6 18:51:36 2020 (r554310) @@ -27,8 +27,28 @@ set(DEF_ARCH_OPT_FLAGS "-msse4.1") endif() # Clang cannot vectorize some loops with #pragma omp simd and gets -@@ -203,7 +203,7 @@ elseif(UNIX OR MINGW) - if (CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) +@@ -186,24 +186,24 @@ 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 "S390X") + 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 "-march=native") endif() - elseif(DNNL_TARGET_ARCH STREQUAL "X64")