warp.can_access#
- warp.can_access(device, resource)[source]#
Return whether
devicecan directly accessresource.In this release,
resourcemust be a concrete Warp array. The query is allocation-aware for built-in Warp allocators and returnsFalsefor cross-device allocations whose access rules cannot be verified.- Parameters:
device (Device | str | None) – The device that needs to access
resource.resource – The resource to query. Concrete Warp array instances such as
warp.arrayandwarp.indexedarrayare currently supported.
- Returns:
Trueif Warp can verify thatdevicecan directly accessresource, otherwiseFalse.- Raises:
TypeError – If
resourceis not a concrete Warp array.- Return type: