Skip to content

Instantly share code, notes, and snippets.

@papercompute
papercompute / assertion.go
Created September 20, 2015 14:41
golang assertion
// v2ray-core/testing/unit/assertions.go
package unit
import (
"testing"
)
// Assertion is an assertion library inspired by Truth.
// See http://google.github.io/truth/
type Assertion struct {
@papercompute
papercompute / gist:082c8406c4e624af4006
Created May 13, 2015 15:11
OpenCL Host level synchronization
for(int i=0;i<numIter-1;i++){ // numIter = 1000
status = clEnqueueNDRangeKernel(commandQueue,kernel1,2,NULL,globalThreads,localThreads,0,NULL,NULL);
ASSERT_CL(status);
status = clEnqueueNDRangeKernel(commandQueue,kernel2,2,NULL,globalThreads,localThreads,0,NULL,NULL);
ASSERT_CL(status);
if(i>0 && i%256==0){ // just
status = clFlush(commandQueue);
ASSERT_CL(status);
} // if
} // for i
@papercompute
papercompute / hadoopMakefile
Created July 30, 2014 11:58
hadoop Makefile
TARGET_JAR = SumCount
TARGET_CLASS = $(TARGET_JAR)
INPUT = input.txt
OUTPUT = output
all:$(TARGET_JAR)
$(TARGET_JAR):