fix valid() in blockchain-opencl format