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
while ! ./_/build.sh 2> _/build.log; do | |
if [[ $(grep "No such file or directory" _/build.log) =~ .*error..(.*)..No.such.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding file" $missing | |
mkdir -p $(dirname _missing/$missing) | |
touch _missing/$missing | |
elif [[ $(grep "was not declared in this scope" _/build.log) =~ .*error..‘([A-Z0-9_]*)’.was.not.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding constant" $missing |
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
/* Generated by Yosys 0.7+528 (git sha1 3f007024, gcc 7.3.0 -fPIC -Os) */ | |
(* top = 1 *) | |
module \7controller.aig (bit_control_0, bit_mode_0, bit_control_16, bit_control_15, bit_control_14, bit_control_13, bit_control_12, bit_control_11, bit_control_10, bit_control_9, bit_control_8, bit_control_7, bit_control_6, bit_control_5, bit_control_4, bit_control_3, bit_control_2, bit_control_1); | |
output bit_control_0; | |
output bit_control_1; | |
output bit_control_10; | |
output bit_control_11; | |
output bit_control_12; | |
output bit_control_13; |
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
def cone2(v1, v2): | |
return Cone(direction=normalize(v1+v2), angle_by_point=v1) | |
def cone3(v1, v2, v3): | |
return Cone(direction=normalize(cross(v2-v1, v3-v1)), angle_by_point=v1) | |
def cone4(v1, v2, v3, v4): | |
c = cone2(v1, v2) | |
if v3 not in c: | |
c = cone2(v1, v3) |
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
extern crate llvm_sys; | |
use std::ffi::CStr; | |
use llvm_sys::core::*; | |
use llvm_sys::bit_reader::*; | |
fn main() { | |
unsafe { | |
let mut llvm_module = std::mem::uninitialized(); | |
let mut buffer = std::mem::uninitialized(); |
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
/* | |
MESA=<path to git clone of git://anongit.freedesktop.org/mesa/mesa> | |
gcc | |
-I$MESA/include/ | |
-I$MESA/src/ | |
-I$MESA/src/mesa | |
-I$MESA/src/mapi | |
-I$MESA/src/gallium/include | |
-lglapi |
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
class Expr: pass | |
class Type: pass | |
class Stmt: pass | |
class RefMut(Type): | |
def __init__(self, lt, ty): | |
self.lt = lt | |
self.ty = ty | |
def __repr__(self): | |
return "&'{} {!r}".format(self.lt, self.ty) |
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
factorial = ( | |
("op", "a", "input"), | |
("loop", | |
("phi", "a", "a", "a2"), | |
("phi", "b", 1, "b2"), | |
("op", "b2", "mul", "a", "b"), | |
("op", "a2", "sub", "a", 1), | |
("op", "loop-condition", "gt", "a", 0), | |
"loop-condition" | |
) |
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
import math | |
# an implementation of | |
# Edge Finding Filtering Algorithm for Discrete Cumulative Resources in O(kn log n) | |
# by Petr Vilı́m | |
# TODO: make this truly O(n log n) by addressing the tree | |
# rebuild in every iteration in compute_update, | |
class Task: |
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
// a sat solver for instances with <= 32 variables | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#define b00000 0 | |
#define b00001 1 | |
#define b00010 2 | |
#define b00011 3 |
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
// clang++ | |
// -x hip | |
// test.cpp | |
// -O3 | |
// --cuda-gpu-arch=gfx1010 | |
// --hip-device-lib=dummy.bc | |
// --hip-device-lib-path=path_to_dummy_bc | |
// -nogpuinc | |
// -fuse-ld=lld | |
// -fgpu-rdc |
OlderNewer