Skip to content

Instantly share code, notes, and snippets.

View carstenbauer's full-sized avatar
🐰
Deep in the rabbit hole

Carsten Bauer carstenbauer

🐰
Deep in the rabbit hole
View GitHub Profile
@carstenbauer
carstenbauer / bench.jl
Created August 9, 2021 18:22
SAXPY benchmark CUDA.jl (broadcasting)
print("Loading modules...")
using BenchmarkTools
using CUDA
using DataFrames
using CSV
using Printf
println("done!")
const a = 3.1415f0
@carstenbauer
carstenbauer / gpu_saxpy_comparison.jl
Last active July 26, 2021 07:59
CUDA broadcasting vs kernel
# ==============================================================================
# Example program for CUDA Julia tutorial
# Written by: Carsten Bauer
# ==============================================================================
using BenchmarkTools
using CUDA
using Printf
function saxpy_gpu_kernel!(z,a,x,y)
i = (blockIdx().x - 1) * blockDim().x + threadIdx().x
(itensors) pkg> add ITensors
Updating registry at `/p/project/chku27/hku273/.julia/registries/General`
┌ Error: curl_easy_setopt: 48
└ @ Downloads.Curl /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Downloads/src/Curl/utils.jl:36
┌ Error: curl_easy_setopt: 48
└ @ Downloads.Curl /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Downloads/src/Curl/utils.jl:36
┌ Error: curl_easy_setopt: 48
└ @ Downloads.Curl /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Downloads/src/Curl/utils.jl:36
Resolving package versions...
┌ Error: curl_easy_setopt: 48
"""
meshgrid(xvec) = meshgrid(xvec, xvec)
Produces a 2D meshgrid `X,X` by repeating xvec in y-dimension and xvec in x-dimension.
"""
meshgrid(v::AbstractVector{T}) where T<:Number = meshgrid(v, v)
"""
meshgrid(xvec, yvec)
Produces a 2D meshgrid `X,Y` by repeating xvec in y-dimension and yvec in x-dimension.
"""