RunMat
GitHub

All functions

CategoryLogical: Tests
Auto GPU

RunMat automatically offloads this function to the GPU when it estimates a speedup, without requiring explicit gpuArray inputs.

Learn more about Auto GPU →

isgpuarray — Return true when a value is stored as a gpuArray handle.

tf = isgpuarray(x) returns a logical scalar that is true when x is a gpuArray handle. All other value kinds, including numeric arrays, logical arrays, characters, structs, and objects, return false.

How isgpuarray works

  • gpuArray values return true without gathering device buffers.
  • Numeric, logical, complex, string, character, struct, cell, and object inputs return false.
  • The result is always a logical scalar.

How RunMat runs isgpuarray on the GPU

The builtin only checks whether the value is a gpuArray handle. It never gathers device buffers or inspects the underlying data contents.

GPU memory and residency

RunMat keeps data on the GPU when a provider is active, and isgpuarray lets you verify residency boundaries in MATLAB-style code.

Examples

Checking a gpuArray handle

G = gpuArray(reshape(1:12, [3 4]));
tf = isgpuarray(G)

Expected output:

tf =
     1

Host arrays are not gpuArray values

A = [1 2 3];
tf = isgpuarray(A)

Expected output:

tf =
     0

FAQ

Does isgpuarray gather data back to the host?

No. It inspects value metadata and returns a logical scalar without triggering a device transfer.

What happens if no acceleration provider is registered?

isgpuarray still reports accurately for values that are already gpuArray handles. If a value is not a gpuArray handle, it returns false.

Bit

and · not · or · xor

Rel

eq · ge · gt · isequal · le · lt · ne

Logical

logical

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how isgpuarray works, line by line, in Rust.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code — faster, on any GPU, with no license required.

  • Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
  • Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
  • A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.

Getting started · Benchmarks · Pricing

Try RunMat for free

Write code or describe what you want to compute. The sandbox is free, no account required.