Skip to content

Instantly share code, notes, and snippets.

View rrnewton's full-sized avatar

Ryan Newton rrnewton

View GitHub Profile
@rrnewton
rrnewton / bootstrap_ghc_dev.sh
Created August 21, 2013 14:32
Bash script to bootstrap GHC development within an Ubuntu 12.04 virtual machine.
#!/bin/bash
set -e
set -x
sudo apt-get install -y git gcc make autoconf libtool zlib1g-dev libgl1-mesa-dev libglu1-mesa libglu1-mesa-dev freeglut3-dev libncurses-dev libgmp-dev
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/
sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/libgmp.so.3
sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/libgmp.so
@rrnewton
rrnewton / gist:6511352
Created September 10, 2013 15:45
proto services
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: fusiontables_v1_services.proto
package fusiontables;
public final class FusiontablesV1Services {
private FusiontablesV1Services() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
@rrnewton
rrnewton / RunParThenFreeze.hs
Created September 25, 2013 14:53
Attempt to design "runParThenFreeze"
{-# LANGUAGE RankNTypes, DataKinds, KindSignatures, MagicHash, CPP, DefaultSignatures #-}
{-# LANGUAGE TypeFamilies, TypeSynonymInstances, FlexibleInstances #-}
import GHC.Prim (unsafeCoerce#)
#if 0
import Control.LVish
import Data.LVar.IVar as IV
#else
@rrnewton
rrnewton / gist:7619107
Created November 23, 2013 19:50
An idris warm-up. Show this finite function forms a semi-lattice.
data AndState = Bot | TrueBot | BotTrue | TrueTrue | F
total
myjoin : AndState -> AndState -> AndState
myjoin TrueBot BotTrue = TrueTrue
myjoin TrueTrue TrueBot = TrueTrue
myjoin TrueTrue BotTrue = TrueTrue
myjoin Bot x = x
myjoin F _ = F
-- myjoin x y = myjoin y x
@rrnewton
rrnewton / gist:7722109
Created November 30, 2013 17:49
Problems with import rows on fusion tables
This HTTP-conduit request:
Request {
host = "www.googleapis.com"
port = 443
secure = True
clientCertificates = []
requestHeaders = [("Gdata-version","999"),("Authorization","OAuth ya29.1.AADtN_XQl-SEQTTY39WMzrIZE_Vks4cF5bjUJ2FQvv42KPPGtx8GgeEbjMl1RcQ")]
path = "fusiontables/v1/tables/1R4x_Dqa0p5BoLBKX5sENGh4kkbGZhUVli_APIOw/import"
queryString = ""
@rrnewton
rrnewton / v9f_standalone.hs
Last active December 31, 2015 08:19
A standalone reproducer for the v9f problems.
{-# LANGUAGE BangPatterns #-}
module Main where
import Control.Monad (when, forM_)
import qualified Data.Vector as V
import Data.Word
import qualified Data.LVar.IVar as IV
import Control.LVish
import Debug.Trace
tracePrnt :: String -> Par d s ()
@rrnewton
rrnewton / Two threads think they won the winner check
Last active August 29, 2015 13:55
Example trace pertaining to issue #70. Note the two occurences of "past global barrier".
=================================================
*** Iteration 35, executing command: <./AddRemoveSetTests.exe -t i1 +RTS -N4>
=================================================
[*] Default test harness...
[*] Using Just 1 worker threads for testing.
AddRemoveSetTests:
[!] LVish responding to env Var: DEBUG=9
|3| wrkr0 [dbg-lvish] Main worker thread starting.
|3| wrkr3 [dbg-lvish] Auxillary worker #3 starting.
@rrnewton
rrnewton / gist:8726176
Created January 31, 2014 03:28
worker 0 disappears resulting in deadlock
[!] LVish responding to env Var: DEBUG=9
|3| wrkr0 [dbg-lvish] Auxillary worker #0 starting.
|7| !cpu 0 stealing
|7| !cpu 0 going idle...
|3| wrkr2 [dbg-lvish] Auxillary worker #2 starting.
|7| !cpu 2 stealing
|7| !cpu 2 going idle...
|3| wrkr3 [dbg-lvish] Auxillary worker #3 starting.
@rrnewton
rrnewton / test output
Created February 17, 2014 19:42
Having problems using the same test harness for CUDA backend
$ ./dist/dist-sandbox-463d1a75/build/test-accelerate-cuda-backend/test-accelerate-cuda-backend --threads=1
[Note: passing through options to test-framework]: --threads=1
[!] Testing backend: <CUDA-Backend: DeviceProperties {deviceName = "GeForce GT 430", computeCapability = 2.1, totalGlobalMem = 1072889856, totalConstMem = 65536, sharedMemPerBlock = 49152, regsPerBlock = 32768, warpSize = 32, maxThreadsPerBlock = 1024, maxThreadsPerMultiProcessor = 1536, maxBlockSize = (1024,1024,64), maxGridSize = (65535,65535,65535), maxTextureDim1D = 65536, maxTextureDim2D = (65536,65535), maxTextureDim3D = (2048,2048,2048), clockRate = 1400000, multiProcessorCount = 2, memPitch = 2147483647, memBusWidth = 128, memClockRate = 800000, textureAlignment = 512, computeMode = Default, deviceOverlap = True, concurrentKernels = True, eccEnabled = False, asyncEngineCount = 1, cacheMemL2 = 131072, tccDriverEnabled = False, pciInfo = PCI {busID = 1, deviceID = 0, domainID = 0}, kernelExecTimeoutEnabled = True, integrated = False
@rrnewton
rrnewton / 2 way
Last active August 29, 2015 13:56
Fission 2 way vs 4 way, sequential C
#include "stdlib.h"
#include "stdio.h"
#include "stdint.h"
#include "stdbool.h"
#include "math.h"
#define max(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; })
#define min(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
void build_evt144(int64_t inSize, int64_t inStride,
double* tmp_0_1266, double* tmp_0_1267, double* tmp_0_1268,
double v0111, double v0112, double v0113, double* aLt2_057,