Device CacheLine Size Extension

Device CacheLine Size Extension#

API#

Device CacheLine Size#

Accelerator devices have a cache line size which is the size of the smallest unit of memory that can be read or written to memory. The ze_device_cache_line_size_ext_t struct returned via zeDeviceGetCacheProperties contains the cache line size of the device.

...
 ze_device_cache_properties_t devCacheProps;
 ze_device_cache_line_size_ext_t devCacheLineSize;
 devProps.stype = ZE_STRUCTURE_TYPE_DEVICE_CACHE_PROPERTIES;
 devProps.pNext = &devCacheLineSize;
 devCacheLineSize.stype = ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT;
 devCacheLineSize.pNext = nullptr;
 uint32_t count = 1;
 // Get the Device Cache Properties and the Device CacheLine Size Properties
 ze_result_t result = zeDeviceGetCacheProperties(dev, &count, &devProps);
 auto device_cache_line_size = devCacheLineSize.cacheLineSize;