Skip to content

Instantly share code, notes, and snippets.

@JosephLaurino
JosephLaurino / .gitignore
Created June 7, 2016 09:01 — forked from adamgit/.gitignore
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@JosephLaurino
JosephLaurino / client_transmit_input.cpp
Last active December 25, 2015 11:49
simple ZeroMQ sample, CLIENT sends char input from console to SERVER, while SERVER transmits any new char input to all subscribed CLIENT(s) this sample uses c++11 for portable std::thread
////////////////////////////////////////////////////////////////////
// client_transmit_input.cpp FILE
////////////////////////////////////////////////////////////////////
#include "client_transmit_input.h"
// -------------------------------------------------------------------
void ClientRequest_SendCharHandler(zmq::context_t* context, std::string threadName)
{
zmq::socket_t socket (*context, ZMQ_REQ);
@JosephLaurino
JosephLaurino / cpu_ppl_amp_test.cpp
Last active December 12, 2015 06:29
Profiling experiment between CPU(non-threaded), PPL, AMP based implementations. The cost of moving data to the GPU can only be recouped if the computation time is much larger than the data transfer time. With the experiment, the GPU (via AMP) only started winning when the loop count increased passed 200 iterations. Profile first! PPL might have …
// ----------------------------------------------------------------------------
#include <ppl.h>
#include <amp.h>
#include <amp_math.h>
#include <iostream>
#include <boost/chrono/chrono.hpp>
#include <vector>
using namespace concurrency;
using namespace concurrency::precise_math;
@JosephLaurino
JosephLaurino / gist:3847254
Created October 7, 2012 05:54
enumerate all available opencl devices
/*
I modified some code I found to correctly enumerate all OpenCL devices on my laptop...
Here's the output:
NAME: Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
ADDRESS_WIDTH: 32
EXTENSIONS: cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions cl_APPLE_clut cl_APPLE_query_kernel_names cl_APPLE_gl_sharing cl_khr_gl_event cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_APPLE_fp64_basic_ops cl_APPLE_fixed_alpha_channel_orders cl_APPLE_biased_fixed_point_image_formats
@JosephLaurino
JosephLaurino / main.cpp
Created March 3, 2012 02:23
C++11 with Visual Studio 11 Beta
//
// testing out Visual Studio 11 Beta's support of
// the latest C++11 standard
//
// code snippets from
// http://en.wikipedia.org/wiki/C%2B%2B11
// http://solarianprogrammer.com
//
#include "stdafx.h"
@JosephLaurino
JosephLaurino / OBJ.cs
Created December 5, 2011 19:47
obj file loader for Unity3D
// this code is from http://www.everyday3d.com/blog/index.php/2010/05/24/loading-3d-models-runtime-unity3d/
// which was released under the MIT license
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
public class OBJ : MonoBehaviour {