GPU Computing (Julia)

From HPC Wiki
GPU Tutorial/Julia
Jump to navigation Jump to search

Title: Introduction to GPU Computing
Provider: HPC.NRW

Type: Multi-part video
Topic Area: GPU computing
License: CC-BY-SA

1. Introduction
2. Several Ways to SAXPY: CUDA C/C++
3. Several Ways to SAXPY: OpenMP
4. Several Ways to SAXPY: Julia
5. Several Ways to SAXPY: NUMBA

This video discusses the SAXPY via Julia and CUDA.jl. The CUDA.jl package is the main programming interface for working with NVIDIA CUDA GPUs using Julia. It features a user-friendly array abstraction, a compiler for writing CUDA kernels in Julia, and wrappers for various CUDA libraries.


(Slides as pdf)


1. How do you transfer an array called x_cpu to the GPU memory?

x_gpu = CudaMalloc(x_cpu)
x_gpu = CuArray(x_cpu)
Julia just does that for you.

2. How do you call a kernel function called gpu_kernel?

CUDA.@sync @cuda(threads=nthreads, blocks=nblocks, gpu_kernel())
CUDA.parallelize(@auto) @cuda<<<nthreads, nblocks>>>gpu_kernel()