Skip to content

Instantly share code, notes, and snippets.

View bilinear.jl
# An implementation for GPU based bilinear upsampling including its gradient
# WARNING: Untested code ahead!
# The code is a translation from the following files:
# https://github.com/pytorch/pytorch/blob/master/caffe2/operators/upsample_op.cu
# https://github.com/pytorch/pytorch/blob/master/caffe2/core/common_gpu.h
# Open issues:
# 1) type stability?
# 2) licensing?
# 3) the array indexing has to be corrected
View nbodies.jl
using CUDAnative
using CuArrays
using StaticArrays
using BenchmarkTools
using Makie
using Test
@inline function lennard_jones(dr, ϵ::T, σ::T) where T
invr2 = inv(sum(abs2, dr) + T(1E-7))
six_term =^ 2 * invr2) ^ 3