Skip to content

Instantly share code, notes, and snippets.

function git_portion {
git status > /dev/null 2> /dev/null
if [[ $? -eq 0 ]]
then
current_branch=$(git rev-parse --abbrev-ref HEAD)
modified='\e[92m'
git diff --exit-code 2>/dev/null >/dev/null
if [[ $? -ne 0 ]]
then
modified='\e[97m*\e[93m'
@nathanjackson
nathanjackson / stats.cu
Created April 10, 2015 23:08
Incomplete CUDA Statistics Kernel
#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
static const size_t MAX_BLOCK_SIZE = 1024;
double cpu_var(double *input, size_t len)
{
@nathanjackson
nathanjackson / device_query.c
Last active March 8, 2025 22:32
OpenCL Device Query
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
int main() {