Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View robgrzel's full-sized avatar

Robert Grzelka robgrzel

  • Sweden, Gotheborg
View GitHub Profile
@robgrzel
robgrzel / External_GTest.cmake
Created August 1, 2017 18:04 — forked from ClintLiddick/External_GTest.cmake
CMake ExternalProject_Add for Google Mock (gmock) and Google Test (gtest) Libraries
find_package(Threads REQUIRED)
ExternalProject_Add(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
UPDATE_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON)
@robgrzel
robgrzel / The Technical Interview Cheat Sheet.md
Created December 18, 2017 20:33 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@robgrzel
robgrzel / debian-install-zram.sh
Created July 7, 2018 11:40
Install zRAM on Debian(8)
#!/bin/bash
#
not_root() {
echo "ERROR: You have to be root to execute this script"
exit 1
}
zram_exists() {
echo "ERROR: /etc/init.d/zram already exists"
@robgrzel
robgrzel / conv.cu
Created July 19, 2018 18:27 — forked from goldsborough/conv.cu
Convolution with cuDNN
#include <cudnn.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <opencv2/opencv.hpp>
#define checkCUDNN(expression) \
{ \
cudnnStatus_t status = (expression); \
if (status != CUDNN_STATUS_SUCCESS) { \
@robgrzel
robgrzel / gist:d1e79721a898f721bcd279d107663c8b
Created July 22, 2018 16:31 — forked from AndrewScheidecker/gist:930f4a6e0966b8421806
A stupid C++ trick for defining structs with metadata (serializers, printers, etc) without redundant declarations of members
#include <iostream>
#include <vector>
#include <string>
using std::string;
/*
These macros define a struct with an implicitly defined Show function that visits each member.
The trick is that a typedef is split between each STRUCT_MEMBER instance and the preceding macro,
which allows it to define an empty struct type that identifies the following struct member, while also
knowing the struct type that the preceding macro is using to identify the current member.
@robgrzel
robgrzel / cudnn_convolution_forward.cu
Created July 23, 2018 10:58 — forked from odashi/cudnn_convolution_forward.cu
Example usage of cuDNN convolution forward functions.
#include <iomanip>
#include <iostream>
#include <cstdlib>
#include <vector>
#include <cuda.h>
#include <cudnn.h>
#define CUDA_CALL(f) { \
cudaError_t err = (f); \
//
// onehiddenlayerperceptron.cu
// onehiddenlayerperceptron
//
// Created by Sergei Bugrov on 8/21/17.
// Copyright © 2017 Sergei Bugrov. All rights reserved.
//
#include <stdio.h>
@robgrzel
robgrzel / main.cpp
Created August 1, 2018 19:51 — forked from eulersson/main.cpp
Thrust + CUDA kernel
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <thrust/device_vector.h>
/*
* --- Using Thrust vectors in kernel functions ---
* This example demonstrates how we can use device vectors (vectors that live
* in GPU) as arguments to a kernel launched by the CPU.
@robgrzel
robgrzel / condaenv.txt
Created November 13, 2018 00:05 — forked from pratos/condaenv.txt
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder