{"id":19744220,"url":"https://github.com/milleniumbug/cudagameoflife","last_synced_at":"2026-06-04T20:31:34.075Z","repository":{"id":92564991,"uuid":"92346144","full_name":"milleniumbug/cudaGameOfLife","owner":"milleniumbug","description":null,"archived":false,"fork":false,"pushed_at":"2017-06-08T02:07:47.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-10T20:42:11.141Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milleniumbug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-05-24T23:47:36.000Z","updated_at":"2017-10-16T16:44:40.000Z","dependencies_parsed_at":"2023-03-22T02:33:03.156Z","dependency_job_id":null,"html_url":"https://github.com/milleniumbug/cudaGameOfLife","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/milleniumbug%2FcudaGameOfLife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milleniumbug%2FcudaGameOfLife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milleniumbug%2FcudaGameOfLife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milleniumbug%2FcudaGameOfLife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milleniumbug","download_url":"https://codeload.github.com/milleniumbug/cudaGameOfLife/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241076771,"owners_count":19905654,"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":[],"created_at":"2024-11-12T01:42:15.294Z","updated_at":"2025-02-27T23:44:35.547Z","avatar_url":"https://github.com/milleniumbug.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"cudaGameOfLife\n==============\n\nExactly what it says on the tin.\n\n\nCurrent inner workings\n----------------------\n\nMy board is split up in square \"blocks\", and each one of them manages memory allocated by CUDA - \"next\" and \"current\" block. Currently, each cell is a `bool` - bit operations would be way better, I think. Each block has a size of 64x64=4096 cells. I provide the following to the kernel:\n - pointer to contiguous \"flattened\" block to \"next\"\n - a pointer to array of 9 \"current\" blocks, which are essentially neighbours\n - an \"out\" bool array of 9, where the information about whether there are alive cells on borders (in other words, information whether I need to materialize new blocks)\n\nThe kernel is launched with something like this:\n\n```\n\tconst int blockDimension = 64;\n\tconst int threadsPerDimension = 16;\n\tconst dim3 threadsPerBlock(threadsPerDimension, threadsPerDimension);\n\tconst dim3 dimensions(blockDimension / threadsPerBlock.x, blockDimension / threadsPerBlock.y);\n\tnextGenerationKernel \u003c\u003c\u003c dimensions, threadsPerBlock \u003e\u003e\u003e (next.getDevice(), cudaSurrounding.getDevice(), borderCheck.getDevice());\n\tauto result = bordersToHost();\n```\n\n`bordersToHost()` runs a `cudaMemcpy` in order to get the border information back to host (AFAIK this is horrible because it's synchronous)\n\nPerformance improvements\n------------------------\n\n2000 generations on 20x20 block board with blocks = 64x64:\n\nd35e8018e87a11d07e7ac159ba7e998439d5c2ff: 275 seconds\n\n2000 generations\nWithout streams: Executed in: 139218618 microseconds (139 seconds)\nWith streams   : Executed in: 92492721 microseconds (92492 milliseconds)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilleniumbug%2Fcudagameoflife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilleniumbug%2Fcudagameoflife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilleniumbug%2Fcudagameoflife/lists"}