Skip to content

Commit 2a3f943

Browse files
authored
fix: batch shading compiler directives were wrong (#2015)
I spotted two places where we used a *nonexistant* OSL_GCCVERSION macro. This is never defined. In platform.h, I think it's a simple typo and should be OSL_GNUC_VERSION, which is the macro we actually use to hold the GCC version, or 0 if it's not being compiled by GCC. In wide_opcolor.cpp, it's odder and seems like also a cut-and-paste error. At the very least it should be OSL_CLANG_VERSION since it's part of a clause that also tests that clang < 14.0. But upon staring at it, I can't help but wonder if this spot should *also* have a clause `OSL_GNUC_VERSION ||` to make this simd loop macro work properly for GCC, as it did in the other one in platform.h? And should the one in platform.h include clang, or no? Signed-off-by: Larry Gritz <[email protected]>
1 parent b8eb28d commit 2a3f943

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/include/OSL/platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290

291291
#define OSL_OMP_SIMD_LOOP(...) OSL_OMP_PRAGMA(omp simd __VA_ARGS__)
292292

293-
#if (OSL_GCCVERSION || OSL_INTEL_CLASSIC_COMPILER_VERSION || OSL_INTEL_LLVM_COMPILER_VERSION)
293+
#if (OSL_GNUC_VERSION || OSL_INTEL_CLASSIC_COMPILER_VERSION || OSL_INTEL_LLVM_COMPILER_VERSION)
294294
# define OSL_OMP_COMPLEX_SIMD_LOOP(...) OSL_OMP_SIMD_LOOP(__VA_ARGS__)
295295
#else
296296
// Ignore requests to vectorize complex/nested SIMD loops for certain

src/liboslexec/wide/wide_opcolor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ __OSL_MASKED_OP2(prepend_color_from, Wv, Ws)(void* bsg_, void* c_, void* from_,
296296
namespace {
297297

298298
// Note: Clang 14 seems to no longer allow vectorizing these loops
299-
#if ((OSL_GCCVERSION && OSL_CLANG_VERSION < 140000) \
299+
#if ((OSL_CLANG_VERSION && OSL_CLANG_VERSION < 140000) \
300300
|| OSL_INTEL_CLASSIC_COMPILER_VERSION || OSL_INTEL_LLVM_COMPILER_VERSION)
301301
# define WIDE_TRANSFORMC_OMP_SIMD_LOOP(...) OSL_OMP_SIMD_LOOP(__VA_ARGS__)
302302
#else

0 commit comments

Comments
 (0)