{"id":13438790,"url":"https://github.com/autumnai/collenchyma","last_synced_at":"2025-05-16T18:05:17.239Z","repository":{"id":57608378,"uuid":"46428698","full_name":"autumnai/collenchyma","owner":"autumnai","description":"Extendable HPC-Framework for CUDA, OpenCL and common CPU","archived":false,"fork":false,"pushed_at":"2016-04-23T16:46:32.000Z","size":3422,"stargazers_count":477,"open_issues_count":23,"forks_count":32,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-05-16T18:02:47.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://autumnai.github.io/collenchyma","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/autumnai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-18T15:42:46.000Z","updated_at":"2025-05-02T00:29:33.000Z","dependencies_parsed_at":"2022-09-03T10:01:01.886Z","dependency_job_id":null,"html_url":"https://github.com/autumnai/collenchyma","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autumnai%2Fcollenchyma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autumnai%2Fcollenchyma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autumnai%2Fcollenchyma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autumnai%2Fcollenchyma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autumnai","download_url":"https://codeload.github.com/autumnai/collenchyma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582903,"owners_count":22095518,"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":[],"created_at":"2024-07-31T03:01:08.463Z","updated_at":"2025-05-16T18:05:17.197Z","avatar_url":"https://github.com/autumnai.png","language":"Rust","funding_links":[],"categories":["Libraries","库 Libraries","库","Rust","Machine Learning"],"sub_categories":["Computation","计算 Computation","计算"],"readme":"# Collenchyma • [![Join the chat at https://gitter.im/autumnai/collenchyma](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg)](https://gitter.im/autumnai/collenchyma?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![Build Status](https://travis-ci.org/autumnai/collenchyma.svg?branch=master)](https://travis-ci.org/autumnai/collenchyma) [![Coverage Status](https://coveralls.io/repos/autumnai/collenchyma/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/autumnai/collenchyma?branch=master) [![Crates.io](http://meritbadge.herokuapp.com/collenchyma)](https://crates.io/crates/collenchyma) [![License](https://img.shields.io/crates/l/collenchyma.svg)](LICENSE)\n\nCollenchyma is an extensible, pluggable, backend-agnostic framework for parallel,\nhigh-performance computations on CUDA, OpenCL and common host CPU. It is fast, easy\nto build and provides an extensible Rust struct to execute operations on almost any\nmachine, even if it does not have CUDA or OpenCL capable devices.\n\nCollenchyma's abstracts over the different computation languages (Native,\nOpenCL, Cuda) and let's you run highly-performant code, thanks to easy\nparallelization, on servers, desktops or mobiles without the need to adapt your\ncode for the machine you deploy to. Collenchyma does not require OpenCL or Cuda\non the machine and automatically falls back to the native host CPU, making your\napplication highly flexible and fast to build.\n\nCollenchyma was started at [Autumn][autumn] to support the Machine Intelligence\nFramework [Leaf][leaf] with backend-agnostic, state-of-the-art performance.\n\n* __Parallelizing Performance__\u003cbr/\u003e\nCollenchyma makes it easy to parallelize computations on your machine, putting\nall the available cores of your CPUs/GPUs to use.\nCollenchyma provides optimized operations through Plugins,\nthat you can use right away to speed up your application.\n\n* __Easily Extensible__\u003cbr/\u003e\nWriting custom operations for GPU execution becomes easy with Collenchyma, as\nit already takes care of Framework peculiarities, memory management, safety and other\noverhead. Collenchyma provides Plugins (see examples below), that you can use to extend\nthe Collenchyma backend with your own, business-specific operations.\n\n* __Butter-smooth Builds__\u003cbr/\u003e\nAs Collenchyma does not require the installation of various frameworks and\nlibraries, it will not add significantly to the build time of your application.\nCollenchyma checks at run-time if these frameworks can be used and gracefully\nfalls back to the standard, native host CPU if they are not.\nNo long and painful build procedures for you or your users.\n\nFor more information,\n\n* see Collenchyma's [Documentation](http://autumnai.github.io/collenchyma)\n* or get in touch on [Twitter][twitter-autumn] or [Gitter][gitter-collenchyma]\n\n\u003e Disclaimer: Collenchyma is currently in a very early and heavy stage of\n\u003e development. If you are experiencing any bugs that are not due to not yet\n\u003e implemented features, feel free to create an issue.\n\n[arrayfire]: https://github.com/arrayfire/arrayfire\n[autumn]: http://autumnai.com\n[leaf]: https://github.com/autumnai/leaf\n[twitter-autumn]: https://twitter.com/autumn_eng\n\n## Getting Started\n\nIf you're using Cargo, just add Collenchyma to your Cargo.toml:\n\n    [dependencies]\n    collenchyma = \"0.0.8\"\n\nIf you're using [Cargo Edit][cargo-edit], you can call:\n\n    $ cargo add collenchyma\n\n[cargo-edit]: https://github.com/killercup/cargo-edit\n\n## Plugins\n\nYou can easily extend Collenchyma's `Backend` with more backend-agnostic operations, through Plugins.\nPlugins provide a set of related operations - BLAS would be a good example. To extend Collenchyma's `Backend`\nwith operations from a Plugin, just add a the desired Plugin crate to your Cargo.toml file.\nHere is a list of available Collenchyma Plugins, that you can use right away for your own application, or\ntake as a starting point, if you would like to create your own Plugin.\n\n* [BLAS][collenchyma-blas] - Collenchyma plugin for backend-agnostic Basic Linear Algebra Subprogram Operations.\n* [NN][collenchyma-nn] - Collenchyma plugin for Neural Network related algorithms.\n\nYou can easily write your own backend-agnostic, parallel operations and provide it for others,\nvia a Plugin - we are happy to feature your Plugin here, just send us a PR.\n\n[collenchyma-blas]: http://github.com/autumnai/collenchyma-blas\n[collenchyma-nn]: http://github.com/autumnai/collenchyma-nn\n\n## Examples\n\nCollenchyma comes without any operations. The following examples therefore assumes,\nthat you have added both `collenchyma` and the Collenchyma Plugin `collenchyma-nn`\nto your Cargo manifest.\n\n```rust\nextern crate collenchyma as co;\nextern crate collenchyma_nn as nn;\nuse co::prelude::*;\nuse nn::*;\n\nfn write_to_memory\u003cT: Copy\u003e(mem: \u0026mut MemoryType, data: \u0026[T]) {\n    if let \u0026mut MemoryType::Native(ref mut mem) = mem {\n        let mut mem_buffer = mem.as_mut_slice::\u003cT\u003e();\n        for (index, datum) in data.iter().enumerate() {\n            mem_buffer[index] = *datum;\n        }\n    }\n}\n\nfn main() {\n    // Initialize a CUDA Backend.\n    let backend = Backend::\u003cCuda\u003e::default().unwrap();\n    // Initialize two SharedTensors.\n    let mut x = SharedTensor::\u003cf32\u003e::new(backend.device(), \u0026(1, 1, 3)).unwrap();\n    let mut result = SharedTensor::\u003cf32\u003e::new(backend.device(), \u0026(1, 1, 3)).unwrap();\n    // Fill `x` with some data.\n    let payload: \u0026[f32] = \u0026::std::iter::repeat(1f32).take(x.capacity()).collect::\u003cVec\u003cf32\u003e\u003e();\n    let native = Backend::\u003cNative\u003e::default().unwrap();\n    x.add_device(native.device()).unwrap(); // Add native host memory\n    x.sync(native.device()).unwrap(); // Sync to native host memory\n    write_to_memory(x.get_mut(native.device()).unwrap(), payload); // Write to native host memory.\n    x.sync(backend.device()).unwrap(); // Sync the data to the CUDA device.\n    // Run the sigmoid operation, provided by the NN Plugin, on your CUDA enabled GPU.\n    backend.sigmoid(\u0026mut x, \u0026mut result).unwrap();\n    // See the result.\n    result.add_device(native.device()).unwrap(); // Add native host memory\n    result.sync(native.device()).unwrap(); // Sync the result to host memory.\n    println!(\"{:?}\", result.get(native.device()).unwrap().as_native().unwrap().as_slice::\u003cf32\u003e());\n}\n```\n\n## Contributing\n\nWant to contribute? Awesome! We have\n[instructions to help you get started contributing code or documentation][contributing].\nAnd high priority issues, that we could need your help with.\n\nWe have a mostly real-time collaboration culture and happens here on Github and\non the [Collenchyma Gitter Channel][gitter-collenchyma].\nYou can also reach out to the Maintainers\n{[@MJ][mj], [@hobofan][hobofan]}.\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as below, without any additional terms or\nconditions.\n\n[issue-2]: https://github.com/autumnai/collenchyma/issues/2\n[issue-4]: https://github.com/autumnai/collenchyma/issues/4\n[issue-5]: https://github.com/autumnai/collenchyma/issues/5\n[issue-6]: https://github.com/autumnai/collenchyma/issues/6\n[contributing]: CONTRIBUTING.md\n[gitter-collenchyma]: https://gitter.im/autumnai/collenchyma\n[mj]: https://twitter.com/mjhirn\n[hobofan]: https://twitter.com/hobofan\n\n## Changelog\n\nYou can find the release history in the root file [CHANGELOG.md][changelog].\n\n\u003e A changelog is a log or record of all the changes made to a project, such as a website or software project, usually including such records as bug fixes, new features, etc. - [Wikipedia][changelog-quote]\n\nWe are using [Clog][clog], the Rust tool for auto-generating CHANGELOG files.\n\n[changelog]: CHANGELOG.md\n[changelog-quote]: https://en.wikipedia.org/wiki/Changelog\n[Clog]: https://github.com/clog-tool/clog-cli\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautumnai%2Fcollenchyma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautumnai%2Fcollenchyma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautumnai%2Fcollenchyma/lists"}