Skip to content

Instantly share code, notes, and snippets.

View dadeba's full-sized avatar

N.Nakasato dadeba

  • University of Aizu
  • Japan
View GitHub Profile
@dadeba
dadeba / HKeys.hpp
Created March 30, 2012 08:50
Convert the Morton key to the Hilbert key in 3-D
// A B C D E F G H I J K M
// 0 1 2 3 4 5 6 7 8 9 10 11
struct HKeys {
static const uint64 T0[12][8];
static const uint64 T1[12][8];
uint64 poi(uint64 key, uint64 level)
{
return (key >> 3*level)&0x7ULL;
}
.file "/tmp/76fcbc6b-121e-49d2-8e48-1bf1268bc978.TMP"
.text
.globl grav3
.align 16, 0x90
.type grav3,@function
grav3: # @grav3
.Ltmp3:
.cfi_startproc
# BB#0: # %entry
pushq %rbp
.file "/tmp/7e04f41d-6a01-45b6-b3ce-d4c2404bd6dd.TMP"
.text
.globl _Z12native_rsqrtDv8_f
.align 16, 0x90
.type _Z12native_rsqrtDv8_f,@function
_Z12native_rsqrtDv8_f: # @_Z12native_rsqrtDv8_f
# BB#0:
vrsqrtps YMM0, YMM0
ret
.Ltmp0:
@dadeba
dadeba / gist:a3fa8d35cf8bf1aaa01b
Created July 18, 2014 09:55
CLInfo log for Beignet 0.9.2
iris[~] CLInfo [18:54]
Number of platforms: 1
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 1.2 beignet 0.9.2
Platform Name: Intel Gen OCL Driver
Platform Vendor: Intel
Platform Extensions: 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_icd
Platform Name: Intel Gen OCL Driver
@dadeba
dadeba / error
Created July 18, 2014 11:57
errors in dmesg when running a benchmark on Beignet 0.9.2
[13369.005426] [drm] stuck on render ring
[13369.005430] [drm] GPU crash dump saved to /sys/class/drm/card0/error
[13369.005431] [drm] GPU hangs can indicate a bug anywhere in the entire gfx stack, including userspace.
[13369.005431] [drm] Please file a _new_ bug report on bugs.freedesktop.org against DRI -> DRM/Intel
[13369.005432] [drm] drm/i915 developers can then reassign to the right component if it's not a kernel issue.
[13369.005433] [drm] The gpu crash dump is required to analyze gpu hangs, so please always attach it.
[13369.007876] [drm:i915_set_reset_status] *ERROR* render ring hung inside bo (0x13561000 ctx 1) at 0x13561100
[13377.990180] [drm] stuck on render ring
[13377.990235] [drm:i915_set_reset_status] *ERROR* render ring hung inside bo (0x13581000 ctx 1) at 0x13581100
[13377.990237] [drm:i915_context_is_banned] *ERROR* context hanging too fast, declaring banned!
__kernel void templateKernel(
__global uint8* xx,
__global uint8* yy,
__global uint8* zz,
__global uint8* ww,
__global uint8* res,
const int n_loop
)
{
uint tid = get_global_id(0);
@dadeba
dadeba / wav.jl
Last active August 29, 2015 14:07
const hz = 44100 :: Int64
function save_wav_file(fn::String, wav_array::Vector)
len = length(wav_array)
pcm = uint16(1);
channel = uint16(1);
bit_s = uint16(16);
byte_s = uint16(bit_s/8 * channel);
samp_ps = uint32(hz);
#!/bin/bash
disable_proxy()
{
sudo networksetup -setsocksfirewallproxystate Wi-Fi off
echo "SOCKS proxy disabled."
}
trap disable_proxy INT
sudo networksetup -setsocksfirewallproxy Wi-Fi localhost 8888
sudo networksetup -setsocksfirewallproxystate Wi-Fi on
__kernel void templateKernel(__global unsigned int * output,
__global unsigned int * input,
const unsigned int multiplier)
{
uint tid = get_global_id(0);
output[tid] = input[tid] * multiplier;
}
#define READONLY_P const * restrict
__kernel
void
grav1(
__global float4 READONLY_P x,
__global float4 READONLY_P y,
__global float4 READONLY_P z,
__global float4 READONLY_P m,
__global float4 *ax,
__global float4 *ay,