def ldexp(significand, exponent, stream=None): """Return a new array of floating point values composed from the entries of `significand` and `exponent`, paired together as `result = significand * 2**exponent`. """ result = gpuarray.GPUArray(significand.shape, significand.dtype) func = elementwise.get_ldexp_kernel() func.set_block_shape(*significand._block) func.prepared_async_call(significand._grid, stream, significand.gpudata, exponent.gpudata, result.gpudata, significand.mem_size) return result
def ldexp(significand, exponent, stream=None): """Return a new array of floating point values composed from the entries of `significand` and `exponent`, paired together as `result = significand * 2**exponent`. """ if not significand.flags.forc or not exponent.flags.forc: raise RuntimeError("only contiguous arrays may " "be used as arguments to this operation") result = gpuarray.GPUArray(significand.shape, significand.dtype) func = elementwise.get_ldexp_kernel() func.prepared_async_call(significand._grid, significand._block, stream, significand.gpudata, exponent.gpudata, result.gpudata, significand.mem_size) return result