Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
275 commits
Select commit Hold shift + click to select a range
ff2f88f
update
lamarrr Feb 4, 2026
44c1344
Refactor JIT compilation and caching system
lamarrr Feb 6, 2026
86c0010
Enhance JIT compilation with ASM support and integrate LZ4 compression
lamarrr Feb 6, 2026
ae39c7c
Merge remote-tracking branch 'upstream/main' into lto-ir-expt
lamarrr Feb 6, 2026
a955a04
Update copyright year in get_lz4.cmake and improve formatting
lamarrr Feb 6, 2026
7d2a2bb
Refactor LZ4 integration and improve JIT logging
lamarrr Feb 7, 2026
82ddae0
Integrate Zstandard (zstd) compression support in JIT embedding and u…
lamarrr Feb 8, 2026
43a4e08
Add python-zstd dependency to environment YAML files
lamarrr Feb 8, 2026
37976fc
update
lamarrr Feb 8, 2026
17ebfa0
refactoring + multi-threaded setup fix
lamarrr Feb 8, 2026
6fbc5a4
enhance teardown documentation with usage warnings and clarify purpose
lamarrr Feb 8, 2026
5aa1ea5
update copyright year to 2026 in header files
lamarrr Feb 8, 2026
fab6e6e
enhance teardown function to reset context and improve resource manag…
lamarrr Feb 8, 2026
5738218
fix: adjust concurrency calculation in multithreaded test utility
lamarrr Feb 8, 2026
33b93a4
Merge branch 'main' into context-mt
lamarrr Feb 8, 2026
c34420a
fix: adjust concurrency calculation in multithreaded utility
lamarrr Feb 8, 2026
6be76aa
Merge branch 'context-mt' of https://github.com/lamarrr/cudf into con…
lamarrr Feb 8, 2026
d83a397
Merge branch 'context-mt' into lto-ir-expt
lamarrr Feb 8, 2026
8b58392
feat: enhance initialization flags and context management for JIT and…
lamarrr Feb 9, 2026
b2be86b
feat: add get_bool_env_or specialization for boolean environment vari…
lamarrr Feb 9, 2026
3ecf30d
Merge branch 'context-mt' into lto-ir-expt
lamarrr Feb 9, 2026
925171d
feat: improve cache management and blob handling in RTC
lamarrr Feb 9, 2026
8fd14de
fix: replace high_resolution_clock with steady_clock for more stable …
lamarrr Feb 9, 2026
c9aedc9
formatting
lamarrr Feb 9, 2026
bae7fde
feat: add new accessors and device span structures for improved LTO f…
lamarrr Feb 10, 2026
e2915e7
feaute-parity for column_device_view core types
lamarrr Feb 11, 2026
4480033
refactoring
lamarrr Feb 11, 2026
ba8f921
update
lamarrr Feb 11, 2026
f68d4f0
Merge remote-tracking branch 'upstream/main' into lto-ir-expt
lamarrr Feb 11, 2026
dca589e
update
lamarrr Feb 11, 2026
def9833
Refactor LTO library structure and update operators
lamarrr Feb 11, 2026
22eef22
Reformat comments and code layout in transform_params structure
lamarrr Feb 11, 2026
613eb37
changed symbol visibility
lamarrr Feb 11, 2026
1d53fc8
Rename struct `jit_statistics` to `jit_compilation_stats` for clarity
lamarrr Feb 11, 2026
112ae32
cmake dependency fix
lamarrr Feb 11, 2026
32383c0
refactoring
lamarrr Feb 12, 2026
21a2610
refactoring
lamarrr Feb 12, 2026
c82867b
Refactor JIT Compilation and Embed Functionality
lamarrr Feb 14, 2026
badacea
checkpoint
lamarrr Feb 18, 2026
6f829ac
started making operators AST-based
lamarrr Feb 20, 2026
ec95217
update
lamarrr Feb 20, 2026
5e0f2e7
update
lamarrr Feb 21, 2026
93b57a5
Merge remote-tracking branch 'upstream/main' into lto-ir-expr-ast-based
lamarrr Feb 21, 2026
5ffddda
update
lamarrr Feb 22, 2026
4414b4e
Merge remote-tracking branch 'upstream/main' into lto-ir-expr-ast-based
lamarrr Feb 27, 2026
dbaa133
Add system includes for CUDA standard library and refactor RTC cache
lamarrr Mar 2, 2026
7e5fb74
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Mar 2, 2026
ca50cc9
remove faked headers
lamarrr Mar 2, 2026
db2e2dd
Update conda environment files to require python-zstd version 1.5.7.2…
lamarrr Mar 2, 2026
75916e4
Refactor init_flags and initialization logic to remove RTC and JIT bu…
lamarrr Mar 2, 2026
8bb341d
Clean up JIT-related code: remove RTC test file, delete unused transf…
lamarrr Mar 2, 2026
4bb406a
Refactor JIT compilation options: streamline precompiled header usage…
lamarrr Mar 2, 2026
e53bf52
Remove TODO comment regarding CMake tracking in jit_bundle_t constructor
lamarrr Mar 2, 2026
bdc6597
Update log message to specify compiled CUDA library in compile_librar…
lamarrr Mar 2, 2026
6c9be74
[FEA] Support Multi-Output JIT Transforms
lamarrr Mar 7, 2026
8dba8b8
Refactor transform functionality to support new output specifications…
lamarrr Mar 8, 2026
e8250e2
update
lamarrr Mar 8, 2026
e55ba0f
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Mar 8, 2026
aa2fd4d
Merge remote-tracking branch 'upstream/main' into multi-output-transf…
lamarrr Mar 10, 2026
f708ff9
initial diff
lamarrr Mar 12, 2026
69ff5e1
Add [[nodiscard]] attribute to head() and data() methods in mutable_c…
lamarrr Mar 12, 2026
2ab3bc5
Refactoring + add support for zero inputs
lamarrr Mar 12, 2026
176d356
added test todos
lamarrr Mar 12, 2026
8efd349
Merge remote-tracking branch 'upstream/main' into multi-output-transf…
lamarrr Mar 12, 2026
8ff447d
Refactor variable names for clarity in transform functions
lamarrr Mar 12, 2026
4bd0c72
Refactor JIT transform kernel and related components
lamarrr Mar 13, 2026
cfc1e23
Remove unnecessary blank line in transform kernel definition
lamarrr Mar 13, 2026
c82923c
Merge remote-tracking branch 'upstream/main' into multi-output-transf…
lamarrr Mar 13, 2026
b279d49
remove TODO
lamarrr Mar 13, 2026
21a8733
Merge remote-tracking branch 'upstream/main' into multi-output-transf…
lamarrr Mar 13, 2026
40f4129
code review refactoring
lamarrr Mar 14, 2026
ddd251d
more improvements
lamarrr Mar 17, 2026
2e1bbab
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Mar 17, 2026
10c6410
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Mar 17, 2026
ce31d17
refactor
lamarrr Mar 17, 2026
ddfbba1
Refactor JIT kernel paths, enhance cache management, and improve buff…
lamarrr Mar 18, 2026
ac12ff7
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Mar 18, 2026
5ea3317
Update copyright years in header files and enhance kernel launch para…
lamarrr Mar 18, 2026
3bd4106
Merge branch 'main' into drop-jitify
lamarrr Mar 18, 2026
78bdf40
update
lamarrr Mar 18, 2026
9fe78f3
CI errors fix + refactoring
lamarrr Mar 18, 2026
2854850
Merge branch 'main' into drop-jitify
lamarrr Mar 18, 2026
68e7974
added lz4 dep
lamarrr Mar 19, 2026
f7f55a8
Merge branch 'drop-jitify' of https://github.com/lamarrr/cudf into dr…
lamarrr Mar 19, 2026
084f735
Merge branch 'main' into multi-output-transform-support
lamarrr Mar 19, 2026
71e25ce
update recipe
lamarrr Mar 19, 2026
cdb66c6
update lz4 dependency to version 4.4.5 in environment YAML files
lamarrr Mar 19, 2026
b64eb2e
refactor: update linking parameters to use structured fragments for i…
lamarrr Mar 20, 2026
b9a2153
Fix Python dependencies on lz4 and zstandard
bdice Mar 21, 2026
43b1dbf
Merge branch 'main' into drop-jitify
lamarrr Mar 21, 2026
16386fd
Merge branch 'main' into drop-jitify
lamarrr Mar 21, 2026
ea11f0b
Refactor JIT installation error handling and remove unused kernel nam…
lamarrr Mar 21, 2026
422ea0a
drop lz4 dependencies and support from rtcx
lamarrr Mar 21, 2026
96d254c
update
lamarrr Mar 22, 2026
a0ee09d
Remove Jitify references and clean up CMake configuration
lamarrr Mar 22, 2026
11e01b3
Add TODO for glob restrictions in embed.cmake to filter source files
lamarrr Mar 22, 2026
6bc9c0b
Update comments to clarify NVRTC and jit-compiling references in stri…
lamarrr Mar 22, 2026
9be6531
Merge branch 'main' into multi-output-transform-support
lamarrr Mar 25, 2026
40d46cf
Merge branch 'main' into multi-output-transform-support
lamarrr Mar 27, 2026
df6bd8d
Merge branch 'main' into multi-output-transform-support
lamarrr Mar 30, 2026
060d369
refactor null mask handling to use set_null_mask for consistency
lamarrr Mar 30, 2026
4ba506a
properly handle cuda version for "-minimal" flag
lamarrr Mar 30, 2026
c21c228
Merge branch 'multi-output-transform-support' of https://github.com/l…
lamarrr Mar 30, 2026
476025e
Merge branch 'main' into multi-output-transform-support
lamarrr Mar 30, 2026
7e8c903
Merge remote-tracking branch 'upstream/main' into multi-output-transf…
lamarrr Apr 1, 2026
3aa3b20
fix invocation error
lamarrr Apr 1, 2026
e1a6f43
Use global namespace for standard library functions in rtcx.cpp
lamarrr Apr 1, 2026
b382e49
reorg
lamarrr Apr 1, 2026
a8f8c3d
Remove unused kernel enumeration functions from library_t
lamarrr Apr 1, 2026
3f92780
Remove get_name method and its declaration from kernel_ref
lamarrr Apr 1, 2026
49d81e6
remove unused kernel header from helpers.hpp
lamarrr Apr 1, 2026
70c558c
Update PTX code in ColumnVectorTest with generated output from Numba
lamarrr Apr 1, 2026
c0b947b
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 1, 2026
742b88a
FIX JAVA string literal quote
lamarrr Apr 1, 2026
d27a094
Merge branch 'multi-output-transform-support' of https://github.com/l…
lamarrr Apr 1, 2026
6b4fe05
Merge remote-tracking branch 'upstream/main' into multi-output-transf…
lamarrr Apr 1, 2026
cc503e2
Update cpp/src/transform/transform.cu
lamarrr Apr 1, 2026
24c450a
Update cpp/src/transform/transform.cu
lamarrr Apr 1, 2026
29cfcc7
Refactor inplace_null_mask_and to move bitmask calculations after inp…
lamarrr Apr 1, 2026
22b189b
reduce binary size + fix java string
lamarrr Apr 2, 2026
c9e651c
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 2, 2026
4932483
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 4, 2026
eb1b4f2
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Apr 4, 2026
c43ac2f
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 5, 2026
c261b83
update
lamarrr Apr 5, 2026
3bc9868
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Apr 5, 2026
25a35f0
Remove lz4 and zstandard dependencies from environment and project files
lamarrr Apr 5, 2026
cedd9bd
Add zstandard dependency to pyproject.toml
lamarrr Apr 5, 2026
45e48f5
Update TODO comment to clarify glob restrictions for included source …
lamarrr Apr 5, 2026
6a1267f
remove libraryunload handling
lamarrr Apr 6, 2026
8f50bb3
fix identation
lamarrr Apr 6, 2026
6cf08ca
Merge branch 'multi-output-transform-support' of https://github.com/l…
lamarrr Apr 6, 2026
f2282ac
Fix symbol loading error handling and improve lru_memory_cache initia…
lamarrr Apr 6, 2026
7bfd0a8
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 9, 2026
ed68841
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 9, 2026
dd64fd9
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 9, 2026
b6db8f2
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 10, 2026
485107e
code review changes
lamarrr Apr 11, 2026
85e96db
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 11, 2026
f6209b1
feature improvements + added workaround for missing cuda driver func…
lamarrr Apr 11, 2026
bbe8d5c
Refactor JIT include directories and fix delimiter typo in embed.in.cpp
lamarrr Apr 11, 2026
c46450e
Refactor JIT kernel paths and include directives for improved organiz…
lamarrr Apr 11, 2026
8c30430
Merge remote-tracking branch 'origin/multi-output-transform-support' …
lamarrr Apr 11, 2026
f8fcc70
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Apr 11, 2026
4ba9950
Enhance JIT kernel functions with additional parameters for minimal u…
lamarrr Apr 11, 2026
74286e0
Fix formatting in compression output message for clarity
lamarrr Apr 11, 2026
25901ea
Refactor function parameter formatting for improved readability in JI…
lamarrr Apr 11, 2026
2b5dbc5
fix up
lamarrr Apr 12, 2026
a521f47
Refactor detail namespace usage in transform.cu for consistency
lamarrr Apr 12, 2026
3b70eb3
Merge branch 'multi-output-transform-support' of https://github.com/l…
lamarrr Apr 12, 2026
843dbd5
Enhance argument handling in to_args function by utilizing pinned vec…
lamarrr Apr 12, 2026
d44bbbb
Fix type in to_args function to use column_device_view_base for impro…
lamarrr Apr 12, 2026
5101289
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 12, 2026
58a6385
Refactor to_args function to use host_vector for better memory manage…
lamarrr Apr 12, 2026
49f94ed
Merge branch 'multi-output-transform-support' of https://github.com/l…
lamarrr Apr 12, 2026
70f62f1
Merge remote-tracking branch 'origin/multi-output-transform-support' …
lamarrr Apr 12, 2026
7616d54
Refactor rolling window wrappers to include constructors and improve …
lamarrr Apr 12, 2026
bdbed4b
Add embedded file generation and SHA256 hashing functionality
lamarrr Apr 12, 2026
689495f
Remove redundant SetFlowCallback from log_trace function
lamarrr Apr 12, 2026
ea2ef02
Enhance const correctness by adding [[nodiscard]] to relevant methods…
lamarrr Apr 12, 2026
18372f7
Merge branch 'main' into drop-jitify
lamarrr Apr 12, 2026
0112b98
Refactor transform_kernel template parameters for clarity and consist…
lamarrr Apr 12, 2026
9cc8747
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 12, 2026
222618d
Add CUDF_KERNEL qualifier to kernel functions in binaryop, join, and …
lamarrr Apr 12, 2026
1c0def6
Merge remote-tracking branch 'origin/multi-output-transform-support' …
lamarrr Apr 12, 2026
b37b545
simplify column_accessor traits
lamarrr Apr 13, 2026
ed81710
Merge branch 'multi-output-transform-support' of https://github.com/l…
lamarrr Apr 13, 2026
95925f9
Merge remote-tracking branch 'origin/multi-output-transform-support' …
lamarrr Apr 13, 2026
225e597
Refactor CUDA utility includes and improve string offset validation l…
lamarrr Apr 14, 2026
8085323
Update copyright year to 2026 in cuda.cuh
lamarrr Apr 14, 2026
f0646bc
Merge branch 'main' into multi-output-transform-support
lamarrr Apr 14, 2026
6af15c0
remove nullable trait in column accessor
lamarrr Apr 14, 2026
ea82e0d
Merge branch 'multi-output-transform-support' of https://github.com/l…
lamarrr Apr 14, 2026
4c7e43d
Merge remote-tracking branch 'origin/multi-output-transform-support' …
lamarrr Apr 14, 2026
3c5adc7
refactor: simplify variable declarations in reflect function
lamarrr Apr 14, 2026
d42466d
remove zstandard dependency from recipe and pyproject files
lamarrr Apr 14, 2026
1e5cb73
initial changes
lamarrr Apr 18, 2026
0ec6804
Refactor JIT compilation and embedding process
lamarrr Apr 20, 2026
0dbb87b
Merge branch 'main' into drop-jitify
lamarrr Apr 20, 2026
28295bb
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Apr 20, 2026
aa3f3c3
clean up diff
lamarrr Apr 20, 2026
6682abd
Remove unused kernel argument configuration in launch function
lamarrr Apr 20, 2026
d9f4185
update embed script
lamarrr Apr 20, 2026
0055ca0
Merge branch 'main' into drop-jitify
lamarrr Apr 20, 2026
8a9878c
update docs
lamarrr Apr 20, 2026
c59d13f
Merge branch 'drop-jitify' of https://github.com/lamarrr/cudf into dr…
lamarrr Apr 20, 2026
43f9cd0
disable excessive linter warnings
lamarrr Apr 20, 2026
b7c9f3c
fix lints
lamarrr Apr 20, 2026
d0e86fd
refactor: change class declarations to struct for cache_t and jit_bun…
lamarrr Apr 21, 2026
067123e
refactor: improve formatting and modernize array declarations in get_…
lamarrr Apr 21, 2026
57d1192
removed static linking to CUDA libs and fixed lint errors
lamarrr Apr 21, 2026
36d06ae
Merge branch 'main' into drop-jitify
lamarrr Apr 21, 2026
fae6e2c
removed invalid linter warnings
lamarrr Apr 21, 2026
2301055
Merge branch 'drop-jitify' of https://github.com/lamarrr/cudf into dr…
lamarrr Apr 21, 2026
bfa6782
Merge branch 'main' into drop-jitify
lamarrr Apr 21, 2026
32eb792
Merge branch 'main' into drop-jitify
lamarrr Apr 21, 2026
9ae5096
refactoring + code review suggestions
lamarrr Apr 22, 2026
95591ba
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr Apr 22, 2026
610beab
refactoring
lamarrr Apr 22, 2026
457ee40
Remove unnecessary blank lines and clean up SPDX license headers in m…
lamarrr Apr 22, 2026
855b246
Refactor embed functions to remove unused binary file name variable a…
lamarrr Apr 22, 2026
2c98a35
Refactor CMakeLists.txt and source files to remove unused variables a…
lamarrr Apr 23, 2026
37d6696
Rename environment variable for clearing JIT cache to improve clarity
lamarrr Apr 23, 2026
49636cc
Refactoring + removed disk LRU
lamarrr Apr 23, 2026
169618d
Apply suggestion from @wence-
lamarrr Apr 23, 2026
b5cd518
Refactor object type handling in disk cache functions for improved cl…
lamarrr Apr 24, 2026
3c607ca
Merge branch 'drop-jitify' of https://github.com/lamarrr/cudf into dr…
lamarrr Apr 24, 2026
1c025b4
Merge branch 'main' into drop-jitify
lamarrr Apr 24, 2026
8c3ac2f
update
lamarrr Apr 24, 2026
4a17020
Merge branch 'main' into drop-jitify
lamarrr Apr 24, 2026
2c497dc
Merge branch 'main' into drop-jitify
lamarrr Apr 24, 2026
72a17bc
Merge branch 'main' into drop-jitify
lamarrr Apr 25, 2026
29826d4
fix(context): update environment variable names for JIT cache configu…
lamarrr Apr 26, 2026
f3f72b2
Merge branch 'main' into drop-jitify
lamarrr Apr 28, 2026
9ed9325
Merge branch 'main' into drop-jitify
lamarrr May 4, 2026
8c7f368
Refactor JIT operators and add compute columns functionality
lamarrr May 5, 2026
6fe3108
code review changes
lamarrr May 5, 2026
2e647ef
Merge branch 'drop-jitify' of https://github.com/lamarrr/cudf into dr…
lamarrr May 5, 2026
e9ec212
Refactor decompress_blob function signature to use std::uint8_t and s…
lamarrr May 5, 2026
6f5a542
Merge remote-tracking branch 'upstream/main' into drop-jitify
lamarrr May 5, 2026
01b42c2
Merge remote-tracking branch 'origin/drop-jitify' into lto-ir-jit
lamarrr May 5, 2026
5188eca
Remove inline specifier from load and store functions in compute_colu…
lamarrr May 5, 2026
0b0ba2f
Implement LTO (Link Time Optimization) for transform operations
lamarrr May 12, 2026
0ea5656
Implement LTO (Link Time Optimization) for transform operations and u…
lamarrr May 12, 2026
6b2e0e7
Remove untyped LTO kernel implementations and related code
lamarrr May 13, 2026
dc95bba
Update CMakeLists.txt to enhance library linking and update copyright…
lamarrr May 13, 2026
40fd3eb
Add documentation for JIT embedding functions in CMake files
lamarrr May 13, 2026
12b8cf7
Merge remote-tracking branch 'upstream/main' into lto-ir-jit
lamarrr May 13, 2026
6e3840e
update
lamarrr May 13, 2026
630beab
revert non-librtcx changes
lamarrr May 13, 2026
3f5fc79
revert LTO doc
lamarrr May 13, 2026
8aad236
revert docker change
lamarrr May 13, 2026
eb3ef79
fix coderabbit nits
lamarrr May 13, 2026
1bbc0f8
Merge branch 'main' into drop-jitify
lamarrr May 13, 2026
03ec682
revert: code rabbit suggestion
lamarrr May 14, 2026
00b32b3
Update documentation and improve function signatures in librtcx
lamarrr May 15, 2026
8bde405
Refactor embed_includes function to use SOURCE_DIRECTORY instead of C…
lamarrr May 15, 2026
463d008
Add template specialization for reflect function to handle various types
lamarrr May 15, 2026
2a26428
WAR: pre-commit namespace decl
lamarrr May 15, 2026
df6c97d
Fix formatting in generate_cxx_source_files_data function for improve…
lamarrr May 15, 2026
2662703
Merge branch 'main' into drop-jitify
lamarrr May 15, 2026
ac0caaa
replace error-prone parent scope variable assignment with target prop…
lamarrr May 18, 2026
908cf50
pre-commit: formatting
lamarrr May 18, 2026
48d1ec0
fix: correct variable name for embed properties in JIT functions
lamarrr May 18, 2026
cbfc086
fix: update std::call_once to use value() for initialization flags
lamarrr May 20, 2026
56ac249
fix: change namespace declaration to inline for detail
lamarrr May 20, 2026
a138cb7
fix: update reflect_enum to use reflect instead of reflect_int
lamarrr May 20, 2026
a0ec040
Merge branch 'main' into drop-jitify
bdice May 21, 2026
59593ed
Merge branch 'main' into drop-jitify
lamarrr May 22, 2026
d146ece
Merge branch 'main' into drop-jitify
lamarrr May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cpp/librtcx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# librtcx

RTCX (runtime-compiler extended) is a wrapper around NVRTC and nvJitLink designed to provide:

- User-controlled compilation, linking, caching, and pre-loading of CUDA kernels
- Zero-copy interfaces to manage JIT compilation and linking
- CMake script to embed **compressed** headers directly into an executable without incurring overhead at runtime on every compilation request
- Facilities to pre-load and teardown dynamic library dependencies (`libcuda`, `libnvrtc`, and `libnvJitLink`)

## Platforms Supported
- Linux

## Build-Scripting Requirements
- CMake >= 4.0
- LibZSTD - for binary compression
- CUDA >= 12.2

## Runtime Requirements
- CUDA >= 12.2
305 changes: 305 additions & 0 deletions cpp/librtcx/embed.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================

if(NOT TARGET zstd)
message(
FATAL_ERROR "zstd library is required for JIT embedding. Please ensure it is found by CMake."
)
endif()

# This function initializes a target for JIT embedding. It must be called before any calls to
# embed_includes() or embed_blob() for the target. It creates a dedicated INTERFACE library target
# that is used to track registered files and dependencies via target properties. The TARGET argument
# specifies the name of the target being initialized.
function(add_embed TARGET)
set(OPTIONS "")
set(ONE_VALUE_ARGS)
set(MULTI_VALUE_ARGS)
cmake_parse_arguments(ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN})

if(NOT DEFINED TARGET)
message(FATAL_ERROR "TARGET argument is required")
endif()

add_library(${TARGET}__embed_props INTERFACE)
endfunction()

# This function registers a directory of include files to be embedded for JIT compilation.
function(embed_includes TARGET)
set(OPTIONS "")
set(ONE_VALUE_ARGS SOURCE_DIRECTORY # Source directory where files will be copied from
DEST_DIRECTORY # Destination directory where files will be copied to
)
set(MULTI_VALUE_ARGS
FILES # Source files relative to SOURCE_DIRECTORY (optional, if not provided, all files under
# SOURCE_DIRECTORY will be used)
INCLUDE_DIRECTORIES # Include directories to be used when compiling with these files
)
cmake_parse_arguments(ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN})

if(NOT TARGET ${TARGET}__embed_props)
message(FATAL_ERROR "embed target '${TARGET}' has not been initialized with add_embed()")
endif()

if(NOT ARG_SOURCE_DIRECTORY
OR NOT ARG_DEST_DIRECTORY
OR NOT ARG_INCLUDE_DIRECTORIES
)
message(
FATAL_ERROR "SOURCE_DIRECTORY, DEST_DIRECTORY, and INCLUDE_DIRECTORIES arguments are required"
)
endif()

if(NOT ARG_FILES)
# gather all include files under the specified directory
file(GLOB_RECURSE INCLUDE_FILES "${ARG_SOURCE_DIRECTORY}/*")

# get their paths relative to the base include directory
set(INCLUDE_FILES_RELATIVE_PATHS "")
foreach(INCLUDE_FILE IN LISTS INCLUDE_FILES)
file(RELATIVE_PATH INCLUDE_FILE_REL_PATH "${ARG_SOURCE_DIRECTORY}" "${INCLUDE_FILE}")
list(APPEND INCLUDE_FILES_RELATIVE_PATHS "${INCLUDE_FILE_REL_PATH}")
endforeach()

set(ARG_FILES ${INCLUDE_FILES_RELATIVE_PATHS})
endif()

# check that each source file exists
foreach(SOURCE_FILE IN LISTS ARG_FILES)
if(NOT EXISTS "${ARG_SOURCE_DIRECTORY}/${SOURCE_FILE}")
message(FATAL_ERROR "Source file '${ARG_SOURCE_DIRECTORY}/${SOURCE_FILE}' does not exist")
endif()
endforeach(SOURCE_FILE)

# Determine the starting index for new IDs from the current list length
get_property(
SOURCE_FILE_IDS
TARGET ${TARGET}__embed_props
PROPERTY EMBED_SOURCE_FILE_IDS
)
list(LENGTH SOURCE_FILE_IDS IDX)

foreach(SOURCE_FILE IN LISTS ARG_FILES)
set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_SOURCE_FILE_IDS "include_${IDX}"
)
set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_SOURCE_FILES "${ARG_SOURCE_DIRECTORY}/${SOURCE_FILE}"
)
set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_SOURCE_FILE_DESTS "${ARG_DEST_DIRECTORY}/${SOURCE_FILE}"
)
math(EXPR IDX "${IDX} + 1")
endforeach()

set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_INCLUDE_DIRECTORIES ${ARG_INCLUDE_DIRECTORIES}
)

endfunction()

# This function registers a single file to be embedded for JIT compilation.
function(embed_blob TARGET)
set(OPTIONS)
set(ONE_VALUE_ARGS ID FILE DEST)
set(MULTI_VALUE_ARGS ARRAY_IDS ARRAY_VALUES)
cmake_parse_arguments(ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN})

if(NOT TARGET ${TARGET}__embed_props)
message(FATAL_ERROR "embed target '${TARGET}' has not been initialized with add_embed()")
endif()

if(NOT ARG_ID
OR NOT ARG_FILE
OR NOT ARG_DEST
)
message(FATAL_ERROR "ID, FILE, and DEST arguments are required")
endif()

if(ARG_ARRAY_IDS)
if(NOT ARG_ARRAY_VALUES)
message(FATAL_ERROR "ARRAY_VALUES argument is required when ARRAY_IDS is provided")
endif()

list(LENGTH ARG_ARRAY_IDS ARG_ARRAY_IDS_LENGTH)
list(LENGTH ARG_ARRAY_VALUES ARG_ARRAY_VALUES_LENGTH)

if(NOT ARG_ARRAY_IDS_LENGTH EQUAL ARG_ARRAY_VALUES_LENGTH)
message(FATAL_ERROR "ARRAY_IDS and ARRAY_VALUES must have the same length")
endif()

set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_ARRAY_IDS ${ARG_ARRAY_IDS}
)
set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_ARRAY_VALUES ${ARG_ARRAY_VALUES}
)
endif()

if(ARG_FILE MATCHES "\\$<TARGET_OBJECTS:([^>]+)>")
# If the file is a generator expression for target objects add as dependency
set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_TARGET_DEPS $<TARGET_OBJECTS:${CMAKE_MATCH_1}>
)
else()
if(NOT EXISTS "${ARG_FILE}")
message(FATAL_ERROR "Source file '${ARG_FILE}' does not exist")
endif()
endif()

set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_SOURCE_FILE_IDS ${ARG_ID}
)
set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_SOURCE_FILES ${ARG_FILE}
)
set_property(
TARGET ${TARGET}__embed_props
APPEND
PROPERTY EMBED_SOURCE_FILE_DESTS ${ARG_DEST}
)

endfunction()

# This function generates the necessary files and build targets to embed the registered source files
# for JIT compilation.
function(embed TARGET)
set(OPTIONS "")
set(ONE_VALUE_ARGS "COMPRESSION")
set(MULTI_VALUE_ARGS "")
cmake_parse_arguments(ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN})

if(NOT TARGET ${TARGET}__embed_props)
message(FATAL_ERROR "embed target '${TARGET}' has not been initialized with add_embed()")
endif()

if(NOT DEFINED ARG_COMPRESSION)
message(FATAL_ERROR "COMPRESSION argument is required")
endif()

if(NOT ARG_COMPRESSION STREQUAL "none" AND NOT ARG_COMPRESSION STREQUAL "zstd")
message(FATAL_ERROR "COMPRESSION argument must be either none or zstd")
endif()

get_property(
EMBED_SOURCE_FILES
TARGET ${TARGET}__embed_props
PROPERTY EMBED_SOURCE_FILES
)
if(NOT EMBED_SOURCE_FILES)
message(FATAL_ERROR "No source files registered for target '${TARGET}'")
endif()

get_property(
EMBED_SOURCE_FILE_IDS
TARGET ${TARGET}__embed_props
PROPERTY EMBED_SOURCE_FILE_IDS
)
get_property(
EMBED_SOURCE_FILE_DESTS
TARGET ${TARGET}__embed_props
PROPERTY EMBED_SOURCE_FILE_DESTS
)
get_property(
EMBED_TARGET_DEPS
TARGET ${TARGET}__embed_props
PROPERTY EMBED_TARGET_DEPS
)
get_property(
EMBED_ARRAY_IDS
TARGET ${TARGET}__embed_props
PROPERTY EMBED_ARRAY_IDS
)
get_property(
EMBED_ARRAY_VALUES
TARGET ${TARGET}__embed_props
PROPERTY EMBED_ARRAY_VALUES
)
get_property(
EMBED_INCLUDE_DIRS
TARGET ${TARGET}__embed_props
PROPERTY EMBED_INCLUDE_DIRECTORIES
)

set(OUTPUT_DIR "${CUDF_GENERATED_INCLUDE_DIR}/rtcx_embed")
set(EMBED_SCRIPT_TEMPLATE "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/embed.in.cpp")
set(CONFIGURED_EMBED_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}__embed_cfg.cpp")
set(EMBED_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}__embed.cpp")

set(EMBED_SCRIPT__ID "${TARGET}")
set(EMBED_SCRIPT__ARRAY_IDS "${EMBED_ARRAY_IDS}")
set(EMBED_SCRIPT__ARRAY_VALUES "${EMBED_ARRAY_VALUES}")
set(EMBED_SCRIPT__FILE_IDS "${EMBED_SOURCE_FILE_IDS}")
set(EMBED_SCRIPT__FILE_PATHS "${EMBED_SOURCE_FILES}")
set(EMBED_SCRIPT__FILE_DESTS "${EMBED_SOURCE_FILE_DESTS}")
set(EMBED_SCRIPT__INCLUDE_DIRS "${EMBED_INCLUDE_DIRS}")
set(EMBED_SCRIPT__COMPRESSION "${ARG_COMPRESSION}")
set(EMBED_SCRIPT__OUTPUT_DIR "${OUTPUT_DIR}")

configure_file(${EMBED_SCRIPT_TEMPLATE} ${CONFIGURED_EMBED_SCRIPT} @ONLY)
file(
GENERATE
OUTPUT "${EMBED_SCRIPT}"
INPUT "${CONFIGURED_EMBED_SCRIPT}"
)

set(RUNNER "${TARGET}__jit_embed_run")
add_executable(${RUNNER} EXCLUDE_FROM_ALL "${EMBED_SCRIPT}")
target_include_directories(${RUNNER} PRIVATE ${ZSTD_INCLUDE_DIR})
target_link_libraries(${RUNNER} PRIVATE ${CMAKE_DL_LIBS} zstd)
set_target_properties(${RUNNER} PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED YES)
target_include_directories(${RUNNER} PRIVATE ${CMAKE_CURRENT_FUNCTION_LIST_DIR})

add_custom_command(
OUTPUT ${OUTPUT_DIR}/${TARGET}.hpp ${OUTPUT_DIR}/${TARGET}.s ${OUTPUT_DIR}/${TARGET}.bin
COMMAND "${CMAKE_COMMAND}" -E env $<TARGET_FILE:${RUNNER}>
DEPENDS "${EMBED_SCRIPT}" ${EMBED_SOURCE_FILES} ${EMBED_TARGET_DEPS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Generating JIT embed for ${TARGET} into ${OUTPUT_DIR}"
VERBATIM
)

add_custom_target(
${TARGET} ALL
DEPENDS ${OUTPUT_DIR}/${TARGET}.hpp ${OUTPUT_DIR}/${TARGET}.s ${OUTPUT_DIR}/${TARGET}.bin
COMMENT "Custom target for JIT embed of ${TARGET}"
)

message(
STATUS
"JIT embed for target ${TARGET} will be generated into: ${OUTPUT_DIR}/${TARGET}.hpp ${OUTPUT_DIR}/${TARGET}.s ${OUTPUT_DIR}/${TARGET}.bin"
)

set(${TARGET}_INCLUDE_DIRS
"${OUTPUT_DIR}"
PARENT_SCOPE
)

set(${TARGET}_SOURCE_DIR
${OUTPUT_DIR}
PARENT_SCOPE
)

endfunction()
Loading
Loading