{"id":37625712,"url":"https://github.com/mphowardlab/hipper","last_synced_at":"2026-01-16T10:48:00.468Z","repository":{"id":52947060,"uuid":"263757907","full_name":"mphowardlab/hipper","owner":"mphowardlab","description":"A GPU runtime compatibility layer for CUDA and HIP","archived":false,"fork":false,"pushed_at":"2025-03-10T18:52:12.000Z","size":45,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T19:43:02.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mphowardlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-13T22:33:37.000Z","updated_at":"2025-03-10T18:52:18.000Z","dependencies_parsed_at":"2022-08-28T09:53:22.327Z","dependency_job_id":null,"html_url":"https://github.com/mphowardlab/hipper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mphowardlab/hipper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphowardlab%2Fhipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphowardlab%2Fhipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphowardlab%2Fhipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphowardlab%2Fhipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mphowardlab","download_url":"https://codeload.github.com/mphowardlab/hipper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mphowardlab%2Fhipper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-16T10:47:59.810Z","updated_at":"2026-01-16T10:48:00.454Z","avatar_url":"https://github.com/mphowardlab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hipper\n\nhipper is a compatability layer for the CUDA and HIP runtime APIs. It relaxes\ndependencies for projects that would like to *optionally* use HIP to support\nmultiple GPU architectures, but do not want to require it. hipper only implements\nthe features that are common to both CUDA and HIP. These features must also be\nsupported across multiple versions of CUDA for maximum cross-compatibility.\n\n## Quick start\n\nhipper is meant to be a header-only drop in for `\u003ccuda_runtime.h\u003e`\nor `\u003chip/hip_runtime.h\u003e`:\n\n```\n#include \u003chipper/hipper_runtime.h\u003e\n```\n\nOne of the GPU runtime backends must be selected at compile time. These\ncan be either `HIPPER_CUDA` (to use the CUDA runtime) or `HIPPER_HIP`\n(to use the HIP runtime). If `HIPPER_HIP` is selected, then HIP options\ncan still be used to select between the CUDA or HIP backends.\n\nA few defines are additionally provided for interoperability in device code:\n\n* `HIPPER_PLATFORM_NVCC` if targeting nvcc platform; otherwise undefined.\n* `HIPPER_PLATFORM_HCC` if target hcc platform; otherwise undefined.\n* `HIPPER_DEVICE_COMPILE` is 1 if compiling device code; otherwise undefined.\n\nRefer to the HIP documentation for more detail about under which conditions\neach of these flags is set, and how it can be used to replace CUDA-specific checks.\n\n## Runtime functions\n\nMost of the runtime API has been placed in the `hipper` namespace, and it is easy to\nconvert between CUDA or HIP commands to `hipper` commands by replacing either\n`cuda` or `hip` with `hipper::` in the function signature.\n\n```\ncudaMemset -\u003e hipper::memset\ncudaMemcpyAsync -\u003e hipper::memcpyAsync\n```\n\nSee the [detailed API](doc/runtime.md) for details about what functions are supported.\n\nMost of the CUDA or HIP data types or defines have also been spoofed in the `hipper`\nnamespace as enums or constants. You should work with the `hipper` types of these\nparameters, which will usually be automatically converted as needed to pass to the\nbackend functions.\n\n```\nfloat* a;\nconst int N = 4;\nhipper::error_t code = hipper::malloc(reinterpret_cast\u003cvoid**\u003e(\u0026a), N*sizeof(float));\nif (code != hipper::success)\n    {\n    std::cout \u003c\u003c \"GPU error: \" \u003c\u003c hipper::getErrorString(code) \u003c\u003c std::endl;\n    exit(code);\n    }\n```\n\nThe caller is responsible for only using properties of data types that are present in\nthe underlying API (e.g., members of `hipper::deviceProp_t` common to CUDA and HIP),\nor a compile error may be generated. If certain features are required in CUDA builds,\nuse the `HIPPER_PLATFORM_NVCC` define.\n\n## Kernel launch\n\nKernel launch is abstracted inside of a `KernelLauncher` class. The class has many different\nconstructors that allow different variations of specifying the launch dimensions and additional\nresources (shared memory, streams). Once constructed, the launcher can be used to execute kernels:\n\n```\nhipper::KernelLauncher launcher(blocks, threadsPerBlock, sharedBytes, stream);\nlauncher(kernel, args...)\n```\n\nWithin a kernel, a thread can be automatically mapped to a one-dimensional rank using the\n`hipper::threadRank\u003cGridDim,BlockDim\u003e` function template.\n\n```\nint idx = threadRank\u003c1,1\u003e();\nif (idx \u003e= num_threads) return;\n```\n\nCurrently, specializations are provided for `GridDim=1` and `BlockDim=1,2,3`, but additional\nones can be specified. See also the device functions for accessing the dimensions of the\nlaunch configuration if more advanced control is required.\n\n## Deprecated features\n\nHIP has some deprecated features that are fully functional in CUDA. If you want to enable\nthese, you can opt in:\n\n```\n#define HIPPER_USE_DEPRECATED\n#include \u003chipper/hipper_runtime.h\u003e\n```\n\n## CMake setup \u0026 installation\n\nhipper has a functional CMake build system if you would like to install it to a shared location\non your system. This installation can be detected using `find_package` in `CONFIG` mode.\nAlternatively, hipper can be included directly in an existing project via `add_subdirectory`.\nIn either case, please link against the `hipper::hipper` target.\n\n## Contributing\n\nSupport for additional features or defines is always welcome! Please submit a pull request in the\nstyle of the existing code, including a new entry in the API documentation. If you identify any\nissues with the code, please create an issue, and we will try to attend to it promptly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmphowardlab%2Fhipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmphowardlab%2Fhipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmphowardlab%2Fhipper/lists"}