This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ============================================================================== | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Loading modules...") | |
using BenchmarkTools | |
using CUDA | |
using DataFrames | |
using CSV | |
using Printf | |
println("done!") | |
const a = 3.1415f0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"id": "202a91a0-8ac9-4d47-a628-85786980cbb2", | |
"metadata": {}, | |
"source": [ | |
"# CPU\n", | |
"\n", | |
"## Single-threaded sparse mat-vec product" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"id": "202a91a0-8ac9-4d47-a628-85786980cbb2", | |
"metadata": {}, | |
"source": [ | |
"# CPU\n", | |
"\n", | |
"## Single-threaded sparse mat-vec product" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is machine-generated - editing it directly is not advised | |
julia_version = "1.7.1" | |
manifest_format = "2.0" | |
[[deps.ArgTools]] | |
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" | |
[[deps.Artifacts]] | |
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CUDA | |
using BenchmarkTools | |
using Statistics | |
using UnicodePlots | |
# bandwidth test | |
abstract type BytesSIPrefixed end | |
struct B <: BytesSIPrefixed | |
value::Int64 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DelimitedFiles | |
using LinearAlgebra | |
using Test | |
function readqcd(fname::AbstractString; verify=true) | |
open(fname, "r") do f | |
header_str = readuntil(f, "END_HEADER\n") | |
header_mat = readdlm(IOBuffer(header_str), '=') | |
header = Dict(strip(header_mat[i, 1]) => header_mat[i, 2] for i in 2:size(header_mat, 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> function vector_dot(B, C) | |
a = zero(eltype(B)) | |
for i in eachindex(B,C) | |
@inbounds a += B[i] * C[i] | |
end | |
return a | |
end | |
vector_dot (generic function with 1 method) | |
julia> function vector_dot_macro(B, C) |
OlderNewer