{"id":13802243,"url":"https://github.com/mil-tokyo/sushi2","last_synced_at":"2025-05-13T13:30:24.648Z","repository":{"id":57297179,"uuid":"72804273","full_name":"mil-tokyo/sushi2","owner":"mil-tokyo","description":"Matrix Library for JavaScript","archived":true,"fork":false,"pushed_at":"2017-01-17T06:47:21.000Z","size":790,"stargazers_count":60,"open_issues_count":5,"forks_count":4,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-05-14T02:41:20.674Z","etag":null,"topics":["gpu-computing","javascript","matrix-library","webcl"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mil-tokyo.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}},"created_at":"2016-11-04T01:52:38.000Z","updated_at":"2023-07-13T15:12:18.000Z","dependencies_parsed_at":"2022-09-01T08:41:25.779Z","dependency_job_id":null,"html_url":"https://github.com/mil-tokyo/sushi2","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mil-tokyo%2Fsushi2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mil-tokyo%2Fsushi2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mil-tokyo%2Fsushi2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mil-tokyo%2Fsushi2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mil-tokyo","download_url":"https://codeload.github.com/mil-tokyo/sushi2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225218004,"owners_count":17439712,"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":["gpu-computing","javascript","matrix-library","webcl"],"created_at":"2024-08-04T00:01:40.057Z","updated_at":"2024-11-18T17:31:12.921Z","avatar_url":"https://github.com/mil-tokyo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sushi2 library\nMatrix Library for JavaScript\n\nThis library is intended to be the fastest matrix library for JavaScript, with the power of GPU computing.\nTo gain best performance, [WebCL](https://en.wikipedia.org/wiki/WebCL) technology is used to access GPU from JavaScript.\n\n[Interactive getting started on the browser](https://mil-tokyo.github.io/sushilab/?loadurl=notebooks/gettingstarted.json)\n\n[Documents (work in progress)](https://mil-tokyo.github.io/sushi2/)\n\n# Build for use in node.js\nSince this project is written in TypeScript, transpiling to JavaScript is necessary.\n\nPackage from npm repository contains transplied JavaScript, so simply installing them is enough.\n\n```bash\nnpm install milsushi2\n```\n\nIf you intend to modify code, download and build. \n\n```bash\ngit clone https://github.com/mil-tokyo/sushi2\ncd sushi2\nnpm install\nnpm run build\n```\n\nSushi2 depends on [node-opencl](https://github.com/mikeseven/node-opencl) for GPU computing which allows dramatically faster computation.\nThis dependency is optional, so even the installation of node-opencl fails, Sushi2 can work without it.\n\nIn my environment (Ubuntu 14.04 + NVIDIA CUDA 7.5), installation with node-opencl requires additional environment variables.\n\n```bash\nCPLUS_INCLUDE_PATH=/usr/local/cuda/include LIBRARY_PATH=/usr/local/cuda/lib64 npm install milsushi2\n```\n\n# Build for use in web browser\nFor simply using the library, download the js file from [releases page](https://github.com/mil-tokyo/sushi2/releases).\n\nTo make single JavaScript file for web browsers, type the following commands:\n\n```bash\ngit clone https://github.com/mil-tokyo/sushi2\ncd sushi2\nnpm install\nnpm run build\nnpm run browserify\n```\n\nThis will generate `browser/milsushi2.js` (without WebCL support), and `browser/milsushi2_cl.js` (WebCL support version).\n\n# Usage in node.js\nYou can import the module by `require('milsushi2')`.\n\nHello world in node shell\n\n```javascript\nvar $M = require('milsushi2');\n$M.initcl();//OpenCL initialization, true if succeeds\nvar x = $M.jsa2mat([[1,2],[3,4]]);\nvar y = $M.jsa2mat([[0.1,0.5],[0.7,0.0]]);\n$M.plus(x, y);\n```\n\n# Usage in web browser\nBy loading them from html page (`\u003cscript src=\"milsushi2.js\"\u003e\u003c/script\u003e`), `milsushi2` global object is generated.\n\nHello world in html\n\n```html\n\u003cscript\u003e\nvar $M = milsushi2;\nvar x = $M.jsa2mat([[1,2],[3,4]]);\nvar y = $M.jsa2mat([[0.1,0.5],[0.7,0.0]]);\nalert($M.plus(x, y));\n\u003c/script\u003e\n```\n\nTo use WebCL for GPU computing, use `milsushi2_cl.js` instead of `milsushi2`.\n\nUnfortunately, currently a plugin is needed to enable WebCL. We tested on [webcl-firefox](https://github.com/toaarnio/webcl-firefox) plugin with [Firefox 32](https://ftp.mozilla.org/pub/firefox/releases/32.0/).\nCompiled version of webcl-firefox plugin for Linux is [here](https://drive.google.com/file/d/0BxKvBdxU_LchMWVVUWFGVS1NcE0/view?usp=sharing) (Ubuntu 14.04 + CUDA 7.5, commit d87447f, License: MPL 2.0).\n\nIf WebCL is enabled, `$M.initcl()` should return true.\n\n# License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmil-tokyo%2Fsushi2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmil-tokyo%2Fsushi2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmil-tokyo%2Fsushi2/lists"}