Skip to content

Instantly share code, notes, and snippets.

View mkolod's full-sized avatar

Marek Kolodziej mkolod

  • San Francisco Bay Area, CA
View GitHub Profile
@mkolod
mkolod / dlopen_driver.cpp
Created December 17, 2019 17:31
Preloading shared lib (CUDA driver) before main runs
#include <iostream>
#include <iomanip>
#include <dlfcn.h>
using std::cout;
using std::cerr;
using std::endl;
void* h = []() {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
template <typename T>
struct CSR {
CSR(const std::vector<T>& A, const std::vector<int>& IA, const std::vector<int>& JA) :
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
struct SparseVec {
std::vector<int> values;
std::vector<int> indices;
};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
#include <queue>
#include <tuple>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <type_traits>
#include <limits>
using std::pair;
@mkolod
mkolod / Makefile
Last active September 27, 2019 21:54
all:
g++ -O3 -std=c++14 -fopenmp gemm_practice.cpp -o gemm_practice
clean:
rm conv_gemm_cpu
#include <iostream>
#include <set>
#include <stdexcept>
#include <unordered_set>
template <typename T>
void print_set(const std::set<T>& set) {
std::cout << "[ ";
for (auto& t : set) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.