public static AcceleratedComputationKernel FromBytecode([NotNull] AccelerationDevice device, [NotNull] IReadableMemory bytecode)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            if (bytecode == null)
            {
                throw new ArgumentNullException(nameof(bytecode));
            }

            var kernel = new AcceleratedComputationKernel(device);

            kernel.Load(bytecode);
            return(kernel);
        }
        public static AcceleratedComputationKernel FromSource([NotNull] AccelerationDevice device, [NotNull] KernelSourceWriter source, CompilerContext context = null)
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            var kernel = new AcceleratedComputationKernel(device);

            context = context ?? new CompilerContext();
            kernel.Compile(source, context);
            return(kernel);
        }