git: 4a72fdf13706 - main - misc/pytorch: fix build on arm64

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Tue, 09 Jul 2024 10:04:52 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4a72fdf137062c477b25bf1602d57745b569a352

commit 4a72fdf137062c477b25bf1602d57745b569a352
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2024-07-08 15:54:36 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2024-07-09 10:04:28 +0000

    misc/pytorch: fix build on arm64
---
 misc/pytorch/files/patch-caffe2_CMakeLists.txt | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/misc/pytorch/files/patch-caffe2_CMakeLists.txt b/misc/pytorch/files/patch-caffe2_CMakeLists.txt
index ca8e239a6d85..f45d71b76488 100644
--- a/misc/pytorch/files/patch-caffe2_CMakeLists.txt
+++ b/misc/pytorch/files/patch-caffe2_CMakeLists.txt
@@ -1,6 +1,6 @@
---- caffe2/CMakeLists.txt.orig	2023-05-08 19:58:16 UTC
+--- caffe2/CMakeLists.txt.orig	2024-06-05 19:17:56 UTC
 +++ caffe2/CMakeLists.txt
-@@ -1,6 +1,8 @@
+@@ -1,6 +1,8 @@ include(../cmake/Codegen.cmake)
  # ---[ Generate and install header and cpp files
  include(../cmake/Codegen.cmake)
  
@@ -9,3 +9,12 @@
  # ---[ Vulkan code gen
  if(USE_VULKAN)
    include(../cmake/VulkanCodegen.cmake)
+@@ -561,7 +563,7 @@ endif()
+ endif()
+ 
+ # Enable conditional FP16 arithmetic intrinsics
+-if(CPU_AARCH64 AND LINUX)
++if(CPU_AARCH64 AND CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ set_source_files_properties(${TORCH_ROOT}/aten/src/ATen/native/BlasKernel.cpp PROPERTIES COMPILE_FLAGS "-march=armv8.2-a+fp16")
+ endif()
+