parallel-computing-cuda

所属分类:超算/并行计算
开发工具:Shell
文件大小:0KB
下载次数:0
上传日期:2023-08-11 18:56:12
上 传 者sh-1993
说明:  终端中应用具有CUDA体系结构的并行编程模型的程序,
(Programs in terminal applying the parallel programming model with the CUDA arquitecture,)

文件列表:
Dockerfile (212, 2023-08-30)
cuda_device.cpp (1666, 2023-08-30)
cuda_device.h (340, 2023-08-30)
device_found.png (48372, 2023-08-30)
docker-compose.yml (282, 2023-08-30)
makefile (1544, 2023-08-30)
script.sh (2657, 2023-08-30)
show_devices.cu (813, 2023-08-30)
src/ (0, 2023-08-30)
src/common.cpp (1064, 2023-08-30)
src/common.h (1370, 2023-08-30)
src/displacer_matrix.cu (2962, 2023-08-30)
src/host.cu (633, 2023-08-30)
src/host.h (169, 2023-08-30)
src/kernels.cu (3147, 2023-08-30)
src/kernels.h (2065, 2023-08-30)
src/matrix2dim.cu (1801, 2023-08-30)
src/performance.cu (5326, 2023-08-30)
src/pi.cu (1968, 2023-08-30)
src/rank_sort_algorithm.cu (3048, 2023-08-30)
src/sum_vectors.cu (2484, 2023-08-30)

# Parallel Computing in CUDA Terminal programs applying the parallel programming model with the CUDA arquitecture ## List of terminal programs | Program file | Description | | --- | --- | |**show_devices**| show list of available cuda devices in the system. |**sum_vectors**| add two vectors. ||*cuda target*: launch a kernel with multiple threads grouped into fix blocks. |**matrix2dim**| generate a matrix using a existing matrix. ||*cuda target*: using threads of one kernel lauching two dimensions. |**pi**| roughly calculate the value of pi. ||*cuda target*: making kernel threads work cooperatively using PR algorithm. |**displacer_matrix**| displacer a matrix ||*cuda target*: measure the execution time of a kernel. |**rank_sort_algorithm**| sort a vector using the rank sort algorithm. ||*cuda target*: take advantage of parallelism of the GPU to optimize algorithms. |**performance**| sort a vector in gpu/cpu to compare the performance. ||*cuda target*: calculate the performance of the gain of GPU relative to CPU. ``` source path: /root/code ``` # Pre-requisites 1. **docker** 2. **docker-compose** 3. **make** (optional) 4. **gpu** with **cuda** support (optional) ## NOTE GPU with CUDA support is optional, if you don't have a gpu with cuda support, you can use the docker image of cuda to run the programs. The docker image use an emulator (GPGPU-Sim) to emulate NVIDIA GPUs running CUDA and/or OpenCL workloads. to more informatcion, go here: https://github.com/gpgpu-sim/gpgpu-sim_distribution/ ## Support for CUDA Deep Neural Network (cuDNN) or Basic Linear Algebra Subprograms (cuBLAS) libraries. (OPTIONAL) Modify the docker image and add the following steps to execute programs that use these libraries 1. Download cuDNN and cuBLAS libraries from NVIDIA website: https://developer.nvidia.com 2. export the following environment variables ``` $ export CUDNN_PATH=/path/to/cuddn $ export LD_LIBRARY_PATH=$CUDA_INSTALL_PATH/lib64:$CUDA_INSTALL_PATH/lib:$CUDNN_PATH/lib64 ``` # INSTALLING, BUILDING AND RUNNING archcomputing/cuda:0.3 (Docker Image) and cuda (Docker Container) 1. Build/Rebuild image ``` docker-compose build ``` 2. Create and start container ``` docker-compose up -d ``` 3. Enter to the container ``` docker exec -it cuda /bin/bash ``` 4. Now you can compile and run the programs in the container, either manually or using the Makefile # Compiling in NVIDIA CUDA COMPILER (nvcc) ## Manual ``` nvcc --cudart shared -o out program.cu ``` Other commands need to be executed to clean up compiler-generated files and extent file compilation if the program has more than one file ## Makefile There is a Makefile, its execution is optional. Automates the build/compilation, execution, indentation and cleanup process ### Building ``` make target=program_filename_without_extension ``` or ``` make all target=program_filename_without_extension ``` ### Clean ``` make clean target=program_filename_without_extension ``` ### Running ``` make run target=program_filename_without_extension ``` ### Indent ``` make indent target=program_filename_without_extension ``` ### Example when a cuda device is available ![Device Found](https://github.com/andreeo/parallel-computing-cuda/blob/master/./device_found.png) ### License MIT

近期下载者

相关文件


收藏者