Skip to content

Instantly share code, notes, and snippets.

View cdsousa's full-sized avatar

Cristóvão Duarte Sousa cdsousa

View GitHub Profile
@staticfloat
staticfloat / debugging.md
Last active February 24, 2017 03:11
Julia Debugging Procedures

Julia Debugging Procedures

So you managed to break Julia. Congratulations! Collected here are some general procedures you can undergo for common symptoms encountered when something goes awry. Including the information from these debugging steps can greatly help the maintainers when tracking down a segfault or trying to figure out why your script is running slower than expected.

If you've been directed to this page, find the symptom that best matches what you're experiencing and follow the instructions to generate the debugging information requested. Table of symptoms:

@barche
barche / add_cuda.jl
Last active November 30, 2017 06:46
Julia implementation of https://devblogs.nvidia.com/parallelforall/unified-memory-cuda-beginners/, first using pointers and then using a custom `UnifiedArray` type.
# Version using only CUDAdrv
using CUDAdrv, CUDAnative
using BenchmarkTools
const N = 1000000
function kernel_init(A, B, numElements)
i = (blockIdx().x-1) * blockDim().x + threadIdx().x
if i <= numElements