{"id":14977837,"url":"https://github.com/qureshizawar/cuda-quartic-solver","last_synced_at":"2025-07-18T03:33:39.167Z","repository":{"id":57459299,"uuid":"190727760","full_name":"qureshizawar/CUDA-quartic-solver","owner":"qureshizawar","description":"A general cubic equation solver and quartic equation minimisation solver written for CPU and Nvidia GPUs, for more details and results, see: https://arxiv.org/abs/1903.10041. The library is available for C++/CUDA as well as Python using Pybind11.","archived":false,"fork":false,"pushed_at":"2020-06-15T10:11:21.000Z","size":65,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T19:09:43.909Z","etag":null,"topics":["cmake","cubic-equations","cuda","cuda-quartic-solver","gpu","minimisation","numpy","nvidia-gpus","openmp","optimization","pip","pybind11","python","quartic","quartic-equations","quartic-functions","quartic-minimisation","solver"],"latest_commit_sha":null,"homepage":"","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/qureshizawar.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":"2019-06-07T10:44:44.000Z","updated_at":"2025-03-06T04:26:10.000Z","dependencies_parsed_at":"2022-09-10T15:40:55.092Z","dependency_job_id":null,"html_url":"https://github.com/qureshizawar/CUDA-quartic-solver","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/qureshizawar/CUDA-quartic-solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qureshizawar%2FCUDA-quartic-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qureshizawar%2FCUDA-quartic-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qureshizawar%2FCUDA-quartic-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qureshizawar%2FCUDA-quartic-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qureshizawar","download_url":"https://codeload.github.com/qureshizawar/CUDA-quartic-solver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qureshizawar%2FCUDA-quartic-solver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265696689,"owners_count":23812825,"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":["cmake","cubic-equations","cuda","cuda-quartic-solver","gpu","minimisation","numpy","nvidia-gpus","openmp","optimization","pip","pybind11","python","quartic","quartic-equations","quartic-functions","quartic-minimisation","solver"],"created_at":"2024-09-24T13:56:24.866Z","updated_at":"2025-07-18T03:33:39.127Z","avatar_url":"https://github.com/qureshizawar.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA-quartic-solver\n\n![GitHub](https://img.shields.io/github/license/qureshizawar/CUDA-quartic-solver)\n[![Build Status](https://travis-ci.org/qureshizawar/CUDA-quartic-solver.svg?branch=master)](https://travis-ci.org/qureshizawar/CUDA-quartic-solver)\n[![PyPI](https://img.shields.io/pypi/v/QuarticSolver)](https://pypi.org/project/QuarticSolver/)\n[![Downloads](https://pepy.tech/badge/quarticsolver)](https://pepy.tech/project/quarticsolver)\n\nA general cubic equation solver and quartic equation minimisation solver written for CPU and Nvidia GPUs, for more details and results, see: https://arxiv.org/abs/1903.10041. The library is available for C++/CUDA as well as Python using Pybind11.\n\n## Running the solver\n\n### Requirements\n\n1) CUDA 9.0+ capable GPU and nvcc required to run the GPU solvers\n2) CMake 3.8+\n3) Python 3.6, numpy (if using Python)\n4) Pybind11 v2.5.0+ ([installation instructions](https://stackoverflow.com/a/56552686))\n\n### CMake\n\nCMake can be used to build the project, for example:\n```\ngit clone --recursive https://github.com/qureshizawar/CUDA-quartic-solver\nmkdir build \u0026\u0026 cd build\ncmake -D CMAKE_BUILD_TYPE=Release ../ -D CPP_exe=true -D GPU_build=false\nmake\n```\n\nWhen the `CPP_exe` flag is set to `true`, CMake will build a c++ executable, then ```quartic_solver_main``` can be executed to run the example code.\nWhen the `GPU_build` flag is set to `true`, CMake will build the CUDA capable version of the library.\n\n### Python\nThe Python package can be installed via PyPI:\n```\npip install QuarticSolver\n```\nOr package can be installed by building its `.whl` file, for example:\n```\ngit clone --recursive https://github.com/qureshizawar/CUDA-quartic-solver\npython setup.py bdist_wheel --GPU_build True\n```\nWhen the `GPU_build` flag is set to `True`, the CUDA capable version of the library will be built.\nThe built `.whl` can then be used to install the package, for example:\n```\npip install ./dist/QuarticSolver-0.1.1-cp36-cp36m-linux_x86_64.whl\n```\n\n### Usage\nPlease see `src/main.cu`, `src/cpu_main.cpp`, and the examples in the `/tests` folder for detailed usage examples\n##### C++\nGiven quartic functions of the form `Ax^4 + Bx^3 + Cx^2 + Dx + E` the minimiser for the quartic functions can calculated on the CPU by calling the following function from `cpu_solver.cpp`:\n```\nQuarticMinimumCPU(N, A, B, C, D, E, min);\n```\nWhere:\n- `N` is the number of functions\n- `A` is an array containing the coefficient A for each of the quartic functions\n- `B` is an array containing the coefficient B for each of the quartic functions\n- `C` is an array containing the coefficient C for each of the quartic functions\n- `D` is an array containing the coefficient D for each of the quartic functions\n- `E` is an array containing the coefficient E for each of the quartic functions\n- `min` is an array which will contain the corresponding minimums for each of the quartic functions\n\nThe calculations can be carried out on a GPU by using `QuarticMinimumGPU` or `QuarticMinimumGPUStreams`. Please note signifcant performance improvement is observed when `N\u003e10000` for `QuarticMinimumGPU` vs `QuarticMinimumGPUStreams`\n\n##### Python\nThe Python version of the library can be used as follows:\n```\nimport numpy as np\nimport QuarticSolver\n\nminimum = QuarticSolver.QuarticMinimum(A,B,C,D,E,True)\n```\nWhere `A`,`B`,`C`,`D`,`E` are numpy arrays containing the quartic function coefficients and the final arg is a boolean flag which if set to `True` will use the GPU if possible. `minimum` is the returned numpy array containing the corresponding minimisers.\n## TODO\n\n1) Add multi-gpu support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqureshizawar%2Fcuda-quartic-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqureshizawar%2Fcuda-quartic-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqureshizawar%2Fcuda-quartic-solver/lists"}