{"id":23977448,"url":"https://github.com/thecomputekid/premake5-cuda","last_synced_at":"2025-04-14T01:06:14.671Z","repository":{"id":151362176,"uuid":"352043296","full_name":"theComputeKid/premake5-cuda","owner":"theComputeKid","description":"Premake5 module that enables CUDA development in Visual Studio using the native CUDA Toolkit integration.","archived":false,"fork":false,"pushed_at":"2024-09-15T12:09:18.000Z","size":68,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T01:06:02.156Z","etag":null,"topics":["cuda","premake-module","premake5","visual-studio"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/theComputeKid.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":"2021-03-27T10:26:53.000Z","updated_at":"2025-01-20T07:02:57.000Z","dependencies_parsed_at":"2024-09-15T13:43:57.368Z","dependency_job_id":"b3104642-8727-43b4-b2d9-ca3d2ae16bf1","html_url":"https://github.com/theComputeKid/premake5-cuda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theComputeKid%2Fpremake5-cuda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theComputeKid%2Fpremake5-cuda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theComputeKid%2Fpremake5-cuda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theComputeKid%2Fpremake5-cuda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theComputeKid","download_url":"https://codeload.github.com/theComputeKid/premake5-cuda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804803,"owners_count":21164134,"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":["cuda","premake-module","premake5","visual-studio"],"created_at":"2025-01-07T07:37:47.564Z","updated_at":"2025-04-14T01:06:14.637Z","avatar_url":"https://github.com/theComputeKid.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n   \u003cp\u003ea premake5 extension for cuda\u003c/p\u003e\n   \u003ch1\u003e\u003csmall\u003epremake5-\u003c/small\u003e\u003cstrong\u003eCUDA\u003c/strong\u003e\u003c/h1\u003e\n\u003c/div\u003e\n\nCompiles CUDA code using the Visual Studio CUDA Toolkit extension on Windows and `nvcc` on Linux. Enabled macros (listed in `src/cuda-exported-variables.lua`):\n- `cudaFiles` (Table) -\u003e list of files to be compiled by NVCC to binary (relative path from solution root).\n- `cudaPTXFiles` (Table) -\u003e list of files to be compiled by NVCC to PTX (relative path from solution root) - Windows only.\n- `cudaRelocatableCode` (Bool) -\u003e triggers -rdc=true.\n- `cudaExtensibleWholeProgram` (Bool) -\u003e triggers extensible whole program compilation.\n- `cudaCompilerOptions` (Table) -\u003e passed to nvcc.\n- `cudaLinkerOptions` (Table) -\u003e passed to nvlink.\n- `cudaFastMath` (Bool) -\u003e triggers fast math optimizations.\n- `cudaVerbosePTXAS` (Bool) -\u003e triggers code gen verbosity.\n- `cudaMaxRegCount` (String) -\u003e number to determine the max used registers.\n- `cudaKeep` (Bool) -\u003e keeps preprocessed output.\n- `cudaPath` (String) -\u003e custom CUDA install path.\n- `cudaGenLineInfo` (Bool) -\u003e generates line info.\n- `cudaIntDir` (String) -\u003e Intermediary directory for CUDA files - Windows only.\n- `cudaKeepDir` (String) -\u003e Directory to place cudaKeep files (on Linux, requires an existing directory).\n\nThe following functions are provided:\n- `detectNvccVersion()` -\u003e try to detect the default version of nvcc on the system.\n- `detectNvccVersion(cudaPath)` -\u003e try to detect the version of nvcc from a provided path.\n\n----------------\nNotes for Windows:\n----------------\n\nFiles specified by `files` are compiled by `cl` and not `nvcc`.\n\nAn example is provided in the test folder where a CUDA executable project containing C++, PTX and CUDA files is linked against a CUDA shared library project. If you clone this repo recursively (i.e. with `-recursive`), it will also pull the premake5 repo, which can be used via the makefile to build premake and then the tests (e.g. via the `nmake` command). You do not need the premake5 repo unless you want to build the tests.\n\nTo use:\n- Install the CUDA toolkit, along with its Visual Studio integration.\n- Copy the premake5-cuda folder to your project.\n- Include it in your premake5.lua file as shown in the example.\n\nTested with Visual Studio 2022 (toolkit v143) with CUDA toolkit 12.1 VS integration.\n\nNote: If PTX is requested, it will be found in the output object folder, with the .obj extension, though, it can be opened with a text editor for inspection.\n\n----------------\nNotes for Linux:\n----------------\n\nThis extension was primarily made for VS on Windows, with the CUDA toolkit extension. Linux is a work in progress and does not have feature parity with Windows yet. Differences are:\n- toolset must be set as `\"nvcc\"`.\n- rules must be set to `'cu'`.\n- `cudaPTXFiles` and `cudaIntDir` not supported.\n- the list of cuda files must be provided in `files` instead of `cudaFiles`.\n- unlike Windows, the whole project is compiled by `nvcc` and not just the `.cu` files.\n\nSee test premake5 file for how linux config differs. The differences are summarised here:\n\n```\n  if os.target() == \"windows\" then\n    cudaFiles { \"exe/cu/**.cu\" } -- files to be compiled into binaries by VS CUDA.\n    cudaPTXFiles { \"exe/ptx/**.cu\" } -- files to be compiled into ptx, Windows only.\n  else\n    toolset \"nvcc\"\n    files { \"exe/cu/**.cu\" }\n    rules {\"cu\"}\n  end\n```\n\nAdmittedly, Linux support is a bit clunky but it should get the job done.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecomputekid%2Fpremake5-cuda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecomputekid%2Fpremake5-cuda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecomputekid%2Fpremake5-cuda/lists"}