Skip to content

Commit 0eb25de

Browse files
committed
Merge branch 'main' into PR/DebugUninitFalsePositives
2 parents 778c97f + 43f649b commit 0eb25de

File tree

21 files changed

+356
-103
lines changed

21 files changed

+356
-103
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ jobs:
330330
fmt_ver: 10.1.1
331331
pybind11_ver: v2.10.0
332332
skip_tests: 1
333-
abi_check: 42ccf223af1e929fd84a13773e8748b719b1e595
333+
abi_check: e3aa2cf5a17a59e906c7125ff8d546b1561e812f
334334
setenvs: export OSL_CMAKE_FLAGS="-DOSL_BUILD_TESTS=0 -DBUILD_TESTING=OFF -DUSE_QT=0"
335335
OPENIMAGEIO_CMAKE_FLAGS="-DUSE_PYTHON=0"
336336
CMAKE_BUILD_TYPE=RelWithDebInfo
@@ -378,30 +378,30 @@ jobs:
378378
USE_OPENVDB=0
379379
OPENCOLORIO_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=g++"
380380

381-
- desc: Debug gcc7/C++17 llvm11 py3.8 oiio2.5 exr3.1 sse4
381+
- desc: Debug gcc9/C++17 llvm11 py3.10 oiio2.5 exr3.1 sse4
382382
nametag: linux-debug-gcc7-llvm11
383-
runner: ubuntu-20.04
383+
runner: ubuntu-22.04
384384
cxx_compiler: g++-9
385385
cxx_std: 17
386386
openexr_ver: v3.1.11
387387
openimageio_ver: v2.5.4.0
388388
pybind11_ver: v2.7.0
389-
python_ver: 3.8
389+
python_ver: "3.10"
390390
simd: sse4.2
391391
setenvs: export CMAKE_BUILD_TYPE=Debug
392392
LLVM_VERSION=11.0.0 LLVM_DISTRO_NAME=ubuntu-20.04
393393
PUGIXML_VERSION=v1.9
394394
CTEST_TEST_TIMEOUT=240
395395
- desc: gcc10/C++17 llvm11 oiio-2.5 avx2
396396
nametag: linux-2021ish-gcc10-llvm11
397-
runner: ubuntu-20.04
397+
runner: ubuntu-22.04
398398
cxx_compiler: g++-10
399399
cxx_std: 17
400400
fmt_ver: 7.0.1
401401
openexr_ver: v3.1.11
402402
openimageio_ver: v2.5.17.0
403403
pybind11_ver: v2.8.1
404-
python_ver: 3.8
404+
python_ver: "3.10"
405405
simd: avx2,f16c
406406
setenvs: export LLVM_VERSION=11.0.0 LLVM_DISTRO_NAME=ubuntu-20.04
407407
OPENIMAGEIO_CMAKE_FLAGS="-DBUILD_FMT_VERSION=7.0.1"
@@ -426,7 +426,7 @@ jobs:
426426
PTEX_VERSION=v2.4.3
427427
PUGIXML_VERSION=v1.14
428428
FREETYPE_VERSION=VER-2-13-3
429-
- desc: bleeding edge gcc12/C++17 llvm17 oiio/ocio/exr/pybind-main py3.12 avx2 batch-b16avx512
429+
- desc: bleeding edge gcc13/C++17 llvm17 oiio/ocio/exr/pybind-main py3.12 avx2 batch-b16avx512
430430
nametag: linux-bleeding-edge
431431
runner: ubuntu-24.04
432432
cc_compiler: gcc-13
@@ -443,9 +443,9 @@ jobs:
443443
setenvs: export LLVM_VERSION=17.0.6
444444
LLVM_DISTRO_NAME=ubuntu-22.04
445445
PUGIXML_VERSION=master
446-
- desc: clang14/C++17 llvm14 py3.8 avx2 batch-b16avx512
446+
- desc: clang14/C++17 llvm14 py3.10 avx2 batch-b16avx512
447447
nametag: linux-latest-releases-clang
448-
runner: ubuntu-20.04
448+
runner: ubuntu-22.04
449449
cxx_compiler: clang++
450450
cc_compiler: clang
451451
cxx_std: 17
@@ -454,7 +454,7 @@ jobs:
454454
openexr_ver: v3.1.11
455455
openimageio_ver: release
456456
pybind11_ver: v2.9.2
457-
python_ver: 3.8
457+
python_ver: "3.10"
458458
simd: avx2,f16c
459459
batched: b8_AVX2,b8_AVX512,b16_AVX512
460460
setenvs: export LLVM_VERSION=14.0.0

CHANGES.md

Lines changed: 172 additions & 50 deletions
Large diffs are not rendered by default.

CMakeLists.txt

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

55
cmake_minimum_required (VERSION 3.19)
66

7-
set (OSL_VERSION "1.14.4.0")
7+
set (OSL_VERSION "1.15.0.0")
88
set (OSL_VERSION_OVERRIDE "" CACHE STRING
99
"Version override (use with caution)!")
1010
mark_as_advanced (OSL_VERSION_OVERRIDE)

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ Here are the steps to check out, build, and test the OSL distribution:
114114
4. After compilation, you'll end up with a full OSL distribution in
115115
dist/
116116

117-
5. Add the "dist/bin" to your $PATH, and "dist/lib" to your
118-
$LD_LIBRAY_PATH (or $DYLD_LIBRARY_PATH on MacOS), or copy the contents
117+
5. Add the "dist/bin" to your `$PATH`, and "dist/lib" to your
118+
`$LD_LIBRAY_PATH` (or `$DYLD_LIBRARY_PATH` on MacOS), or copy the contents
119119
of those files to appropriate directories. Public include files
120120
(those needed when building applications that incorporate OSL)
121121
can be found in "dist/include", and documentation can be found

src/doc/datatypes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ are 1D and statically sized, using the usual syntax for C-like languages:
558558
float c[3] = { 0.1, 0.2, 3.14 }; // Initialize the array
559559
560560
float f = c[1]; // Access one element
561+
562+
float d[10][3]; // Invalid, multi-dimensional arrays not supported
561563
```
562564

563565
The built-in function `arraylength()` returns the number of elements in an

src/doc/syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ Some examples of variable declarations are
8888

8989
Arrays are also supported, declared as follows:
9090

91-
> *type variablename* `[` *arraylen* `}`
91+
> *type variablename* `[` *arraylen* `]`
9292
>
93-
> *type variablename* `[` *arraylen* `}` `=` `{` *init0 `,` *init1* ... `}`
93+
> *type variablename* `[` *arraylen* `]` `=` `{` *init0 `,` *init1* ... `}`
9494
9595
Array variables in OSL must have a constant length (though function parameters
9696
and shader parameters may have undetermined length). Some examples of array

src/include/OSL/rendererservices.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,19 @@ class OSLEXECPUBLIC RendererServices {
580580
}
581581
};
582582

583+
// Default no-op implementations of the caching api.
584+
// Currently used for caching optix ptx before llvm generation.
585+
virtual void cache_insert(string_view cachename, string_view key,
586+
string_view value) const
587+
{
588+
}
589+
590+
virtual bool cache_get(string_view cachename, string_view key,
591+
std::string& value) const
592+
{
593+
return false;
594+
}
595+
583596
/// A renderer may choose to support batched execution by providing pointers
584597
/// to objects satisfying the BatchedRendererServices<WidthOf<#>> interface
585598
/// for specific batch sizes.

src/liboslexec/backendllvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ class BackendLLVM final : public OSOProcessorBase {
524524

525525
/// Return whether or not we are compiling for an OptiX-based renderer.
526526
bool use_optix() { return m_use_optix; }
527+
bool use_optix_cache() { return shadingsys().use_optix_cache(); }
527528

528529
/// Return if we should compile against free function versions of Renderer Service.
529530
bool use_rs_bitcode() { return m_use_rs_bitcode; }

src/liboslexec/instance.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,25 @@ ShaderGroup::setup_interactive_arena(cspan<uint8_t> paramblock)
848848

849849

850850

851+
void
852+
ShaderGroup::generate_optix_cache_key(string_view code)
853+
{
854+
const uint64_t ir_key = Strutil::strhash(code);
855+
856+
std::string safegroup;
857+
safegroup = Strutil::replace(name(), "/", "_", true);
858+
safegroup = Strutil::replace(safegroup, ":", "_", true);
859+
860+
// Cache key includes the groupname in addition to the serialized IR.
861+
// This is because the groupname makes its way into the ptx's direct callable name,
862+
// but isn't included in the serialization.
863+
std::string cache_key = fmtformat("cache-osl-ptx-{}-{}", safegroup, ir_key);
864+
865+
m_optix_cache_key = cache_key;
866+
}
867+
868+
869+
851870
std::string
852871
ShaderGroup::serialize() const
853872
{

src/liboslexec/llvm_gen.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,13 @@ LLVMGEN(llvm_gen_printf_legacy)
426426
}
427427
#endif
428428

429-
// Some ops prepend things
430-
if (op.opname() == op_error || op.opname() == op_warning) {
431-
s = fmtformat("Shader {} [{}]: {}", op.opname(),
432-
rop.inst()->shadername(), s);
429+
// TODO: optix cache should handle ustrings generated during llvm-gen
430+
if (!rop.use_optix_cache()) {
431+
// Some ops prepend things
432+
if (op.opname() == op_error || op.opname() == op_warning) {
433+
s = fmtformat("Shader {} [{}]: {}", op.opname(),
434+
rop.inst()->shadername(), s);
435+
}
433436
}
434437

435438
// Now go back and put the new format string in its place
@@ -709,10 +712,12 @@ LLVMGEN(llvm_gen_print_fmt)
709712
}
710713
}
711714
}
712-
// Some ops prepend things
713-
if (op.opname() == op_error || op.opname() == op_warning) {
714-
s = fmtformat("Shader {} [{}]: {}", op.opname(),
715-
rop.inst()->shadername(), s);
715+
if (!rop.use_optix_cache()) {
716+
// Some ops prepend things
717+
if (op.opname() == op_error || op.opname() == op_warning) {
718+
s = fmtformat("Shader {} [{}]: {}", op.opname(),
719+
rop.inst()->shadername(), s);
720+
}
716721
}
717722
ustring s_ustring(s.c_str());
718723
call_args.push_back(rop.llvm_const_hash(s_ustring));

0 commit comments

Comments
 (0)