code-samples
Source code examples from the Parallel Forall Blog
File Explorer
Download Latest Version (.zip)- c++11_cuda.cu
- cpp11-range
- Makefile
- README.md
- warandpeace.txt
- ArrayfunArticle.m
- drawAntenna.m
- drawMap.m
- drawMultipleSignalMaps.m
- drawSignalMap.m
- multipleSignalMaps.m
- powerCalculationWithGpuArray.m
- powerKernel.m
- README.md
- reportTime.m
- cnnPredict.m
- filterRegions.m
- findPet.m
- getImageLabels.m
- PetDetectionRecognitionScript.m
- README.md
- timer.h
- laplace2d.c
- laplace2d.f90
- Makefile
- Makefile_f90
- laplace2d.c
- laplace2d.f90
- Makefile
- Makefile_f90
- laplace2d.c
- laplace2d.f90
- Makefile
- Makefile_f90
- cub
- LongstaffSchwartzSvd2_vs10.vcxproj
- LongstaffSchwartzSvd2_vs10.vcxproj.filters
- LongstaffSchwartzSvd2_vs10.vcxproj.user
- LongstaffSchwartzSvd2_vs11.vcxproj
- LongstaffSchwartzSvd2_vs11.vcxproj.filters
- LongstaffSchwartzSvd2_vs11.vcxproj.user
- longstaff_schwartz_svd_2.cu
- LongstaffSchwartz_vs10.sln
- LongstaffSchwartz_vs11.sln
- Makefile
- Readme.md
- all_61.html
- all_61.js
- all_62.html
- all_62.js
- all_63.html
- all_63.js
- all_64.html
- all_64.js
- all_65.html
- all_65.js
- all_66.html
- all_66.js
- all_68.html
- all_68.js
- all_69.html
- all_69.js
- all_6a.html
- all_6a.js
- all_6d.html
- all_6d.js
- all_70.html
- all_70.js
- all_72.html
- all_72.js
- all_73.html
- all_73.js
- all_74.html
- all_74.js
- all_75.html
- all_75.js
- close.png
- defines_64.html
- defines_64.js
- defines_65.html
- defines_65.js
- defines_6a.html
- defines_6a.js
- defines_6d.html
- defines_6d.js
- defines_73.html
- defines_73.js
- defines_75.html
- defines_75.js
- files_63.html
- files_63.js
- files_64.html
- files_64.js
- files_68.html
- files_68.js
- files_69.html
- files_69.js
- files_6a.html
- files_6a.js
- functions_61.html
- functions_61.js
- functions_62.html
- functions_62.js
- functions_63.html
- functions_63.js
- functions_65.html
- functions_65.js
- functions_66.html
- functions_66.js
- functions_68.html
- functions_68.js
- functions_69.html
- functions_69.js
- functions_6a.html
- functions_6a.js
- functions_6d.html
- functions_6d.js
- functions_70.html
- functions_70.js
- functions_72.html
- functions_72.js
- functions_73.html
- functions_73.js
- functions_74.html
- functions_74.js
- mag_sel.png
- nomatches.html
- search.css
- search.js
- search_l.png
- search_m.png
- search_r.png
- bc_s.png
- closed.png
- CUDA__Aware__MPI_8c.html
- CUDA__Aware__MPI_8c__incl.map
- CUDA__Aware__MPI_8c__incl.md5
- CUDA__Aware__MPI_8c__incl.png
- CUDA__Normal__MPI_8c.html
- CUDA__Normal__MPI_8c__incl.map
- CUDA__Normal__MPI_8c__incl.md5
- CUDA__Normal__MPI_8c__incl.png
- Device_8cu.html
- Device_8cu__incl.map
- Device_8cu__incl.md5
- Device_8cu__incl.png
- Device_8cu_a08324d1c9b1ee7193242670ba4b97d88_cgraph.map
- Device_8cu_a08324d1c9b1ee7193242670ba4b97d88_cgraph.md5
- Device_8cu_a08324d1c9b1ee7193242670ba4b97d88_cgraph.png
- Device_8cu_a3b641f8b5d521a230416b64d8b809324_cgraph.map
- Device_8cu_a3b641f8b5d521a230416b64d8b809324_cgraph.md5
- Device_8cu_a3b641f8b5d521a230416b64d8b809324_cgraph.png
- Device_8cu_a95a52e3c2e58d2d94403a0dce2e29686_cgraph.map
- Device_8cu_a95a52e3c2e58d2d94403a0dce2e29686_cgraph.md5
- Device_8cu_a95a52e3c2e58d2d94403a0dce2e29686_cgraph.png
- Device_8cu_aeaebe085afbffaa0d6bcd77fa16ceb97_cgraph.map
- Device_8cu_aeaebe085afbffaa0d6bcd77fa16ceb97_cgraph.md5
- Device_8cu_aeaebe085afbffaa0d6bcd77fa16ceb97_cgraph.png
- doxygen.css
- doxygen.png
- files.html
- globals.html
- globals_defs.html
- globals_func.html
- graph_legend.html
- graph_legend.md5
- graph_legend.png
- Host_8c.html
- Host_8c__incl.map
- Host_8c__incl.md5
- Host_8c__incl.png
- Host_8c_a0ea9f99f85b380e912940f351366a862_cgraph.map
- Host_8c_a0ea9f99f85b380e912940f351366a862_cgraph.md5
- Host_8c_a0ea9f99f85b380e912940f351366a862_cgraph.png
- Host_8c_a52ea6f92f186de790a55fdf700026dd9_cgraph.map
- Host_8c_a52ea6f92f186de790a55fdf700026dd9_cgraph.md5
- Host_8c_a52ea6f92f186de790a55fdf700026dd9_cgraph.png
- Host_8c_ac28696e075d2053b4de5662556c16f3d_cgraph.map
- Host_8c_ac28696e075d2053b4de5662556c16f3d_cgraph.md5
- Host_8c_ac28696e075d2053b4de5662556c16f3d_cgraph.png
- Host_8c_aef3118f365ec96030a022fa17b73fc42_cgraph.map
- Host_8c_aef3118f365ec96030a022fa17b73fc42_cgraph.md5
- Host_8c_aef3118f365ec96030a022fa17b73fc42_cgraph.png
- index.html
- Input_8c.html
- Input_8c__incl.map
- Input_8c__incl.md5
- Input_8c__incl.png
- installdox
- Jacobi_8c.html
- Jacobi_8c__incl.map
- Jacobi_8c__incl.md5
- Jacobi_8c__incl.png
- Jacobi_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.map
- Jacobi_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.md5
- Jacobi_8c_a3c04138a5bfe5d72780bb7e82a18e627_cgraph.png
- Jacobi_8h.html
- Jacobi_8h__dep__incl.map
- Jacobi_8h__dep__incl.md5
- Jacobi_8h__dep__incl.png
- Jacobi_8h__incl.map
- Jacobi_8h__incl.md5
- Jacobi_8h__incl.png
- Jacobi_8h_a08324d1c9b1ee7193242670ba4b97d88_cgraph.map
- Jacobi_8h_a08324d1c9b1ee7193242670ba4b97d88_cgraph.md5
- Jacobi_8h_a08324d1c9b1ee7193242670ba4b97d88_cgraph.png
- Jacobi_8h_a0ea9f99f85b380e912940f351366a862_cgraph.map
- Jacobi_8h_a0ea9f99f85b380e912940f351366a862_cgraph.md5
- Jacobi_8h_a0ea9f99f85b380e912940f351366a862_cgraph.png
- Jacobi_8h_a3b641f8b5d521a230416b64d8b809324_cgraph.map
- Jacobi_8h_a3b641f8b5d521a230416b64d8b809324_cgraph.md5
- Jacobi_8h_a3b641f8b5d521a230416b64d8b809324_cgraph.png
- Jacobi_8h_a52ea6f92f186de790a55fdf700026dd9_cgraph.map
- Jacobi_8h_a52ea6f92f186de790a55fdf700026dd9_cgraph.md5
- Jacobi_8h_a52ea6f92f186de790a55fdf700026dd9_cgraph.png
- Jacobi_8h_a95a52e3c2e58d2d94403a0dce2e29686_cgraph.map
- Jacobi_8h_a95a52e3c2e58d2d94403a0dce2e29686_cgraph.md5
- Jacobi_8h_a95a52e3c2e58d2d94403a0dce2e29686_cgraph.png
- Jacobi_8h_aeaebe085afbffaa0d6bcd77fa16ceb97_cgraph.map
- Jacobi_8h_aeaebe085afbffaa0d6bcd77fa16ceb97_cgraph.md5
- Jacobi_8h_aeaebe085afbffaa0d6bcd77fa16ceb97_cgraph.png
- Jacobi_8h_aef3118f365ec96030a022fa17b73fc42_cgraph.map
- Jacobi_8h_aef3118f365ec96030a022fa17b73fc42_cgraph.md5
- Jacobi_8h_aef3118f365ec96030a022fa17b73fc42_cgraph.png
- jquery.js
- nav_f.png
- nav_h.png
- open.png
- tab_a.png
- tab_b.png
- tab_h.png
- tab_s.png
- tabs.css
- CUDA_Aware_MPI.c
- CUDA_Normal_MPI.c
- Device.cu
- Host.c
- Input.c
- Jacobi.c
- Jacobi.doxygen
- Jacobi.h
- Makefile
- README
- cuvector.cpp
- cuvector.h
- Makefile
- sync_main.cu
- vector_main.cpp
- common.h
- cufft_callbacks.cu
- cufft_no_callbacks.cu
- Makefile
- egl.h
- eglext.h
- eglplatform.h
- khrplatform.h
- Makefile
- Readme.txt
- tinyegl.cc
- saxpy.cu
- saxpy.py
- saxpy_nvrtc.py
- app.js
- license.txt
- package.json
- cuml_dbscan.R
- run_r.sh
- README.md
- gups.cu
- LICENSE
- LICENSE.gups.cu
- Makefile
- README.md
- run.py
- cublas-example.cu
- Makefile
- openblas-example.cpp
- README.md
- .gitignore
- fp16_conversion.h
- haxpy.cu
- Makefile
- Makefile
- matrixMul.cu
- nvml_test.cu
- compiler_inst_nvtx.cu
- env_hpc_sdk.sh
- inst_nvtx.cpp
- Makefile
- manual_nvtx.cu
- timer.h
- laplace2d.c
- Makefile
- block_reduce.h
- cub
- device_reduce_atomic.h
- device_reduce_block_atomic.h
- device_reduce_stable.h
- device_reduce_warp_atomic.h
- fake_atomic.h
- fake_shfl.h
- getdata.sh
- main.cu
- Makefile
- readme.md
- warp_reduce.h
- CASerror.h
- CMakeLists.txt
- main.cu
- README.md
- LSTM.cu
- Makefile
- README.md
- main.cpp
- makefile
- particle.cpp
- particle.h
- v3.cpp
- v3.h
- Makefile
- README.md
- simpleTensorCoreGEMM.cu
- convert.ipynb
- test.ipynb
- train.ipynb
- cudaWrapper.h
- ioHelper.cpp
- ioHelper.h
- ioHelper.o
- Makefile
- simpleOnnx.cpp
- simpleOnnx_1.cpp
- simpleOnnx_2.cpp
- .gitignore
- dataElem.cu
- dataElem_um.cu
- dataElem_um_c++_1.cu
- dataElem_um_c++_2.cu
- Makefile
- README.md
- Makefile
- README.md
- uvm_oversubs.cu
- coalescing.cu
- finite-difference.cu
- bandwidthtest.cu
- profile.cu
- async.cu
- shared-memory.cu
- transpose.cu
- async.cuf
- finiteDifference.cuf
- shared.cuf
- transpose.cuf
- .gitignore
- .gitmodules
- license.txt
- README.md
# Installation Guide
git clone https://github.com/NVIDIA-developer-blog/code-samples
Downloads the entire project code from GitHub to your computer.
cd code-samples
Moves into the project folder you just downloaded.
2. CMake
Medium Recommendedcd posts/printf-alternative
This project's files live in a subfolder, so move into it first.
mkdir build && cd build
Creates a folder to hold the build output and moves into it.
cmake ..
Analyzes the source code and generates build configuration files (must be run inside the build folder).
make
Compiles the code based on the generated build configuration to produce an executable.
3. .NET
Mediumcd posts/american-options
This project's files live in a subfolder, so move into it first.
dotnet restore
Downloads the packages the project depends on.
dotnet run
Builds the project and runs it immediately.
4. Node.js
Easycd posts/grcuda/mandelbrot
This project's files live in a subfolder, so move into it first.
npm install
Downloads and installs the libraries listed in package.json.
npm start
Starts the development/run server.
5. Make
Medium- Git Needed to download the project code from GitHub.
- Make Usually pre-installed on Linux/macOS. On Windows, install separately (e.g. via MSYS2 or WSL).
cd c++11_cuda
This project's files live in a subfolder, so move into it first.
make
Compiles the code based on the generated build configuration to produce an executable.
