Skip to content

Instantly share code, notes, and snippets.

@kspaff
kspaff / repro.cu
Created June 20, 2020 22:00
CUFFT Segfault
#include <iostream>
#include <cuda.h>
#include <cuComplex.h>
#include "cufftXt.h"
using namespace std;
// Error handling Macros
#include <iostream>
using namespace std;
int main()
{
// Demo for Wayne
// Sum of the row outer products
const int n = 2;
@kspaff
kspaff / index.html
Created August 23, 2012 00:31 — forked from benjchristensen/index.html
Interactive Line Graph (D3)
<html>
<head>
<title>Interactive Line Graph</title>
<script src="http://d3js.org/d3.v2.js"></script>
<!--
using JQuery for element dimensions
This is a small aspect of this example so it can be removed fairly easily if needed.
-->
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="sample_data.js"></script>
@kspaff
kspaff / gist:3311054
Created August 10, 2012 04:22
GPU Direct Example
int access2from1, access1from2;
cudaDeviceCanAccessPeer(&access2from1, 1, 2);
cudaDeviceCanAccessPeer(&access1from2, 2, 1);
bool sameComplex = false;
if (access2from1==1 && access1from2==1) {
sameComplex = true;
}
@kspaff
kspaff / gist:3311048
Created August 10, 2012 04:20
Checking TCC
// Query using the CUDA device properties API
cudaDeviceProp prop1, prop2;
// 1 and 2 here are the numbers of the GPUs
cudaGetDeviceProperties(&prop1, 1);
cudaGetDeviceProperties(&prop2, 2);
bool compatibleDriver = false;
if (prop1.tccDriver==1 and prop2.tccDriver==1) {
compatibleDriver = true;
@kspaff
kspaff / gist:3219572
Created July 31, 2012 19:04
Data Statements for Cap/BW
// NVRAM/DRAM BW/Capacity Estimates
param wordSize = 8
param imgWidth = 114036
param imgSize = imgWidth * imgWidth * wordSize
param pulsesPerSecond = 2809
param samplesPerPulse = 80636
data incomingDataRate[pulsesPerSecond * samplesPerPulse * wordSize] // (1.7GiB)
param orbitLength = 15 // minutes
@kspaff
kspaff / gist:3176529
Created July 25, 2012 14:43
Sinc Interp.
param samplesPerPulse = 80636
param prf = 2809
param sincInterpPoints = 17
// Tiling parameters
param tf = 32
param tfi = floor(tf) //(tile factor is always an integer)
param dsPulsesPerSec = ceil(prf / tfi)
param dsSamplesPerPulse = ceil(samplesPerPulse / tfi)
@kspaff
kspaff / gist:2648724
Created May 9, 2012 20:50
Sample MD in Aspen
//
// md.aspen
// -Spatial Decomposition
// -Velocity-Verlet formulation
// -Short range, Lennard-Jones forces
// -Long range forces via 3D FFT
//
model md {
@kspaff
kspaff / gist:2648600
Created May 9, 2012 20:33
3D FFT in Aspen
// 3D_FFT.aspen
// 3D FFT using Penci\Slab Decomposition
model fft3d {
// Reminder: When combined with a machine model, Aspen will override these parameters
param P = 64 // --> number of processors
param Z = 24 * mega // --> LL $$ Capacity
param L = 128 // --> Cache line size
@kspaff
kspaff / gist:2648560
Created May 9, 2012 20:28
Serial Matrix Multiplication in Aspen
// serial_matmul.aspen
// Simple Matrix-Matrix Multiply
model matmul {
// Matrix size
param n = 1000
// How many times to repeat the mutliplication
param nTimes = 5