Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am peterwittek on github.
  • I am peterwittek (https://keybase.io/peterwittek) on keybase.
  • I have a public key ASCXm1QcaH67k3Bw6aiCNdZTJOS6Q5YAqTs3e4Ty8r8aTgo

To claim this, I am signing this object:

@peterwittek
peterwittek / cheat_sheet.md
Last active July 15, 2021 13:15
Cheat sheet for QIT01

Hardware

  • CPU: Intel Xeon E5-1650 v4, 6 physical cores @ 3.60-4.00GHz
  • RAM: 128GByte
  • GPU: Tesla K40, 2880 physical cores @ 745-875MHz,
  • GRAM: 12GByte

Logging in

@peterwittek
peterwittek / test_conditional_speed.cpp
Created December 2, 2015 11:23
Testing the speed of a conditional that depends on a parameter, a templated parameter, a class variable, or an element of a class heap
#include <iostream>
#include <climits>
#include <cmath>
#include <ctime>
#define PI 3.14159265
#define REPETITIONS 2000000000
using namespace std;
double speed_test_nontemplated0() {
@peterwittek
peterwittek / stencil_tiled_range.cu
Created August 22, 2013 05:45
Summing the entries of a matrix using a stencil with Thrust
#undef _GLIBCXX_ATOMIC_BUILTINS
#undef _GLIBCXX_USE_INT128
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/permutation_iterator.h>
#include <thrust/functional.h>
#include <thrust/inner_product.h>
#include <thrust/fill.h>
@peterwittek
peterwittek / argmin_row_space.cu
Created August 22, 2013 05:42
Argmin on the rows of a matrix with Thrust
#undef _GLIBCXX_ATOMIC_BUILTINS
#undef _GLIBCXX_USE_INT128
#include <thrust/device_vector.h>
#include <thrust/reduce.h>
#include <thrust/functional.h>
#include <thrust/random.h>
#include <iostream>
// C-style indexing
@peterwittek
peterwittek / matrix_product_c_view.cu
Created August 22, 2013 05:37
CuBlas matrix multiplication with C-style arrays
#undef _GLIBCXX_ATOMIC_BUILTINS
#undef _GLIBCXX_USE_INT128
#include <thrust/device_vector.h>
#include <cublas_v2.h>
#include <iostream>
// C-style indexing
int ci(int row, int column, int nColumns) {
return row*nColumns+column;