Skip to content

Commit 1173996

Browse files
authored
build: Remove support for deprecated Intel icc compiler (#2075)
Intel icc is deprecated and hasn't had a release for a few years. It's holding us back, both by making us work around an ever growing number of icc bugs and limitation that will never be fixed, as well as not allowing us to upgrade minimum versions of certain dependencies, because icc can't correctly compile newer versions (as an example, it cannot use a 'fmt' library newer than the oldest we support, 7.0). So it's time to thank icc for its service and put it on the ice floe for the polar bears to eat. This is of course in main (future OSL 1.16), and will not be backported to release branches, since we never stop support of a dependency or toolchain of existing releases. People requiring icc for whatever reason may keep using OSL 1.15 or older. We will continue to support and test icx, the fully supported Intel LLVM-based compiler. This PR also removes some test reference output that was only needed for icc. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 3ac1fb3 commit 1173996

File tree

21 files changed

+9
-925
lines changed

21 files changed

+9
-925
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -342,31 +342,6 @@ jobs:
342342
OPENIMAGEIO_CMAKE_FLAGS="-DUSE_PYTHON=0"
343343
CMAKE_BUILD_TYPE=RelWithDebInfo
344344

345-
- desc: icc/C++17 llvm14 py3.9 oiio-2.5 avx2
346-
nametag: linux-icc
347-
runner: ubuntu-latest
348-
container: aswf/ci-osl:2023-clang15
349-
cc_compiler: icc
350-
cxx_compiler: icpc
351-
cxx_std: 17
352-
fmt_ver: 7.1.3
353-
opencolorio_ver: v2.3.2
354-
openimageio_ver: v2.5.17.0
355-
# Changes to OIIO's simd.h starting in commit 68666db9 (from PR
356-
# #4187) seem to trigger compiler bugs in icc and generate wrong
357-
# SIMD code. It's probably not worth tracking down for just this
358-
# obsolete compiler. Just lock down to OIIO 2.5 for icc builds to
359-
# avoid the problem.
360-
# openimageio_ver: e41ac03c0b21 # works
361-
# openimageio_ver: 68666db994d5 # broken
362-
python_ver: "3.10"
363-
pybind11_ver: v2.10.0
364-
# simd: avx2,f16c
365-
batched: b8_AVX2_noFMA
366-
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF -DEXTRA_CPP_ARGS=-fp-model=consistent"
367-
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=7.1.3
368-
USE_OPENVDB=0
369-
OPENCOLORIO_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=g++"
370345
- desc: icx/C++17 llvm14 py3.10 oiio-3.0 avx2
371346
nametag: linux-icx
372347
runner: ubuntu-latest
@@ -379,7 +354,7 @@ jobs:
379354
cxx_std: 17
380355
fmt_ver: 7.1.3
381356
opencolorio_ver: v2.3.2
382-
openimageio_ver: v3.0.11.0
357+
openimageio_ver: v3.0.15.0
383358
python_ver: "3.10"
384359
pybind11_ver: v2.10.0
385360
simd: avx2,f16c

src/include/OSL/Imathx/Imathx.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,7 @@ affineInverse(const Matrix44 &m)
248248
// differently than the LLVM IR version.
249249
// NOTE: only using "inline" to get ODR (One Definition Rule) behavior
250250
static inline OSL_HOSTDEVICE Matrix44
251-
#if !OSL_INTEL_CLASSIC_COMPILER_VERSION
252251
OSL_GNUC_ATTRIBUTE(optimize("fp-contract=off"))
253-
#endif
254252
nonAffineInverse(const Matrix44 &source);
255253

256254
Matrix44 OSL_HOSTDEVICE nonAffineInverse(const Matrix44 &source)

src/include/OSL/mask.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ OSL_NAMESPACE_BEGIN
2020
using std::popcount;
2121
using std::countr_zero;
2222

23-
#elif OSL_INTEL_CLASSIC_COMPILER_VERSION
24-
25-
#include <immintrin.h>
26-
27-
OSL_FORCEINLINE int popcount(uint32_t x) noexcept { return _mm_popcnt_u32(x);}
28-
OSL_FORCEINLINE int popcount(uint64_t x) noexcept { return _mm_popcnt_u64(x); }
29-
OSL_FORCEINLINE int countr_zero(uint32_t x) noexcept { return _bit_scan_forward(x); }
30-
OSL_FORCEINLINE int countr_zero(uint64_t x) noexcept {
31-
unsigned __int32 index;
32-
_BitScanForward64(&index, x);
33-
return static_cast<int>(index);
34-
}
35-
3623
#elif defined(__GNUC__) || defined(__clang__)
3724

3825
OSL_FORCEINLINE int popcount(uint32_t x) noexcept { return __builtin_popcount(x); }

src/include/OSL/oslnoise.h

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ OSL_FORCEINLINE OSL_HOSTDEVICE Dual2<float> select(const bool b, const Dual2<flo
647647
// versus requiring a stack location.
648648
// Without this work per component, gathers & scatters were being emitted
649649
// when used inside SIMD loops.
650-
#if OSL_ANY_CLANG && !OSL_INTEL_CLASSIC_COMPILER_VERSION && !OSL_INTEL_LLVM_COMPILER_VERSION
650+
#if OSL_ANY_CLANG && !OSL_INTEL_LLVM_COMPILER_VERSION
651651
// Clang's vectorizor was really insistent that a select operation could not be replaced
652652
// with control flow, so had to re-introduce the ? operator to make it happy
653653
return Dual2<float> (
@@ -2254,7 +2254,6 @@ OSL_FORCEINLINE OSL_HOSTDEVICE void perlin (Dual2<Vec3> &result, const H &hash,
22542254

22552255
// With Dual2<Vec3> data types, a lot of code is generated below
22562256
// which caused some runaway compiler memory consumption when vectorizing
2257-
#if !OSL_INTEL_CLASSIC_COMPILER_VERSION
22582257
auto l_result = OIIO::lerp (
22592258
OIIO::trilerp (grad (hash (X , Y , Z , W ), fx , fy , fz , fw ),
22602259
grad (hash (X+1, Y , Z , W ), fx-1.0f, fy , fz , fw ),
@@ -2275,40 +2274,6 @@ OSL_FORCEINLINE OSL_HOSTDEVICE void perlin (Dual2<Vec3> &result, const H &hash,
22752274
grad (hash (X+1, Y+1, Z+1, W+1), fx-1.0f, fy-1.0f, fz-1.0f, fw-1.0f),
22762275
u, v, t),
22772276
s);
2278-
#else
2279-
// Use a loop to avoid repeating code gen twice
2280-
Dual2<Vec3> v0, v1;
2281-
// GCC emits -Wmaybe-uninitialized errors for v0,v1.
2282-
// To avoid, GCC uses reference version above
2283-
2284-
// Clang doesn't want to vectorize with the vIndex loop
2285-
// To enable vectorization, Clang uses reference version above
2286-
OSL_INTEL_PRAGMA(nounroll_and_jam)
2287-
for(int vIndex=0; vIndex < 2;++vIndex) {
2288-
int vW = W + vIndex;
2289-
Dual2<float> vfw = fw - float(vIndex);
2290-
2291-
Dual2<Vec3> vResult = OIIO::trilerp (
2292-
grad (hash (X , Y , Z , vW ), fx , fy , fz , vfw ),
2293-
grad (hash (X+1, Y , Z , vW ), fx-1.0f, fy , fz , vfw ),
2294-
grad (hash (X , Y+1, Z , vW ), fx , fy-1.0f, fz , vfw ),
2295-
grad (hash (X+1, Y+1, Z , vW ), fx-1.0f, fy-1.0f, fz , vfw ),
2296-
grad (hash (X , Y , Z+1, vW ), fx , fy , fz-1.0f, vfw ),
2297-
grad (hash (X+1, Y , Z+1, vW ), fx-1.0f, fy , fz-1.0f, vfw ),
2298-
grad (hash (X , Y+1, Z+1, vW ), fx , fy-1.0f, fz-1.0f, vfw ),
2299-
grad (hash (X+1, Y+1, Z+1, vW ), fx-1.0f, fy-1.0f, fz-1.0f, vfw ),
2300-
u, v, t);
2301-
// Rather than dynamic indexing array,
2302-
// use masking to store outputs,
2303-
// to better enable SROA (Scalar Replacement of Aggregates) optimizations
2304-
if (vIndex == 0) {
2305-
v0 = vResult;
2306-
} else {
2307-
v1 = vResult;
2308-
}
2309-
}
2310-
auto l_result = OIIO::lerp (v0, v1, s);
2311-
#endif
23122277

23132278
result = scale4 (l_result);
23142279
}

src/include/OSL/sfmath.h

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,7 @@ namespace sfm
6868
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6969
*/
7070

71-
#if OSL_INTEL_CLASSIC_COMPILER_VERSION
72-
// std::isinf wasn't vectorizing and was branchy. This slightly
73-
// perturbed version fairs better and is branch free when vectorized
74-
// with the Intel compiler.
75-
OSL_FORCEINLINE OSL_HOSTDEVICE int isinf (float x) {
76-
int r = 0;
77-
// NOTE: using bitwise | to avoid branches
78-
if (!(std::isfinite(x)|std::isnan(x))) {
79-
r = static_cast<int>(copysignf(1.0f,x));
80-
}
81-
return r;
82-
}
83-
#else
84-
// Other compilers don't seem to vectorize well no matter what, so just
85-
// use the standard version.
8671
using std::isinf;
87-
#endif
8872

8973
template<typename T>
9074
OSL_FORCEINLINE OSL_HOSTDEVICE T
@@ -191,7 +175,7 @@ namespace sfm
191175
}
192176
}
193177

194-
#if OSL_ANY_CLANG && !OSL_INTEL_CLASSIC_COMPILER_VERSION && !OSL_INTEL_LLVM_COMPILER_VERSION
178+
#if OSL_ANY_CLANG && !OSL_INTEL_LLVM_COMPILER_VERSION
195179

196180
// To make clang's loop vectorizor happy
197181
// we need to make sure result of min and max

src/include/OSL/wide.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ struct WideImpl<const Dual2<ElementT>[], WidthT, true /*IsConstT */> {
19041904
} // namespace pvt
19051905

19061906

1907-
#if OSL_INTEL_CLASSIC_COMPILER_VERSION || OSL_GNUC_VERSION
1907+
#if OSL_GNUC_VERSION
19081908
// Workaround for error #3466: inheriting constructors must be inherited from a direct base class
19091909
# define __OSL_INHERIT_BASE_CTORS(DERIVED, BASE) \
19101910
using Base = typename DERIVED::BASE; \
@@ -3210,8 +3210,7 @@ template<typename DataT, int WidthT>
32103210
OSL_FORCEINLINE bool
32113211
testIfAnyLaneIsNonZero(const Wide<DataT, WidthT>& wvalues)
32123212
{
3213-
#if OSL_ANY_CLANG && !OSL_INTEL_CLASSIC_COMPILER_VERSION \
3214-
&& !OSL_INTEL_LLVM_COMPILER_VERSION
3213+
#if OSL_ANY_CLANG && !OSL_INTEL_LLVM_COMPILER_VERSION
32153214
int anyLaneIsOn = 0;
32163215
OSL_OMP_PRAGMA(omp simd simdlen(WidthT) reduction(max : anyLaneIsOn))
32173216
for (int i = 0; i < WidthT; ++i) {

src/liboslexec/opcolor_impl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ hsv_to_rgb(const COLOR3& hsv)
266266
// Avoid switch statement vectorizor doesn't like
267267
// Also avoid if/else nest which some optimizers might
268268
// convert back into a switch statement
269-
# if OSL_ANY_CLANG && !OSL_INTEL_CLASSIC_COMPILER_VERSION \
270-
&& !OSL_INTEL_LLVM_COMPILER_VERSION
269+
# if OSL_ANY_CLANG && !OSL_INTEL_LLVM_COMPILER_VERSION
271270
// Clang was still transforming series of if's back into a switch.
272271
// Alternate between == and <= comparisons to avoid
273272
# define __OSL_ASC_EQ <=

src/liboslexec/wide/wide_opcolor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ namespace {
302302

303303
// Note: Clang 14 seems to no longer allow vectorizing these loops
304304
#if ((OSL_CLANG_VERSION && OSL_CLANG_VERSION < 140000) \
305-
|| OSL_INTEL_CLASSIC_COMPILER_VERSION || OSL_INTEL_LLVM_COMPILER_VERSION)
305+
|| OSL_INTEL_LLVM_COMPILER_VERSION)
306306
# define WIDE_TRANSFORMC_OMP_SIMD_LOOP(...) OSL_OMP_SIMD_LOOP(__VA_ARGS__)
307307
#else
308308
# define WIDE_TRANSFORMC_OMP_SIMD_LOOP(...)

src/liboslexec/wide/wide_opnoise_periodic_perlin_deriv_Vec3.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ template<> struct BatchedCGPolicy<Param::WDV, Param::WDV, Param::WV> {
2424
};
2525
template<>
2626
struct BatchedCGPolicy<Param::WDV, Param::WDV, Param::WDF, Param::WV, Param::WF> {
27-
#if ((defined(_WIN32) || defined(_WIN64)) && defined(__INTEL_COMPILER))
28-
// Avoid stack overflow on windows build because compiler has hard coded stack limit.
29-
// By not forcing everything to recursively inline and not explicitly vectorizing,
30-
// the compiler uses less stack space at the cost of NOT creating a properly SIMD optimized function.
31-
// Linux & OSX can increase stacksize before building
32-
33-
static constexpr int simd_threshold
34-
= __OSL_WIDTH + 1; // Make SIMD code path unreachable
35-
#else
3627
static constexpr int simd_threshold = 6;
37-
#endif
3828
};
3929
} // namespace
4030

src/liboslexec/wide/wide_opnoise_periodic_uperlin_deriv_Vec3.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ template<> struct BatchedCGPolicy<Param::WDV, Param::WDV, Param::WV> {
2424
};
2525
template<>
2626
struct BatchedCGPolicy<Param::WDV, Param::WDV, Param::WDF, Param::WV, Param::WF> {
27-
#if ((defined(_WIN32) || defined(_WIN64)) && defined(__INTEL_COMPILER))
28-
// Avoid stack overflow on windows build because compiler has hard coded stack limit.
29-
// By not forcing everything to recursively inline and not explicitly vectorizing,
30-
// the compiler uses less stack space at the cost of NOT creating a properly SIMD optimized function.
31-
// Linux & OSX can increase stacksize before building
32-
33-
static constexpr int simd_threshold
34-
= __OSL_WIDTH + 1; // Make SIMD code path unreachable
35-
#else
3627
static constexpr int simd_threshold = 6;
37-
#endif
3828
};
3929
} // namespace
4030

0 commit comments

Comments
 (0)