Skip to content

Instantly share code, notes, and snippets.

View jrk's full-sized avatar

Jonathan Ragan-Kelley jrk

View GitHub Profile
#include <Halide.h>
#include <stdio.h>
#include <sys/time.h>
#include <Halide.h>
using namespace Halide;
int main(int argc, char **argv) {
ImageParam in_img(UInt(16), 2);
This file has been truncated, but you can view the full file.
# 1 "src/CodeGen_ARM.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 166 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "src/CodeGen_ARM.cpp" 2
# 1 "src/CodeGen_ARM.h" 1
// compiled with clang++ "/run/shm/halideVwHhPM.cpp" -o "/run/shm/halideVwHhPM.bin" -I "/home/jansel/Halide/include" "/home/jansel/Halide/bin/libHalide.a" -ldl -lpthread -DAUTOTUNE_N="1024, 1024" -DAUTOTUNE_TRIALS=3
#include <Halide.h>
#include <stdio.h>
#include <sys/time.h>
#ifndef AUTOTUNE_N
#define AUTOTUNE_N 1000, 1000
#endif
@jrk
jrk / CImg.h
Last active December 16, 2015 22:19
forresti convolution test
This file has been truncated, but you can view the full file.
/*
#
# File : CImg.h
# ( C++ header file )
#
# Description : The C++ Template Image Processing Toolkit.
# This file is the main component of the CImg Library project.
# ( http://cimg.sourceforge.net )
#
# Project manager : David Tschumperle.
@jrk
jrk / bash_profile
Last active December 15, 2015 10:48
Halide tutorial
# TODO: set this to the path to Halide/cpp on your machine:
export HL_ROOT=${HOME}/path/to/Halide/cpp
export PATH=${HL_ROOT}/bin:${PATH}
export LD_LIBRARY_PATH=${HL_ROOT}/bin:${LD_LIBRARY_PATH}
export DYLD_LIBRARY_PATH=${HL_ROOT}/bin:${DYLD_LIBRARY_PATH}
export CFLAGS="-I${HL_ROOT}/include $(llvm-config --cflags) ${CFLAGS}"
export LDFLAGS="-L${HL_ROOT}/bin -lHalide -lpthread -ldl -L$(llvm-config --libdir) $(llvm-config --libs bitwriter bitreader x86 arm linker nvptx ipo mcjit jit) ${LDFLAGS}"
# Based on @berenm's pull request https://github.com/quarnster/SublimeClang/pull/135
# Create the database with cmake with for example: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
# or you could have set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in your CMakeLists.txt
# Usage within SublimeClang:
# "sublimeclang_options_script": "python ${home}/code/cmake_options_script.py ${project_path:build}/compile_commands.json",
import re
import os
import os.path
@jrk
jrk / gist:3949931
Created October 25, 2012 01:17
Valid chunk choices
f(v0, v1) = v0*v1
g(v2, v3, v4) = f(v2, v3)
h(v5, v6) = g(v5, v6, 0) + g(v5, v6, 1)
h.root() // h is output, so this is implicit
// this means:
[allocate h]
for all v6:
for all v5:
h[v5,v6] = g(v5,v6,0) + g(v5,v6,1)
@jrk
jrk / test_atomics.ml
Created October 24, 2012 20:01
Test for LLVM atomics from OCaml through C
open Llvm
open Llvm_bitwriter
let _ =
let c = global_context () in
let m = create_module c "mod" in
let b = builder c in
let i32_t = i32_type c in
let ptr_t = pointer_type i32_t in
TEMPLATE = lib
CONFIG += qt thread debug_and_release staticlib
DESTDIR = "../lib"
CONFIG( debug, debug|release ) {
TARGET = libcgt_cored
} else {
TARGET = libcgt_core
DEFINES += _SECURE_SCL=0
%% Example usage:
%% \squishlist %% \begin{itemize}
%% \item First item
%% \item Second item
%% \squishend %% \end{itemize}
\newcommand{\squishlist}{
\begin{list}
{$\bullet$} { \setlength{
\itemsep}{0pt} \setlength{\parsep}{3pt} \setlength{\topsep}{3pt} \setlength{
\partopsep}{0pt} \setlength{\leftmargin}{1.5em} \setlength{\labelwidth}{1em} \setlength{\labelsep}{0.5em} } }