{"id":15903550,"url":"https://github.com/vfdev-5/nncpp","last_synced_at":"2025-08-31T04:07:03.134Z","repository":{"id":149001426,"uuid":"238064613","full_name":"vfdev-5/nncpp","owner":"vfdev-5","description":"[WIP] NNCpp - Neural Networks in C++ with CUDA ops","archived":false,"fork":false,"pushed_at":"2020-02-03T21:23:03.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T20:15:31.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vfdev-5.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":"2020-02-03T21:21:22.000Z","updated_at":"2023-09-07T05:13:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ea57aa5-c48f-4501-8048-b955f067cbcd","html_url":"https://github.com/vfdev-5/nncpp","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"073319d55acabebfa134479f0501aed2d0cbef4b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vfdev-5/nncpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2Fnncpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2Fnncpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2Fnncpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2Fnncpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vfdev-5","download_url":"https://codeload.github.com/vfdev-5/nncpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2Fnncpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272936425,"owners_count":25018161,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-06T12:02:41.034Z","updated_at":"2025-08-31T04:07:03.111Z","avatar_url":"https://github.com/vfdev-5.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [WIP] NNCpp - Neural Networks in C++ with CUDA ops\n\n**Warning:** _This is my playground project to implement tensor ops, neural networks, gradient computations etc._\n_Code structure and assumptions made may be restrictive. CUDA Kernel implementations are not optimized for performances_\n_and may not work in all cases._\n\n\n- NNCpp library\n  - Tensor (CPU/CUDA) on [Unified Memory](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-unified-memory-programming-hd)\n  - Layers: activations, convolution on CUDA only\n  - Model: list of layers\n  - Criterion: CrossEntropy, MSE\n- Example applications\n- Tests\n\n## Requirements\n\n- g++\n- cuda 10.1, nvcc\n- gtests:\n```\napt-get install -y libgtest-dev\ncd /usr/src/gtest \u0026\u0026 cmake . \u0026\u0026 make \u0026\u0026 mv libg* /usr/lib/\n```\n\n## Installation\n\n```\nmkdir build \u0026\u0026 cd $_\ncmake .. \u0026\u0026 make\n```\n\n## NNCpp API\n\n- Tensor : \"tensor.hpp\"\n\n  - All tensors are 4D. \n  - Data allocated in [\"Unified Memory\"](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-unified-memory-programming-hd) for all devices: CPU/CUDA.\n\n\n```c++\n#include \u003ciostream\u003e\n#include \"tensor.hpp\"\n\nauto t_cpu = nncpp::Tensor::zeros(n, c, h, w, Device::CPU);\nauto t_cuda = nncpp::Tensor::ones(n, c, h, w, Device::CUDA);\n\nstd::cout \u003c\u003c t_cpu \u003c\u003c std::endl;\nstd::cout \u003c\u003c t_cuda \u003c\u003c std::endl;\n\nt_cpu.at(0, 0, 0, 0) = 1.0f;\nt_cuda.at(0, 0, 0, 0) = 2.0f;\n```\n\n- NN operations: \"activations.hpp\", \n\n## Run applications\n\n\n\n### Extend applications \n\n\n## Tests\n```\ncd build\ncmake .. \u0026 make \u0026\u0026 ./test-nncpp\n```\n\n### Profiling \n\n```\ncd build\nnvprof ./test-nncpp\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfdev-5%2Fnncpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvfdev-5%2Fnncpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfdev-5%2Fnncpp/lists"}