https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/125069
Symlinks are problematic on some systems. They aren't strictly necessary as we already have build infrastructure to 'alias' multiple targets' source directories together, as nvptx/nvptx64 has been doing. This commit takes the opportunity to merge together the spirv and spirv64 directories as they were identical. Fixes #114413 >From 3ee58a4f23d84eb18d565c9f9cfc4719bc64c78c Mon Sep 17 00:00:00 2001 From: Fraser Cormack <fra...@codeplay.com> Date: Thu, 30 Jan 2025 15:12:31 +0000 Subject: [PATCH] [libclc] Remove use of symlinks Symlinks are problematic on some systems. They aren't strictly necessary as we already have build infrastructure to 'alias' multiple targets' source directories together, as nvptx/nvptx64 has been doing. Fixes #114413 --- libclc/CMakeLists.txt | 8 ++- libclc/amdgcn-mesa3d | 1 - libclc/clc/lib/clspv64 | 1 - libclc/clc/lib/spirv64/SOURCES | 24 ------- libclc/clspv64 | 1 - libclc/spirv64/lib/SOURCES | 90 -------------------------- libclc/spirv64/lib/math/fma.cl | 11 ---- libclc/spirv64/lib/math/fma.inc | 3 - libclc/spirv64/lib/subnormal_config.cl | 30 --------- 9 files changed, 7 insertions(+), 162 deletions(-) delete mode 120000 libclc/amdgcn-mesa3d delete mode 120000 libclc/clc/lib/clspv64 delete mode 100644 libclc/clc/lib/spirv64/SOURCES delete mode 120000 libclc/clspv64 delete mode 100644 libclc/spirv64/lib/SOURCES delete mode 100644 libclc/spirv64/lib/math/fma.cl delete mode 100644 libclc/spirv64/lib/math/fma.inc delete mode 100644 libclc/spirv64/lib/subnormal_config.cl diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt index 2c2c7f16e29442..ff52153354e0a9 100644 --- a/libclc/CMakeLists.txt +++ b/libclc/CMakeLists.txt @@ -277,9 +277,15 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) list( APPEND dirs amdgpu ) endif() - # nvptx is special + # Some targets' directories alias others if( ${ARCH} STREQUAL nvptx OR ${ARCH} STREQUAL nvptx64 ) set( DARCH ptx ) + elseif( ${ARCH} STREQUAL clspv OR ${ARCH} STREQUAL clspv64 ) + set( DARCH clspv ) + elseif( ${ARCH} STREQUAL spirv OR ${ARCH} STREQUAL spirv64 ) + set( DARCH spirv ) + elseif( ${ARCH} STREQUAL amdgcn-mesa3d ) + set( DARCH amdgcn-amdhsa ) else() set( DARCH ${ARCH} ) endif() diff --git a/libclc/amdgcn-mesa3d b/libclc/amdgcn-mesa3d deleted file mode 120000 index 400782833efe6c..00000000000000 --- a/libclc/amdgcn-mesa3d +++ /dev/null @@ -1 +0,0 @@ -amdgcn-amdhsa \ No newline at end of file diff --git a/libclc/clc/lib/clspv64 b/libclc/clc/lib/clspv64 deleted file mode 120000 index ea01ba94bc6368..00000000000000 --- a/libclc/clc/lib/clspv64 +++ /dev/null @@ -1 +0,0 @@ -clspv \ No newline at end of file diff --git a/libclc/clc/lib/spirv64/SOURCES b/libclc/clc/lib/spirv64/SOURCES deleted file mode 100644 index ddc9e4c49d8626..00000000000000 --- a/libclc/clc/lib/spirv64/SOURCES +++ /dev/null @@ -1,24 +0,0 @@ -../generic/common/clc_degrees.cl -../generic/common/clc_radians.cl -../generic/common/clc_smoothstep.cl -../generic/geometric/clc_dot.cl -../generic/integer/clc_add_sat.cl -../generic/integer/clc_clz.cl -../generic/integer/clc_hadd.cl -../generic/integer/clc_mad24.cl -../generic/integer/clc_mul24.cl -../generic/integer/clc_mul_hi.cl -../generic/integer/clc_popcount.cl -../generic/integer/clc_rhadd.cl -../generic/integer/clc_sub_sat.cl -../generic/integer/clc_upsample.cl -../generic/math/clc_ceil.cl -../generic/math/clc_copysign.cl -../generic/math/clc_fabs.cl -../generic/math/clc_floor.cl -../generic/math/clc_mad.cl -../generic/math/clc_nextafter.cl -../generic/math/clc_rint.cl -../generic/math/clc_trunc.cl -../generic/relational/clc_select.cl -../generic/shared/clc_clamp.cl diff --git a/libclc/clspv64 b/libclc/clspv64 deleted file mode 120000 index ea01ba94bc6368..00000000000000 --- a/libclc/clspv64 +++ /dev/null @@ -1 +0,0 @@ -clspv \ No newline at end of file diff --git a/libclc/spirv64/lib/SOURCES b/libclc/spirv64/lib/SOURCES deleted file mode 100644 index 854cba614c8bfd..00000000000000 --- a/libclc/spirv64/lib/SOURCES +++ /dev/null @@ -1,90 +0,0 @@ -subnormal_config.cl -../../generic/lib/async/async_work_group_strided_copy.cl -../../generic/lib/async/wait_group_events.cl -../../generic/lib/common/degrees.cl -../../generic/lib/common/mix.cl -../../generic/lib/common/radians.cl -../../generic/lib/common/sign.cl -../../generic/lib/common/smoothstep.cl -../../generic/lib/common/step.cl -../../generic/lib/geometric/cross.cl -../../generic/lib/geometric/distance.cl -../../generic/lib/geometric/dot.cl -../../generic/lib/geometric/fast_distance.cl -../../generic/lib/geometric/fast_length.cl -../../generic/lib/geometric/fast_normalize.cl -../../generic/lib/geometric/length.cl -../../generic/lib/geometric/normalize.cl -../../generic/lib/integer/rotate.cl -../../generic/lib/integer/mad_sat.cl -../../generic/lib/math/acos.cl -../../generic/lib/math/acosh.cl -../../generic/lib/math/acospi.cl -../../generic/lib/math/asin.cl -../../generic/lib/math/asinh.cl -../../generic/lib/math/asinpi.cl -../../generic/lib/math/atan.cl -../../generic/lib/math/atan2.cl -../../generic/lib/math/atan2pi.cl -../../generic/lib/math/atanh.cl -../../generic/lib/math/atanpi.cl -../../generic/lib/math/cbrt.cl -../../generic/lib/math/cos.cl -../../generic/lib/math/cosh.cl -../../generic/lib/math/cospi.cl -../../generic/lib/math/ep_log.cl -../../generic/lib/math/erf.cl -../../generic/lib/math/erfc.cl -../../generic/lib/math/exp.cl -../../generic/lib/math/exp_helper.cl -../../generic/lib/math/expm1.cl -../../generic/lib/math/exp2.cl -../../generic/lib/math/clc_exp10.cl -../../generic/lib/math/exp10.cl -../../generic/lib/math/clc_fma.cl -math/fma.cl -../../generic/lib/math/clc_fmod.cl -../../generic/lib/math/fmod.cl -../../generic/lib/math/fract.cl -../../generic/lib/math/frexp.cl -../../generic/lib/math/half_rsqrt.cl -../../generic/lib/math/half_sqrt.cl -../../generic/lib/math/clc_hypot.cl -../../generic/lib/math/hypot.cl -../../generic/lib/math/ilogb.cl -../../generic/lib/math/clc_ldexp.cl -../../generic/lib/math/ldexp.cl -../../generic/lib/math/lgamma.cl -../../generic/lib/math/lgamma_r.cl -../../generic/lib/math/log.cl -../../generic/lib/math/log10.cl -../../generic/lib/math/log1p.cl -../../generic/lib/math/log2.cl -../../generic/lib/math/logb.cl -../../generic/lib/math/modf.cl -../../generic/lib/math/tables.cl -../../generic/lib/math/clc_pow.cl -../../generic/lib/math/pow.cl -../../generic/lib/math/clc_pown.cl -../../generic/lib/math/pown.cl -../../generic/lib/math/clc_powr.cl -../../generic/lib/math/powr.cl -../../generic/lib/math/clc_remainder.cl -../../generic/lib/math/remainder.cl -../../generic/lib/math/clc_remquo.cl -../../generic/lib/math/remquo.cl -../../generic/lib/math/clc_rootn.cl -../../generic/lib/math/rootn.cl -../../generic/lib/math/sin.cl -../../generic/lib/math/sincos.cl -../../generic/lib/math/sincos_helpers.cl -../../generic/lib/math/sinh.cl -../../generic/lib/math/sinpi.cl -../../generic/lib/math/clc_tan.cl -../../generic/lib/math/tan.cl -../../generic/lib/math/tanh.cl -../../generic/lib/math/clc_tanpi.cl -../../generic/lib/math/tanpi.cl -../../generic/lib/math/tgamma.cl -../../generic/lib/shared/vload.cl -../../generic/lib/shared/vstore.cl diff --git a/libclc/spirv64/lib/math/fma.cl b/libclc/spirv64/lib/math/fma.cl deleted file mode 100644 index 79142425e52d23..00000000000000 --- a/libclc/spirv64/lib/math/fma.cl +++ /dev/null @@ -1,11 +0,0 @@ -#include <clc/clc.h> -#include <math/clc_fma.h> - -#define __CLC_BODY <fma.inc> -#define __FLOAT_ONLY -#include <clc/math/gentype.inc> - -bool __clc_runtime_has_hw_fma32() -{ - return false; -} diff --git a/libclc/spirv64/lib/math/fma.inc b/libclc/spirv64/lib/math/fma.inc deleted file mode 100644 index 0f12c565758ff7..00000000000000 --- a/libclc/spirv64/lib/math/fma.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE fma(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c) { - return __clc_sw_fma(a, b, c); -} diff --git a/libclc/spirv64/lib/subnormal_config.cl b/libclc/spirv64/lib/subnormal_config.cl deleted file mode 100644 index 3ab5a6394b9333..00000000000000 --- a/libclc/spirv64/lib/subnormal_config.cl +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include <clc/clc.h> -#include <clc/math/clc_subnormal_config.h> - -_CLC_DEF bool __clc_fp16_subnormals_supported() { return false; } - -_CLC_DEF bool __clc_fp32_subnormals_supported() { return false; } - -_CLC_DEF bool __clc_fp64_subnormals_supported() { return false; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits