{"id":13648550,"url":"https://github.com/calebzulawski/multiversion","last_synced_at":"2025-05-14T19:09:31.576Z","repository":{"id":50534433,"uuid":"206720734","full_name":"calebzulawski/multiversion","owner":"calebzulawski","description":"Easy function multiversioning for Rust","archived":false,"fork":false,"pushed_at":"2024-12-08T05:48:48.000Z","size":320,"stargazers_count":221,"open_issues_count":5,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T06:49:21.193Z","etag":null,"topics":["cpu-features","function-multiversioning","macro","multiversion","rust","simd"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calebzulawski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2019-09-06T05:38:28.000Z","updated_at":"2025-03-26T10:28:49.000Z","dependencies_parsed_at":"2024-05-18T20:28:28.815Z","dependency_job_id":"5edc35c7-7128-4ae5-bb15-ad9e8ba692b7","html_url":"https://github.com/calebzulawski/multiversion","commit_stats":{"total_commits":261,"total_committers":4,"mean_commits":65.25,"dds":"0.026819923371647514","last_synced_commit":"8562897d5376c040b6c795efadc098221063d7b9"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebzulawski%2Fmultiversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebzulawski%2Fmultiversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebzulawski%2Fmultiversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebzulawski%2Fmultiversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calebzulawski","download_url":"https://codeload.github.com/calebzulawski/multiversion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"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":["cpu-features","function-multiversioning","macro","multiversion","rust","simd"],"created_at":"2024-08-02T01:04:20.538Z","updated_at":"2025-05-14T19:09:30.210Z","avatar_url":"https://github.com/calebzulawski.png","language":"Rust","funding_links":[],"categories":["Rust","Libraries"],"sub_categories":["Performance"],"readme":"Multiversion\n============\n[![Crates.io](https://img.shields.io/crates/v/multiversion)](https://crates.io/crates/multiversion)\n[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/multiversion)\n![Rustc Version 1.61+](https://img.shields.io/badge/rustc-1.61+-lightgray.svg)\n[![License](https://img.shields.io/crates/l/multiversion)](https://crates.io/crates/multiversion)\n\nFunction multiversioning attribute macros for Rust.\n\n## What is function multiversioning?\nMany CPU architectures have a variety of instruction set extensions that provide additional functionality.\nCommon examples are single instruction, multiple data (SIMD) extensions such as SSE and AVX on x86/x86-64 and NEON on ARM/AArch64.\nWhen available, these extended features can provide significant speed improvements to some functions.\nThese optional features cannot be haphazardly compiled into programs--executing an unsupported instruction will result in a crash.\n\n**Function multiversioning** is the practice of compiling multiple versions of a function with various features enabled and safely detecting which version to use at runtime.\n\n## Example\nThe `multiversion` macro compiles a function for multiple possible targets, and selects the optimal one at runtime:\n```rust\nuse multiversion::multiversion;\n\n#[multiversion(targets(\"x86_64+avx\", \"aarch64+neon\"))]\nfn square(x: \u0026mut [f32]) {\n    for v in x {\n        *v *= *v;\n    }\n}\n```\n\n## License\nMultiversion is distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebzulawski%2Fmultiversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalebzulawski%2Fmultiversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebzulawski%2Fmultiversion/lists"}