Skip to content

Commit 2bde3d2

Browse files
authored
Merge branch 'master' into fix-anyvalue-int8
2 parents 990627b + 4e62f98 commit 2bde3d2

31 files changed

+728
-167
lines changed

cmake/SlangTarget.cmake

+8-4
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,14 @@ function(slang_add_target dir type)
505505
endif()
506506
install(
507507
TARGETS ${target} ${export_args}
508-
ARCHIVE DESTINATION ${archive_subdir} ${ARGN}
509-
LIBRARY DESTINATION ${library_subdir} ${ARGN}
510-
RUNTIME DESTINATION ${runtime_subdir} ${ARGN}
511-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${ARGN}
508+
ARCHIVE DESTINATION ${archive_subdir}
509+
${ARGN}
510+
LIBRARY DESTINATION ${library_subdir}
511+
${ARGN}
512+
RUNTIME DESTINATION ${runtime_subdir}
513+
${ARGN}
514+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
515+
${ARGN}
512516
)
513517
endmacro()
514518

docs/cuda-target.md

+11
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,17 @@ There is potential to calculate the lane id using the [numthreads] markup in Sla
301301
* Intrinsics which only work in pixel shaders
302302
+ QuadXXXX intrinsics
303303

304+
OptiX Support
305+
=============
306+
307+
Slang supports OptiX for raytracing. To compile raytracing programs, NVRTC must have access to the `optix.h` and dependent files that are typically distributed as part of the OptiX SDK. When Slang detects the use of raytracing in source, it will define `SLANG_CUDA_ENABLE_OPTIX` when `slang-cuda-prelude.h` is included. This will in turn try to include `optix.h`.
308+
309+
Slang tries several mechanisms to locate `optix.h` when NVRTC is initiated. The first mechanism is to look in the include paths that are passed to Slang. If `optix.h` can be found in one of these paths, no more searching will be performed.
310+
311+
If this fails, the default OptiX SDK install locations are searched. On Windows this is `%{PROGRAMDATA}\NVIDIA Corporation\OptiX SDK X.X.X\include`. On Linux this is `${HOME}/NVIDIA-OptiX-SDK-X.X.X-suffix`.
312+
313+
If OptiX headers cannot be found, compilation will fail.
314+
304315
Limitations
305316
===========
306317

docs/user-guide/03-convenience-features.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int rs = foo.staticMethod(a,b);
149149

150150
### Mutability of member function
151151

152-
For GPU performance considerations, the `this` argument in a member function is immutable by default. If you modify the content in `this` argument, the modification will be discarded after the call and does not affect the input object. If you intend to define a member function that mutates the object, use `[mutating]` attribute on the member function as shown in the following example.
152+
For GPU performance considerations, the `this` argument in a member function is immutable by default. Attempting to modify `this` will result in a compile error. If you intend to define a member function that mutates the object, use `[mutating]` attribute on the member function as shown in the following example.
153153

154154
```hlsl
155155
struct Foo
@@ -159,14 +159,14 @@ struct Foo
159159
[mutating]
160160
void setCount(int x) { count = x; }
161161
162-
void setCount2(int x) { count = x; }
162+
// This would fail to compile.
163+
// void setCount2(int x) { count = x; }
163164
}
164165
165166
void test()
166167
{
167168
Foo f;
168-
f.setCount(1); // f.count is 1 after the call.
169-
f.setCount2(2); // f.count is still 1 after the call.
169+
f.setCount(1); // Compiles
170170
}
171171
```
172172

0 commit comments

Comments
 (0)