Skip to content

Instantly share code, notes, and snippets.

@vmx
vmx / kernel.cu
Created August 25, 2021 20:18
Multiexp and FFT OpenCL/CUDA kernel
// Defines to make the code work with both, CUDA and OpenCL
//#ifdef __NVCC__
#ifdef __CUDACC__
#define DEVICE __device__
#define GLOBAL
#define KERNEL extern "C" __global__
#define LOCAL __shared__
#define GET_GLOBAL_ID() blockIdx.x * blockDim.x + threadIdx.x
#define GET_GROUP_ID() blockIdx.x
@hellwolf
hellwolf / truffle-minimize.sh
Created February 19, 2019 14:39
Truffle minimize json artifacts
#!/usr/bin/env bash
# Notes:
# - Shchema: https://github.com/trufflesuite/truffle/tree/develop/packages/truffle-contract-schema
# - bytecode vs deployedBytecode: https://ethereum.stackexchange.com/questions/32234/difference-between-bytecode-and-runtime-bytecode
for i in "$1"/*.json;do
[ -z "${i%%*.min.json}" ] && continue # already minified
m=${i%%.json}.min.json
echo "Minimizing truffle json artifact: $i"
echo "Original size: $(wc -c "$i")"