Skip to content

Instantly share code, notes, and snippets.

View Twinklebear's full-sized avatar

Will Usher Twinklebear

View GitHub Profile
@Twinklebear
Twinklebear / CMakeLists.txt
Last active May 30, 2020 14:35
SDL2 + TBB Malloc Proxy Repro
cmake_minimum_required(VERSION 3.5)
project(sdl2_test)
find_package(SDL2 REQUIRED)
find_package(OpenGL REQUIRED)
find_package(TBB REQUIRED)
add_executable(sdl2_test
main.cpp)
#include "render_optix.h"
#include <algorithm>
#include <array>
#include <chrono>
#include <cstring>
#include <iostream>
#include <numeric>
#include <cuda.h>
#include <cuda_gl_interop.h>
#include <cuda_runtime_api.h>
uniform int i = 0;
foreach_unique(b in blockID) {
unmasked {
i = i + 1;
}
}
print("unique blocks: %\n", i);
@Twinklebear
Twinklebear / sample.cpp
Last active June 4, 2018 16:19
linux performance tracking utility
#include <iostream>
#include <thread>
#include <chrono>
#include <sys/times.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
#include <unistd.h>
#include <fstream>
@Twinklebear
Twinklebear / CMakeLists.txt
Last active June 7, 2018 00:57
OSPRay Transparency Test Case Repro
cmake_minimum_required(VERSION 3.5)
project(osp-transparency-bug)
set(CMAKE_CXX_STANDARD 14)
add_definitions(-DNOMINMAX)
find_package(ospray REQUIRED)
include_directories(${OSPRAY_INCLUDE_DIRS})
add_executable(transparency-test transparency-test.cpp)
@Twinklebear
Twinklebear / run_distributed.sh
Created July 13, 2017 02:28
distributed run script for tray_rust
#PBS -l nodes=22:ppn=32,pmem=2GB,walltime=00:10:00
#PBS -N tray_rust
# It's assumed all binaries and files are on a shared filesystem
PROG=./target/release/tray_rust_wopr
WORK_DIR=/home/sci/will/Repos/tray_rust/
DOWNLOADS=/home/sci/will/Downloads/
SCENE=${DOWNLOADS}/material_test_scene.json
OUTPUT=${DOWNLOADS}/plastic.png
KEY=<path to ssh private key>
@Twinklebear
Twinklebear / water07.json
Created July 7, 2017 03:36
Scene for my reproduction rendering of Fig. 1 of Walter et al. 07 paper, scene format is for tray_rust. Grab the images from imgur http://imgur.com/a/zh4C9
{
"film": {
"width": 1024,
"height": 1024,
"samples": 1024,
"frames": 1,
"start_frame": 0,
"end_frame": 0,
"scene_time": 0,
"filter" : {
@Twinklebear
Twinklebear / CMakeLists.txt
Last active July 12, 2018 21:04
Simple example of rendering a generated volume with OSPRay
cmake_minimum_required(VERSION 3.0)
project(OspExample)
# To build provide the path to your osprayConfig.cmake included in the OSPRay
# releases to CMake as "-Dospray_DIR=<..>"
# and the path to the embreeConfig.cmake from the Embree releases similarly
# as "-Dembree_DIR=<..>"
find_package(ospray REQUIRED)
include_directories(${OSPRAY_INCLUDE_DIRS})
@Twinklebear
Twinklebear / IntrinsicsMips.td
Last active August 29, 2015 14:18
Issues hacking bits of AVX into MIPs for a hardware simulator
//===----------------------------------------------------------------------===//
//
// MipsTrax-specific intrinsics.
// This is at the end of the regular IntrinsicsMips.td file, these are the TRaX specific
// intrinsics
//===----------------------------------------------------------------------===//
def int_mips_atominc : Intrinsic<[llvm_i32_ty], [llvm_i32_ty]>;
def int_mips_invsqrt : Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
def int_mips_printfmstr : Intrinsic<[], [llvm_ptrptr_ty]>;
@Twinklebear
Twinklebear / Cargo.lock
Last active August 29, 2015 14:13
Rust LTO related instruction bug with opening files
[root]
name = "bug_repr"
version = "0.0.1"