Skip to content

Instantly share code, notes, and snippets.

View ptheywood's full-sized avatar

Peter Heywood ptheywood

View GitHub Profile
find ./examples -type f -name "*.vcxproj" -exec sed -i 's/ToolsVersion="12.0"/ToolsVersion="14.0"/g' {} +
find ./examples -type f -name "*.vcxproj" -exec sed -i 's/<PlatformToolset>v120<\/PlatformToolset>/<PlatformToolset>v140<\/PlatformToolset>/g' {} +
find ./examples -type f -name "*.vcxproj" -exec sed -i 's/CUDA 7.0./CUDA 8.0./g' {} +
find ./examples -type f -name "*.vcxproj" -exec sed -i 's/compute_20,sm_20;compute_30,sm_30;compute_35,sm_35;compute_50,sm_50/compute_30,sm_30;compute_35,sm_35;compute_50,sm_50;compute_60,sm_60/g' {} +
find ./examples -type f -name "Makefile" -exec sed -i 's/cuda-7.5/cuda-8.0/g' {} +
find ./examples -type f -name "Makefile" -exec sed -i 's/20 30 35 37 50 52/30 35 37 50 60/g' {} +
@ptheywood
ptheywood / functions.cu
Created April 21, 2017 12:24
FLAME GPU Device output. Place in an init function for now.
void outputDeviceInfo(){
cudaError_t err;
int deviceId;
err = cudaGetDevice(&deviceId);
if (err == cudaSuccess){
struct cudaDeviceProp prop;
err = cudaGetDeviceProperties(&prop, deviceId);
if (err == cudaSuccess){
printf("Device %i: %s, sm %i.%i\n", deviceId, prop.name, prop.major, prop.minor);
}
@ptheywood
ptheywood / gs-windows.md
Last active March 14, 2025 02:43
Instructions for PDF compression via Ghostscript on Windows

Ghostscript PDF compression on Windows

Installation

  1. Download and install Ghostscript for windows (http://downloads.ghostscript.com/public/gs916w32.exe)
  2. Optional - Add the ghostscript directory to the path environment variable
    • Control Panel > System > Advanced System Settings > Environment Variables
    • Add ;C:\Program Files (x86)\gs\gs9.16\bin to th end of the PATH variable

Usage

@ptheywood
ptheywood / cuda-win.sublime-build
Created October 20, 2014 13:45
Sublime text build script for c++ cuda, modified to be windows friendly
{
"cmd": [
"nvcc",
"-arch=sm_20",
"$file",
"-o",
"${file_path}/${file_base_name}"
],
"file_regex": "^(..[^:]):([0-9]+):?([0-9]+)?:? (.)$",
"working_dir": "${file_path}",