|
VTK
9.7.20261126
|
#include <vtkmDataArrayUtilities.h>
Utility functions for working with Viskores device arrays.
This class provides utility functions to check for device adapter availability and to check if a pointer is a device pointer for supported device adapters.
Definition at line 22 of file vtkmDataArrayUtilities.h.
Static Public Member Functions | |
| static bool | IsDeviceAdapterAvailable (int8_t deviceAdapterId) |
| Check if a Viskores device adapter is available to use. | |
| static bool | IsDevicePointer (const void *ptr, int8_t &deviceAdapterId) |
| Get if the pointer is a device pointer and the device adapter id, which can one of the following values: | |
| static bool | IsCudaDevicePointer (const void *ptr) |
| Check if the pointer is a CUDA device pointer. | |
| static bool | IsHipDevicePointer (const void *ptr) |
| Check if the pointer is a HIP device pointer. | |
| static bool | IsLevelZeroDevicePointer (const void *ptr) |
| Check if the pointer is USM device or shared memory known to the SYCL context Viskores runs in, on a Level Zero device. | |
| static bool | GetLevelZeroHandles (void *&driver, void *&device, void *&context) |
| The Level Zero handles behind the SYCL queue Viskores runs on: the ze_driver_handle_t, ze_device_handle_t and ze_context_handle_t. | |
| static const char * | GetDeviceMemorySpaceName () |
| The vtkMemoryDescriptor memory space of the Viskores device that holds device data in this build: "cuda", "hip" or "level_zero". | |
|
static |
Check if a Viskores device adapter is available to use.
|
static |
Get if the pointer is a device pointer and the device adapter id, which can one of the following values:
VISKORES_DEVICE_ADAPTER_SERIAL = 1 VISKORES_DEVICE_ADAPTER_CUDA = 2 VISKORES_DEVICE_ADAPTER_KOKKOS = 5
|
static |
Check if the pointer is a CUDA device pointer.
|
static |
Check if the pointer is a HIP device pointer.
|
static |
Check if the pointer is USM device or shared memory known to the SYCL context Viskores runs in, on a Level Zero device.
This distinguishes device memory from host memory. It does not prove the pointer was allocated in that context: drivers are not required to tell contexts apart, and Intel's does not.
|
static |
The Level Zero handles behind the SYCL queue Viskores runs on: the ze_driver_handle_t, ze_device_handle_t and ze_context_handle_t.
A USM pointer is only meaningful inside the context it was allocated from, and nothing in DLPack or vtkMemoryDescriptor carries a context. So a producer that wants VTK to read its Level Zero memory allocates in this context, obtained here once, rather than sending a context along with every buffer.
Returns false, with all three null, unless Viskores was built on Kokkos with its SYCL backend and that backend is running on Level Zero. The handles belong to the SYCL runtime: do not destroy them.
|
static |
The vtkMemoryDescriptor memory space of the Viskores device that holds device data in this build: "cuda", "hip" or "level_zero".
Returns nullptr when there is none.