Skip to content

Instantly share code, notes, and snippets.

View gicmo's full-sized avatar
💭
🧠

Christian Kellner gicmo

💭
🧠
View GitHub Profile
@gicmo
gicmo / nsec_test.c
Last active December 27, 2015 13:49
Nanosecond resolution timer code for OSX.
//clang -pedantic -std=c99 -Wall -o nsec_test nsec_test.c && ./nsec_test
#include <assert.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <pthread.h>
// see https://developer.apple.com/library/mac/qa/qa1398/_index.html
typedef uint64_t nano_time_t;
@gicmo
gicmo / gist:7355869
Created November 7, 2013 14:52
List of failed clBLAS tests on Intel HD 4000
[ FAILED ] ColumnMajor_SmallRange/GEMM.sgemm/24, where GetParam() = (1, 1, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] ColumnMajor_SmallRange/GEMM.cgemm/24, where GetParam() = (1, 1, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] ColumnMajor_SmallRange/GEMM.cgemm/48, where GetParam() = (1, 2, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] RowMajor_SmallRange/GEMM.sgemm/8, where GetParam() = (0, 0, 1, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
@gicmo
gicmo / shrd_ptr.cc
Last active August 29, 2015 13:56
shared pointer null dereference text
#include <iostream>
#include <memory>
int
main(int argc, char **argv)
{
std::shared_ptr<int> ptr;
try {
@gicmo
gicmo / main.cpp
Created March 4, 2014 17:35
[hack] Test for time information in HDF5's H5O_info_t obtained via H5Oget_info
#include <hdf5.h>
#include <H5Cpp.h>
#include <vector>
#include <ctime>
#include <string>
#include <iostream>
#include <thread>
using namespace H5;
@gicmo
gicmo / keybase.md
Created April 16, 2014 21:40
keybase

Keybase proof

I hereby claim:

  • I am gicmo on github.
  • I am kellner (https://keybase.io/kellner) on keybase.
  • I have a public key whose fingerprint is 68BB E0E2 842C 388B 6B67 14A9 64E8 76E0 0BC9 01FF

To claim this, I am signing this object:

@gicmo
gicmo / gist:4beffa9503f9836e75b4
Created June 12, 2014 08:57
clBLAS, OSX 10.9.3, ./test-short results
Executed with: ./staging/test-short --gtest_filter="-*nrm2*"
[----------] Global test environment tear-down
[==========] 9792 tests from 122 test cases ran. (90050 ms total)
[ PASSED ] 8079 tests.
[ FAILED ] 1713 tests, listed below:
[ FAILED ] TRSM_extratest.ctrsm
[ FAILED ] ColumnMajor_SmallRange/GEMM.dgemm/24, where GetParam() = (1, 1, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] ColumnMajor_SmallRange/GEMM.zgemm/24, where GetParam() = (1, 1, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] ColumnMajor_SmallRange/GEMM.zgemm/48, where GetParam() = (1, 2, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-
@gicmo
gicmo / clinfo
Created June 12, 2014 09:07
OpenCL info output, MacPro (Late 2013), AMD FirePro D300 2048 MB
./clinfo [master|◯]
Found 1 platform(s).
platform[0x7fff0000]: profile: FULL_PROFILE
platform[0x7fff0000]: version: OpenCL 1.2 (Apr 25 2014 22:04:25)
platform[0x7fff0000]: name: Apple
platform[0x7fff0000]: vendor: Apple
platform[0x7fff0000]: extensions: cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions cl_APPLE_clut cl_APPLE_query_kernel_names cl_APPLE_gl_sharing cl_khr_gl_event
platform[0x7fff0000]: Found 3 device(s).
device[0xffffffff]: NAME: Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz
device[0xffffffff]: VENDOR: Intel
@gicmo
gicmo / log
Created June 12, 2014 15:24
clBlas: Failing tests after build opts error fix
[----------] Global test environment tear-down
[==========] 9792 tests from 122 test cases ran. (407823 ms total)
[ PASSED ] 9467 tests.
[ FAILED ] 325 tests, listed below:
[ FAILED ] TRSM_extratest.ctrsm
[ FAILED ] ColumnMajor_SmallRange/GEMM.dgemm/24, where GetParam() = (1, 1, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] ColumnMajor_SmallRange/GEMM.zgemm/24, where GetParam() = (1, 1, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] ColumnMajor_SmallRange/GEMM.zgemm/48, where GetParam() = (1, 2, 0, 63, 63, 63, 48-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00>, 1)
[ FAILED ] RowMajor_SmallRange/GEMM.dgem
@gicmo
gicmo / nrm2_crash.c
Created June 17, 2014 15:24
Sample program to trigger a crash in Accelerate framework on OSX
//clang -Wall -std=c11 -framework Accelerate -o nrm2_crash nrm2_crash.c
#include <Accelerate/Accelerate.h>
int
main(int argc, char **argv)
{
double x[2] = {1, 1};
double y = cblas_dnrm2(2, x, -1);
printf("%lf\n", y);
return 0;
@gicmo
gicmo / clexptest.cpp
Created June 17, 2014 15:27
Sample program to expose a big in exp() on OSX 10.9.3 + FirePro D300
// Copyleft (c) 2014 Christian Kellner
//
// Usage: ./clexptest [cast_to_float] [device_index]
// cast_to_float: cast argument to exp() to float
// device_index: index of the list of devices to use for testing
//
// Compile:
// clang -std=c++11 -Wall -o clexptest -framework OpenCL -lc++ clexptest.cpp
//
// LICENSE: BSD-3 clause