{"id":24881102,"url":"https://github.com/grindelfp/cuda-pinned-memory-streams","last_synced_at":"2025-03-27T06:42:50.541Z","repository":{"id":264670384,"uuid":"894028346","full_name":"GrindelfP/cuda-pinned-memory-streams","owner":"GrindelfP","description":"This program compares the execution time of a specific mathematical computation both on CPU and GPU using CUDA Streams and pinned memory.","archived":false,"fork":false,"pushed_at":"2024-12-10T07:55:47.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T11:42:47.972Z","etag":null,"topics":[],"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/GrindelfP.png","metadata":{"files":{"readme":"README.adoc","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":"2024-11-25T16:15:20.000Z","updated_at":"2024-12-10T08:09:58.000Z","dependencies_parsed_at":"2024-11-25T17:41:31.352Z","dependency_job_id":"86f67e85-a402-4274-8ed5-4dcd6877d181","html_url":"https://github.com/GrindelfP/cuda-pinned-memory-streams","commit_stats":null,"previous_names":["grindelfp/cuda-streams-pinned-memory","grindelfp/cuda-pinned-memory-streams"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrindelfP%2Fcuda-pinned-memory-streams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrindelfP%2Fcuda-pinned-memory-streams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrindelfP%2Fcuda-pinned-memory-streams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrindelfP%2Fcuda-pinned-memory-streams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrindelfP","download_url":"https://codeload.github.com/GrindelfP/cuda-pinned-memory-streams/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245798530,"owners_count":20673901,"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":"2025-02-01T11:42:46.859Z","updated_at":"2025-03-27T06:42:50.523Z","avatar_url":"https://github.com/GrindelfP.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Cuda streams and pinned memory excercise =\n\n== Description ==\n\nThis program compares the execution time of a specific mathematical computation both on CPU and GPU using CUDA Streams and pinned memory. The computation involves multiplying elements of two arrays and applying a summation of trigonometric functions over a fixed range.\n\nThe program utilizes pinned memory (`cudaMallocHost`) to accelerate data transfer between host and device, and CUDA Streams to perform asynchronous data transfer and kernel execution. These optimizations significantly improve the performance of GPU computations by overlapping data transfer and processing.\n\nThe arrays `A`, `B`, and `C` contain floating-point values initialized with trigonometric functions. The computation is performed on:\n1. CPU, using a sequential approach.\n2. GPU, using multiple CUDA Streams for parallel processing.\n\nThe program outputs the execution time for CPU and GPU, and calculates the acceleration coefficient achieved by using the GPU.\n\nThis program is developed in C++ using the CUDA runtime library. It is presented here as a source code file `kernel.cu`. The executable file can be generated using a CUDA-compatible development environment, such as Visual Studio or the NVIDIA CUDA toolkit.\n\n== Program structure ==\n\nThe program source code is stored in the file `kernel.cu`, which includes the following functions:\n\n* **main**: Executes the program, initializes data, performs computations on both CPU and GPU, measures execution time and prints results.\n* **kernel**: The CUDA kernel function executed on the GPU for performing element-wise computations and summation.\n* **cpu_compute**: Performs the computation sequentially on the CPU for comparison.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrindelfp%2Fcuda-pinned-memory-streams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrindelfp%2Fcuda-pinned-memory-streams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrindelfp%2Fcuda-pinned-memory-streams/lists"}