{"id":17980987,"url":"https://github.com/nvidia/jitify","last_synced_at":"2025-05-15T12:06:16.190Z","repository":{"id":24387097,"uuid":"90589123","full_name":"NVIDIA/jitify","owner":"NVIDIA","description":"A single-header C++ library for simplifying the use of CUDA Runtime Compilation (NVRTC).","archived":false,"fork":false,"pushed_at":"2025-05-13T11:19:06.000Z","size":553,"stargazers_count":533,"open_issues_count":24,"forks_count":71,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-05-13T12:28:18.416Z","etag":null,"topics":["cpp","cuda","jit-compilation","nvrtc","runtime-compilation","single-header"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NVIDIA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-08T05:19:07.000Z","updated_at":"2025-04-02T02:03:27.000Z","dependencies_parsed_at":"2025-03-25T03:11:10.082Z","dependency_job_id":"b9638dac-56dc-47cc-9bd3-720ff1735709","html_url":"https://github.com/NVIDIA/jitify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fjitify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fjitify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fjitify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fjitify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NVIDIA","download_url":"https://codeload.github.com/NVIDIA/jitify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337613,"owners_count":22054253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cuda","jit-compilation","nvrtc","runtime-compilation","single-header"],"created_at":"2024-10-29T18:07:12.481Z","updated_at":"2025-05-15T12:06:11.176Z","avatar_url":"https://github.com/NVIDIA.png","language":"C++","readme":"\n# Jitify\n\nA single-header C++ library for simplifying the use of CUDA Runtime Compilation (NVRTC).\n\n## Rationale\n\nIntegrating NVRTC into existing and/or templated CUDA code can be\ntricky. Jitify aims to simplify this process by hiding the\ncomplexities behind a simple, high-level interface.\n\n## Quick example\n\n```c++\nconst char* program_source = \"my_program\\n\"\n    \"template\u003cint N, typename T\u003e\\n\"\n    \"__global__\\n\"\n    \"void my_kernel(T* data) {\\n\"\n    \"    T data0 = data[0];\\n\"\n    \"    for( int i=0; i\u003cN-1; ++i ) {\\n\"\n    \"        data[0] *= data0;\\n\"\n    \"    }\\n\"\n    \"}\\n\";\nstatic jitify::JitCache kernel_cache;\njitify::Program program = kernel_cache.program(program_source);\n// ...set up data etc.\ndim3 grid(1);\ndim3 block(1);\nusing jitify::reflection::type_of;\nprogram.kernel(\"my_kernel\")\n       .instantiate(3, type_of(*data))\n       .configure(grid, block)\n       .launch(data);\n```\n\n## Features\n\nJitify provides/takes care of the following things:\n\n * All NVRTC and CUDA Driver API calls\n * Simple kernel instantiation and launch syntax\n * Caching compiled kernels\n * Loading source code from strings, files, or embedded in an executable\n * Ignoring host code in runtime-compiled sources\n * Skipping unneeded headers\n * Support for JIT-safe standard library headers (e.g., float.h, stdint.h etc.)\n * Dealing with kernel name mangling\n * Reflecting kernel template parameters into strings\n * Compiling specifically for the current device's compute capability\n * Linking to pre-compiled PTX/CUBIN/FATBIN/object/library files\n * Support for CUDA versions 7.0, 7.5, 8.0, 9.x, 10.x, on both Linux and Windows\n * Convenient parallel_for function and lambda support\n * \\*New\\* jitify::experimental API provides serialization capabilities to enable [user-managed hashing and caching](https://github.com/rapidsai/cudf/blob/v0.12.0/cpp/src/jit/cache.h)\n\nThings you can do with Jitify and NVRTC:\n\n * *Rapidly port existing code* to use CUDA Runtime Compilation\n * *Dramatically reduce code volume* and offline-compilation times\n * *Increase kernel performance* by baking in runtime constants and autotuning\n\n## How to build\n\nJitify is just a single header file:\n\n```c++\n#include \u003cjitify.hpp\u003e\n```\n\nCompile with: `-pthread` (not needed if JITIFY_THREAD_SAFE is defined to 0)\n\nLink with: `-lcuda -lcudart -lnvrtc`\n\nA small utility called stringify is included for converting text files into\nC string literals, which provides a convenient way to integrate JIT-compiled\nsources into a build.\n\n### Running tests\n\nTests can be run with the following command:\n\n```shell\n$ make test\n```\n\nThis will automatically download and build the\n[GoogleTest](https://github.com/google/googletest) library, which\nrequires [CMake](https://cmake.org) to be available on the system.\n\n## Documentation\n\n### Examples\n\nSee [jitify_example.cpp](jitify_example.cpp) for some examples of how to use the library.\nThe [Makefile](Makefile) also demonstrates how to use the provided stringify utility.\n\n[GTC 2017 Talk by Ben Barsdell and Kate Clark](https://on-demand.gputechconf.com/gtc/2017/videos/s7716-barsdell-ben-jitify.mp4)\n\n### API documentation\n\nDoxygen documentation can be generated by running:\n\n```shell\n$ make doc\n```\n\nThe HTML and LaTeX results are placed into the doc/ subdirectory.\n\n## License\n\nBSD-3-Clause\n\n## Authors\n\nBen Barsdell (NVIDIA, bbarsdell at nvidia dot com)\n\nKate Clark (NVIDIA, mclark at nvidia dot com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia%2Fjitify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvidia%2Fjitify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvidia%2Fjitify/lists"}