mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Correctly initialize descriptors and property structs in black box tests
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
20ba56f254
commit
753b0d82d5
@ -454,7 +454,7 @@ int main(int argc, char *argv[]) {
|
||||
auto device = devices[0];
|
||||
bool outputValidationSuccessful = false;
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -25,7 +25,7 @@ void testAppendMemoryCopy(ze_context_handle_t &context, ze_device_handle_t &devi
|
||||
ze_command_queue_handle_t cmdQueue = nullptr;
|
||||
ze_command_list_handle_t cmdList = nullptr;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
cmdQueueDesc.flags = 0;
|
||||
cmdQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
|
||||
@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
|
||||
ze_driver_handle_t driverHandle = nullptr;
|
||||
auto devices = zelloInitContextAndGetDevices(context, driverHandle);
|
||||
auto device = devices[0];
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -24,7 +24,7 @@ void testAppendImageCopy(ze_context_handle_t &context, ze_device_handle_t &devic
|
||||
ze_command_queue_handle_t cmdQueue = nullptr;
|
||||
ze_command_list_handle_t cmdList = nullptr;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
cmdQueueDesc.flags = 0;
|
||||
cmdQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
|
||||
@ -114,7 +114,7 @@ int main(int argc, char *argv[]) {
|
||||
auto device = devices[0];
|
||||
bool outputValidationSuccessful;
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -27,7 +27,7 @@ void testCopyBetweenHeapDeviceAndStack(ze_context_handle_t &context, ze_device_h
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
uint32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
|
||||
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
@ -45,7 +45,7 @@ void testCopyBetweenHeapDeviceAndStack(ze_context_handle_t &context, ze_device_h
|
||||
cmdListDesc.commandQueueGroupOrdinal = copyQueueGroup;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDesc, &cmdList));
|
||||
|
||||
ze_device_mem_alloc_desc_t deviceDesc;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
deviceDesc.stype = ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC;
|
||||
deviceDesc.ordinal = 0;
|
||||
deviceDesc.flags = 0;
|
||||
@ -97,7 +97,7 @@ void testCopyBetweenHostMemAndDeviceMem(ze_context_handle_t &context, ze_device_
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
uint32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
|
||||
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
@ -115,13 +115,13 @@ void testCopyBetweenHostMemAndDeviceMem(ze_context_handle_t &context, ze_device_
|
||||
cmdListDesc.commandQueueGroupOrdinal = copyQueueGroup;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDesc, &cmdList));
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc;
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
hostDesc.stype = ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;
|
||||
hostDesc.pNext = nullptr;
|
||||
hostDesc.flags = 0;
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocHost(context, &hostDesc, allocSize, 1, (void **)(&hostBuffer)));
|
||||
|
||||
ze_device_mem_alloc_desc_t deviceDesc;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
deviceDesc.stype = ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC;
|
||||
deviceDesc.ordinal = 0;
|
||||
deviceDesc.flags = 0;
|
||||
@ -165,7 +165,7 @@ void testRegionCopyOf2DSharedMem(ze_context_handle_t &context, ze_device_handle_
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
uint32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
|
||||
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
@ -202,13 +202,13 @@ void testRegionCopyOf2DSharedMem(ze_context_handle_t &context, ze_device_handle_
|
||||
const ze_copy_region_t dstRegion = {dstOriginX, dstOriginY, 0, width, height, 0};
|
||||
const ze_copy_region_t srcRegion = {srcOriginX, srcOriginY, 0, width, height, 0};
|
||||
|
||||
ze_device_mem_alloc_desc_t deviceDesc;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
deviceDesc.stype = ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC;
|
||||
deviceDesc.ordinal = 0;
|
||||
deviceDesc.flags = 0;
|
||||
deviceDesc.pNext = nullptr;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc;
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
hostDesc.stype = ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;
|
||||
hostDesc.pNext = nullptr;
|
||||
hostDesc.flags = 0;
|
||||
@ -292,7 +292,7 @@ void testSharedMemDataAccessWithoutCopy(ze_context_handle_t &context, ze_device_
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
uint32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
|
||||
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
@ -313,13 +313,13 @@ void testSharedMemDataAccessWithoutCopy(ze_context_handle_t &context, ze_device_
|
||||
// Initialize buffers
|
||||
// buffer0 and buffer1 are shared allocations, so they have UVA between host and device
|
||||
// and there's no need to perform explicit copies
|
||||
ze_device_mem_alloc_desc_t deviceDesc;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
deviceDesc.stype = ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC;
|
||||
deviceDesc.ordinal = 0;
|
||||
deviceDesc.flags = 0;
|
||||
deviceDesc.pNext = nullptr;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc;
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
hostDesc.stype = ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;
|
||||
hostDesc.pNext = nullptr;
|
||||
hostDesc.flags = 0;
|
||||
@ -397,7 +397,7 @@ void testRegionCopyOf3DSharedMem(ze_context_handle_t &context, ze_device_handle_
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
uint32_t copyQueueGroup = getCopyOnlyCommandQueueOrdinal(device);
|
||||
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
@ -439,13 +439,13 @@ void testRegionCopyOf3DSharedMem(ze_context_handle_t &context, ze_device_handle_
|
||||
const ze_copy_region_t dstRegion = {dstOriginX, dstOriginY, dstOriginZ, width, height, depth};
|
||||
const ze_copy_region_t srcRegion = {srcOriginX, srcOriginY, dstOriginZ, width, height, depth};
|
||||
|
||||
ze_device_mem_alloc_desc_t deviceDesc;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
deviceDesc.stype = ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC;
|
||||
deviceDesc.ordinal = 0;
|
||||
deviceDesc.flags = 0;
|
||||
deviceDesc.pNext = nullptr;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc;
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
hostDesc.stype = ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC;
|
||||
hostDesc.pNext = nullptr;
|
||||
hostDesc.flags = 0;
|
||||
@ -539,7 +539,7 @@ int main(int argc, char *argv[]) {
|
||||
auto devices = zelloInitContextAndGetDevices(context, driverHandle);
|
||||
auto device = devices[0];
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -32,7 +32,7 @@ void createModule(ze_context_handle_t &context, ze_module_handle_t &module, ze_d
|
||||
}
|
||||
SUCCESS_OR_TERMINATE((0 == spirV.size()));
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = spirV.data();
|
||||
@ -55,7 +55,7 @@ void createKernel(ze_module_handle_t &module, ze_kernel_handle_t &kernel,
|
||||
uint32_t numThreads, uint32_t sizex, uint32_t sizey,
|
||||
uint32_t sizez) {
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "increment_by_one";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
ze_kernel_properties_t kernProps{ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES};
|
||||
@ -104,7 +104,7 @@ bool testFence(ze_context_handle_t &context, ze_device_handle_t &device) {
|
||||
uint32_t groupSizeZ = 1u;
|
||||
|
||||
// Create commandQueue and cmdList
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
cmdQueueDesc.ordinal = getCommandQueueOrdinal(device);
|
||||
cmdQueueDesc.index = 0;
|
||||
cmdQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
|
||||
@ -197,7 +197,7 @@ int main(int argc, char *argv[]) {
|
||||
auto devices = zelloInitContextAndGetDevices(context, driverHandle);
|
||||
auto device = devices[0];
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -68,7 +68,7 @@ void testAppendImageFunction(ze_driver_handle_t driver,
|
||||
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
ze_command_list_desc_t cmdListDesc = {};
|
||||
ze_command_list_desc_t cmdListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC};
|
||||
cmdListDesc.commandQueueGroupOrdinal = cmdQueueOrdinal;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDesc, &cmdList));
|
||||
|
||||
|
@ -55,7 +55,7 @@ void testAppendImageViewCopy(ze_context_handle_t &context, ze_device_handle_t &d
|
||||
ze_command_queue_handle_t cmdQueue = nullptr;
|
||||
ze_command_list_handle_t cmdList = nullptr;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
cmdQueueDesc.pNext = nullptr;
|
||||
cmdQueueDesc.flags = 0;
|
||||
cmdQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
|
||||
@ -181,7 +181,7 @@ void testAppendImageViewCopy(ze_context_handle_t &context, ze_device_handle_t &d
|
||||
ze_module_handle_t module = nullptr;
|
||||
ze_kernel_handle_t kernel = nullptr;
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = spirV.data();
|
||||
@ -200,7 +200,7 @@ void testAppendImageViewCopy(ze_context_handle_t &context, ze_device_handle_t &d
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeModuleBuildLogDestroy(buildlog));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "ReadNV12Kernel";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
|
||||
@ -287,7 +287,7 @@ int main(int argc, char *argv[]) {
|
||||
auto device = devices[0];
|
||||
bool outputValidationSuccessful;
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -86,7 +86,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
ze_driver_handle_t driverHandle;
|
||||
SUCCESS_OR_TERMINATE(zeDriverGet(&driverCount, &driverHandle));
|
||||
|
||||
ze_context_desc_t contextDesc = {};
|
||||
ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeContextCreate(driverHandle, &contextDesc, &context));
|
||||
|
||||
// Retrieve device
|
||||
@ -97,7 +97,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGet(driverHandle, &deviceCount, &device));
|
||||
|
||||
// Print some properties
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
|
||||
std::cout << "Device : \n"
|
||||
@ -112,10 +112,13 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
std::terminate();
|
||||
}
|
||||
std::vector<ze_command_queue_group_properties_t> queueProperties(numQueueGroups);
|
||||
for (auto &queueProperty : queueProperties) {
|
||||
queueProperty.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_GROUP_PROPERTIES;
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetCommandQueueGroupProperties(device, &numQueueGroups,
|
||||
queueProperties.data()));
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
for (uint32_t i = 0; i < numQueueGroups; i++) {
|
||||
if (queueProperties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE) {
|
||||
cmdQueueDesc.ordinal = i;
|
||||
@ -126,7 +129,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeCommandQueueCreate(context, device, &cmdQueueDesc, &cmdQueue));
|
||||
|
||||
// Create command list
|
||||
ze_command_list_desc_t cmdListDesc = {};
|
||||
ze_command_list_desc_t cmdListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC};
|
||||
cmdListDesc.commandQueueGroupOrdinal = cmdQueueDesc.ordinal;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDesc, &cmdList));
|
||||
}
|
||||
@ -183,7 +186,7 @@ void run_server(bool &validRet) {
|
||||
initializeProcess(context, device, cmdQueue, cmdList);
|
||||
|
||||
void *zeBuffer = nullptr;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocDevice(context, &deviceDesc, allocSize, allocSize, device, &zeBuffer));
|
||||
|
||||
for (uint32_t i = 0; i < CHILDPROCESSES; i++) {
|
||||
@ -224,7 +227,7 @@ void run_server(bool &validRet) {
|
||||
}
|
||||
|
||||
void *validateBuffer = nullptr;
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocShared(context, &deviceDesc, &hostDesc,
|
||||
allocSize, 1, device, &validateBuffer));
|
||||
|
||||
|
@ -89,7 +89,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
ze_driver_handle_t driverHandle;
|
||||
SUCCESS_OR_TERMINATE(zeDriverGet(&driverCount, &driverHandle));
|
||||
|
||||
ze_context_desc_t contextDesc = {};
|
||||
ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeContextCreate(driverHandle, &contextDesc, &context));
|
||||
|
||||
// Retrieve device
|
||||
@ -126,7 +126,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
}
|
||||
|
||||
// Print some properties
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
|
||||
std::cout << "Device : \n"
|
||||
@ -141,11 +141,14 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
std::terminate();
|
||||
}
|
||||
std::vector<ze_command_queue_group_properties_t> queueProperties(numQueueGroups);
|
||||
for (auto &queueProperty : queueProperties) {
|
||||
queueProperty.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_GROUP_PROPERTIES;
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetCommandQueueGroupProperties(device, &numQueueGroups,
|
||||
queueProperties.data()));
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDescCopy = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
ze_command_queue_desc_t cmdQueueDescCopy = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
for (uint32_t i = 0; i < numQueueGroups; i++) {
|
||||
if (queueProperties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE) {
|
||||
cmdQueueDesc.ordinal = i;
|
||||
@ -183,11 +186,11 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeCommandQueueCreate(context, device, &cmdQueueDescCopy, &cmdQueueCopy));
|
||||
|
||||
// Create command list
|
||||
ze_command_list_desc_t cmdListDesc = {};
|
||||
ze_command_list_desc_t cmdListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC};
|
||||
cmdListDesc.commandQueueGroupOrdinal = cmdQueueDesc.ordinal;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDesc, &cmdList));
|
||||
|
||||
ze_command_list_desc_t cmdListDescCopy = {};
|
||||
ze_command_list_desc_t cmdListDescCopy = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC};
|
||||
cmdListDescCopy.commandQueueGroupOrdinal = cmdQueueDescCopy.ordinal;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDescCopy, &cmdListCopy));
|
||||
}
|
||||
@ -204,7 +207,7 @@ void run_client(int commSocket) {
|
||||
initializeProcess(context, device, cmdQueue, cmdList, cmdQueueCopy, cmdListCopy, false);
|
||||
|
||||
void *zeBuffer = nullptr;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocDevice(context, &deviceDesc, allocSize, allocSize, device, &zeBuffer));
|
||||
|
||||
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryFill(cmdList, zeBuffer, reinterpret_cast<void *>(&expectedPattern),
|
||||
@ -255,7 +258,7 @@ void run_server(int commSocket, bool &validRet) {
|
||||
initializeProcess(context, device, cmdQueue, cmdList, cmdQueueCopy, cmdListCopy, true);
|
||||
|
||||
void *zeBuffer = nullptr;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocDevice(context, &deviceDesc, allocSize, allocSize, device, &zeBuffer));
|
||||
|
||||
// Initialize the IPC buffer
|
||||
@ -293,7 +296,7 @@ void run_server(int commSocket, bool &validRet) {
|
||||
}
|
||||
|
||||
void *validateBuffer = nullptr;
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocShared(context, &deviceDesc, &hostDesc, allocSize, 1, device, &validateBuffer));
|
||||
|
||||
SUCCESS_OR_TERMINATE(zeCommandListAppendMemoryFill(cmdList, validateBuffer, reinterpret_cast<void *>(&uinitializedPattern),
|
||||
|
@ -108,7 +108,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
ze_driver_handle_t driverHandle;
|
||||
SUCCESS_OR_TERMINATE(zeDriverGet(&driverCount, &driverHandle));
|
||||
|
||||
ze_context_desc_t contextDesc = {};
|
||||
ze_context_desc_t contextDesc = {ZE_STRUCTURE_TYPE_CONTEXT_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeContextCreate(driverHandle, &contextDesc, &context));
|
||||
|
||||
// Retrieve device
|
||||
@ -119,7 +119,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGet(driverHandle, &deviceCount, &device));
|
||||
|
||||
// Print some properties
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
|
||||
std::cout << "Device : \n"
|
||||
@ -134,10 +134,13 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
std::terminate();
|
||||
}
|
||||
std::vector<ze_command_queue_group_properties_t> queueProperties(numQueueGroups);
|
||||
for (auto &queueProperty : queueProperties) {
|
||||
queueProperty.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_GROUP_PROPERTIES;
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetCommandQueueGroupProperties(device, &numQueueGroups,
|
||||
queueProperties.data()));
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
for (uint32_t i = 0; i < numQueueGroups; i++) {
|
||||
if (queueProperties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE) {
|
||||
cmdQueueDesc.ordinal = i;
|
||||
@ -148,7 +151,7 @@ inline void initializeProcess(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeCommandQueueCreate(context, device, &cmdQueueDesc, &cmdQueue));
|
||||
|
||||
// Create command list
|
||||
ze_command_list_desc_t cmdListDesc = {};
|
||||
ze_command_list_desc_t cmdListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC};
|
||||
cmdListDesc.commandQueueGroupOrdinal = cmdQueueDesc.ordinal;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDesc, &cmdList));
|
||||
}
|
||||
@ -199,7 +202,7 @@ void run_client(int commSocket, uint32_t clientId) {
|
||||
std::vector<ze_event_handle_t> events(numEvents);
|
||||
|
||||
uint32_t i = 0;
|
||||
ze_event_desc_t eventDesc = {};
|
||||
ze_event_desc_t eventDesc = {ZE_STRUCTURE_TYPE_EVENT_DESC};
|
||||
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
for (auto &event : events) {
|
||||
@ -250,12 +253,12 @@ void run_server(bool &validRet) {
|
||||
initializeProcess(context, device, cmdQueue, cmdList);
|
||||
|
||||
void *zeBuffer = nullptr;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocDevice(context, &deviceDesc, allocSize, allocSize, device, &zeBuffer));
|
||||
|
||||
uint32_t numEvents = 2;
|
||||
ze_event_pool_handle_t eventPool = {};
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
ze_event_pool_desc_t eventPoolDesc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC};
|
||||
eventPoolDesc.count = numEvents;
|
||||
eventPoolDesc.flags = {};
|
||||
SUCCESS_OR_TERMINATE(zeEventPoolCreate(context, &eventPoolDesc, 1, &device, &eventPool));
|
||||
@ -263,7 +266,7 @@ void run_server(bool &validRet) {
|
||||
std::vector<ze_event_handle_t> events(numEvents);
|
||||
|
||||
uint32_t i = 0;
|
||||
ze_event_desc_t eventDesc = {};
|
||||
ze_event_desc_t eventDesc = {ZE_STRUCTURE_TYPE_EVENT_DESC};
|
||||
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
for (auto &event : events) {
|
||||
@ -318,7 +321,7 @@ void run_server(bool &validRet) {
|
||||
}
|
||||
|
||||
void *validateBuffer = nullptr;
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
SUCCESS_OR_TERMINATE(zeMemAllocShared(context, &deviceDesc, &hostDesc,
|
||||
allocSize, 1, device, &validateBuffer));
|
||||
|
||||
|
@ -31,7 +31,7 @@ void testPrintfKernel(ze_context_handle_t context, ze_device_handle_t &device) {
|
||||
ze_command_list_handle_t cmdList;
|
||||
ze_group_count_t dispatchTraits;
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
|
||||
cmdQueueDesc.ordinal = 0;
|
||||
cmdQueueDesc.index = 0;
|
||||
@ -47,7 +47,7 @@ void testPrintfKernel(ze_context_handle_t context, ze_device_handle_t &device) {
|
||||
}
|
||||
SUCCESS_OR_TERMINATE((0 == spirV.size()));
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = spirV.data();
|
||||
moduleDesc.inputSize = spirV.size();
|
||||
@ -55,7 +55,7 @@ void testPrintfKernel(ze_context_handle_t context, ze_device_handle_t &device) {
|
||||
|
||||
SUCCESS_OR_TERMINATE(zeModuleCreate(context, device, &moduleDesc, &module, nullptr));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "test_printf";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
|
||||
@ -101,7 +101,7 @@ int main(int argc, char *argv[]) {
|
||||
auto devices = zelloInitContextAndGetDevices(context);
|
||||
auto device = devices[0];
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -35,7 +35,7 @@ scratch_kernel(__global int *resIdx, global TYPE *src, global TYPE *dst) {
|
||||
|
||||
void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t &device, bool &outputValidationSuccessful) {
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
cmdQueueDesc.ordinal = getCommandQueueOrdinal(device);
|
||||
@ -54,11 +54,11 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t
|
||||
uint32_t srcMemorySize = expectedMemorySize * srcAdditionalMul;
|
||||
uint32_t idxMemorySize = arraySize * sizeof(uint32_t);
|
||||
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
deviceDesc.flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
deviceDesc.ordinal = 0;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
hostDesc.flags = ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
|
||||
void *srcBuffer = nullptr;
|
||||
@ -103,7 +103,7 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t
|
||||
ze_module_handle_t module = nullptr;
|
||||
ze_kernel_handle_t kernel = nullptr;
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = spirV.data();
|
||||
@ -122,7 +122,7 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeModuleBuildLogDestroy(buildlog));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "scratch_kernel";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
|
||||
@ -185,7 +185,7 @@ int main(int argc, char *argv[]) {
|
||||
auto device = devices[0];
|
||||
bool outputValidationSuccessful;
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -41,7 +41,7 @@ void createCmdQueueAndCmdList(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetCommandQueueGroupProperties(device, &numQueueGroups,
|
||||
queueProperties.data()));
|
||||
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
for (uint32_t i = 0; i < numQueueGroups; i++) {
|
||||
if (queueProperties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE) {
|
||||
cmdQueueDesc.ordinal = i;
|
||||
@ -53,7 +53,7 @@ void createCmdQueueAndCmdList(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeCommandQueueCreate(context, device, &cmdQueueDesc, &cmdQueue));
|
||||
|
||||
// Create command list
|
||||
ze_command_list_desc_t cmdListDesc = {};
|
||||
ze_command_list_desc_t cmdListDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC};
|
||||
cmdListDesc.commandQueueGroupOrdinal = cmdQueueDesc.ordinal;
|
||||
SUCCESS_OR_TERMINATE(zeCommandListCreate(context, device, &cmdListDesc, &cmdList));
|
||||
}
|
||||
@ -64,8 +64,8 @@ void createEventPoolAndEvents(ze_context_handle_t &context,
|
||||
ze_event_pool_flag_t poolFlag,
|
||||
uint32_t poolSize,
|
||||
ze_event_handle_t *events) {
|
||||
ze_event_pool_desc_t eventPoolDesc;
|
||||
ze_event_desc_t eventDesc;
|
||||
ze_event_pool_desc_t eventPoolDesc = {ZE_STRUCTURE_TYPE_EVENT_POOL_DESC};
|
||||
ze_event_desc_t eventDesc = {ZE_STRUCTURE_TYPE_EVENT_DESC};
|
||||
eventPoolDesc.count = poolSize;
|
||||
eventPoolDesc.flags = poolFlag;
|
||||
SUCCESS_OR_TERMINATE(zeEventPoolCreate(context, &eventPoolDesc, 1, &device, &eventPool));
|
||||
@ -98,7 +98,7 @@ bool testWriteGlobalTimestamp(ze_context_handle_t &context,
|
||||
globalTsStart = nullptr;
|
||||
globalTsEnd = nullptr;
|
||||
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
deviceDesc.flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
deviceDesc.ordinal = 0;
|
||||
|
||||
@ -125,7 +125,7 @@ bool testWriteGlobalTimestamp(ze_context_handle_t &context,
|
||||
SUCCESS_OR_TERMINATE(zeCommandQueueExecuteCommandLists(cmdQueue, 1, &cmdList, nullptr));
|
||||
SUCCESS_OR_TERMINATE(zeCommandQueueSynchronize(cmdQueue, std::numeric_limits<uint32_t>::max()));
|
||||
|
||||
ze_device_properties_t devProperties = {};
|
||||
ze_device_properties_t devProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &devProperties));
|
||||
|
||||
uint64_t commandDuration = tsEndResult - tsStartResult;
|
||||
@ -159,11 +159,11 @@ bool testKernelTimestampHostQuery(ze_context_handle_t &context,
|
||||
|
||||
// Create two shared buffers
|
||||
constexpr size_t allocSize = 4096;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
deviceDesc.flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
deviceDesc.ordinal = 0;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
hostDesc.flags = ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
|
||||
void *srcBuffer = nullptr;
|
||||
@ -185,13 +185,13 @@ bool testKernelTimestampHostQuery(ze_context_handle_t &context,
|
||||
|
||||
ze_module_handle_t module;
|
||||
ze_kernel_handle_t kernel;
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = reinterpret_cast<const uint8_t *>(spirvModule.data());
|
||||
moduleDesc.inputSize = spirvModule.size();
|
||||
SUCCESS_OR_TERMINATE(zeModuleCreate(context, device, &moduleDesc, &module, nullptr));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "CopyBufferToBufferBytes";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
|
||||
@ -225,7 +225,7 @@ bool testKernelTimestampHostQuery(ze_context_handle_t &context,
|
||||
ze_kernel_timestamp_result_t kernelTsResults;
|
||||
SUCCESS_OR_TERMINATE(zeEventQueryKernelTimestamp(kernelTsEvent, &kernelTsResults));
|
||||
|
||||
ze_device_properties_t devProperties = {};
|
||||
ze_device_properties_t devProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &devProperties));
|
||||
|
||||
uint64_t timerResolution = devProperties.timerResolution;
|
||||
@ -260,11 +260,11 @@ bool testKernelTimestampApendQuery(ze_context_handle_t &context,
|
||||
|
||||
// Create two shared buffers
|
||||
constexpr size_t allocSize = 4096;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
deviceDesc.flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
deviceDesc.ordinal = 0;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
hostDesc.flags = ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
|
||||
void *srcBuffer = nullptr;
|
||||
@ -290,13 +290,13 @@ bool testKernelTimestampApendQuery(ze_context_handle_t &context,
|
||||
|
||||
ze_module_handle_t module;
|
||||
ze_kernel_handle_t kernel;
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = reinterpret_cast<const uint8_t *>(spirvModule.data());
|
||||
moduleDesc.inputSize = spirvModule.size();
|
||||
SUCCESS_OR_TERMINATE(zeModuleCreate(context, device, &moduleDesc, &module, nullptr));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "CopyBufferToBufferBytes";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
|
||||
@ -332,7 +332,7 @@ bool testKernelTimestampApendQuery(ze_context_handle_t &context,
|
||||
|
||||
ze_kernel_timestamp_result_t *kernelTsResults = reinterpret_cast<ze_kernel_timestamp_result_t *>(timestampBuffer);
|
||||
|
||||
ze_device_properties_t devProperties = {};
|
||||
ze_device_properties_t devProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &devProperties));
|
||||
|
||||
uint64_t timerResolution = devProperties.timerResolution;
|
||||
@ -370,7 +370,7 @@ int main(int argc, char *argv[]) {
|
||||
auto devices = zelloInitContextAndGetDevices(context);
|
||||
auto device = devices[0];
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -104,7 +104,7 @@ void executeKernelAndValidate(ze_context_handle_t context,
|
||||
setGlobalWorkOffsetFunctionType pfnSetGlobalWorkOffset,
|
||||
bool &outputValidationSuccessful) {
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
cmdQueueDesc.ordinal = getCommandQueueOrdinal(device);
|
||||
@ -114,11 +114,11 @@ void executeKernelAndValidate(ze_context_handle_t context,
|
||||
SUCCESS_OR_TERMINATE(createCommandList(context, device, cmdList));
|
||||
// Create two shared buffers
|
||||
constexpr size_t allocSize = 4096;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
deviceDesc.flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
deviceDesc.ordinal = 0;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
hostDesc.flags = ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
|
||||
void *srcBuffer = nullptr;
|
||||
@ -149,7 +149,7 @@ void executeKernelAndValidate(ze_context_handle_t context,
|
||||
ze_module_handle_t module = nullptr;
|
||||
ze_kernel_handle_t kernel = nullptr;
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = spirV.data();
|
||||
@ -168,10 +168,10 @@ void executeKernelAndValidate(ze_context_handle_t context,
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeModuleBuildLogDestroy(buildlog));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "kernel_copy";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
ze_kernel_properties_t kernProps;
|
||||
ze_kernel_properties_t kernProps = {ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeKernelGetProperties(kernel, &kernProps));
|
||||
std::cout << "Kernel : \n"
|
||||
<< " * name : " << kernelDesc.pKernelName << "\n"
|
||||
@ -291,7 +291,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
setGlobalWorkOffsetFunctionType pfnSetGlobalWorkOffset = findSymbolForSetGlobalWorkOffsetFunction(userPath);
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -12,7 +12,7 @@ bool verbose = false;
|
||||
|
||||
void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t &device, bool &outputValidationSuccessful) {
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
cmdQueueDesc.ordinal = getCommandQueueOrdinal(device);
|
||||
@ -23,11 +23,11 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t
|
||||
|
||||
// Create two shared buffers
|
||||
constexpr size_t allocSize = 4096;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
deviceDesc.flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
deviceDesc.ordinal = 0;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
hostDesc.flags = ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
|
||||
void *srcBuffer = nullptr;
|
||||
@ -54,7 +54,7 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t
|
||||
std::unique_ptr<char[]> spirvInput(new char[length]);
|
||||
file.read(spirvInput.get(), length);
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = reinterpret_cast<const uint8_t *>(spirvInput.get());
|
||||
@ -73,7 +73,7 @@ void executeGpuKernelAndValidate(ze_context_handle_t context, ze_device_handle_t
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeModuleBuildLogDestroy(buildlog));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "CopyBufferToBufferBytes";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
|
||||
@ -139,7 +139,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
bool outputValidationSuccessful;
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -20,7 +20,7 @@ __kernel void kernel_copy(__global char *dst, __global char *src){
|
||||
|
||||
void executeKernelAndValidate(ze_context_handle_t context, ze_device_handle_t &device, bool &outputValidationSuccessful) {
|
||||
ze_command_queue_handle_t cmdQueue;
|
||||
ze_command_queue_desc_t cmdQueueDesc = {};
|
||||
ze_command_queue_desc_t cmdQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
|
||||
ze_command_list_handle_t cmdList;
|
||||
|
||||
cmdQueueDesc.ordinal = getCommandQueueOrdinal(device);
|
||||
@ -30,11 +30,11 @@ void executeKernelAndValidate(ze_context_handle_t context, ze_device_handle_t &d
|
||||
SUCCESS_OR_TERMINATE(createCommandList(context, device, cmdList));
|
||||
// Create two shared buffers
|
||||
constexpr size_t allocSize = 4096;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC};
|
||||
deviceDesc.flags = ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
deviceDesc.ordinal = 0;
|
||||
|
||||
ze_host_mem_alloc_desc_t hostDesc = {};
|
||||
ze_host_mem_alloc_desc_t hostDesc = {ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC};
|
||||
hostDesc.flags = ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED;
|
||||
|
||||
void *srcBuffer = nullptr;
|
||||
@ -58,7 +58,7 @@ void executeKernelAndValidate(ze_context_handle_t context, ze_device_handle_t &d
|
||||
ze_module_handle_t module = nullptr;
|
||||
ze_kernel_handle_t kernel = nullptr;
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = spirV.data();
|
||||
@ -77,7 +77,7 @@ void executeKernelAndValidate(ze_context_handle_t context, ze_device_handle_t &d
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeModuleBuildLogDestroy(buildlog));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "kernel_copy";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
ze_kernel_properties_t kernProps{ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES};
|
||||
@ -153,7 +153,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
bool outputValidationSuccessful;
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
|
@ -42,7 +42,7 @@ int main(int argc, char *argv[]) {
|
||||
auto devices = zelloInitContextAndGetDevices(context, driverHandle);
|
||||
auto device = devices[0];
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeDeviceGetProperties(device, &deviceProperties));
|
||||
std::cout << "Device : \n"
|
||||
<< " * name : " << deviceProperties.name << "\n"
|
||||
@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
|
||||
std::unique_ptr<char[]> spirvInput(new char[length]);
|
||||
file.read(spirvInput.get(), length);
|
||||
|
||||
ze_module_desc_t moduleDesc = {};
|
||||
ze_module_desc_t moduleDesc = {ZE_STRUCTURE_TYPE_MODULE_DESC};
|
||||
ze_module_build_log_handle_t buildlog;
|
||||
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||
moduleDesc.pInputModule = reinterpret_cast<const uint8_t *>(spirvInput.get());
|
||||
@ -72,7 +72,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
SUCCESS_OR_TERMINATE(zeModuleBuildLogDestroy(buildlog));
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
ze_kernel_desc_t kernelDesc = {ZE_STRUCTURE_TYPE_KERNEL_DESC};
|
||||
kernelDesc.pKernelName = "CopyBufferToBufferBytes";
|
||||
SUCCESS_OR_TERMINATE(zeKernelCreate(module, &kernelDesc, &kernel));
|
||||
|
||||
@ -124,7 +124,7 @@ int main(int argc, char *argv[]) {
|
||||
zeMemAllocShared(context, &deviceDesc, &hostDesc,
|
||||
allocSize, 1, device, &dstBuffer));
|
||||
|
||||
ze_memory_allocation_properties_t memProperties = {};
|
||||
ze_memory_allocation_properties_t memProperties = {ZE_STRUCTURE_TYPE_MEMORY_ALLOCATION_PROPERTIES};
|
||||
SUCCESS_OR_TERMINATE(zeMemGetAllocProperties(context, srcBuffer, &memProperties, &device));
|
||||
|
||||
SUCCESS_OR_TERMINATE_BOOL(memProperties.type == ZE_MEMORY_TYPE_SHARED);
|
||||
|
@ -126,7 +126,7 @@ void getDeviceHandles(ze_driver_handle_t &driverHandle, std::vector<ze_device_ha
|
||||
devices.resize(deviceCount);
|
||||
VALIDATECALL(zeDeviceGet(driverHandle, &deviceCount, devices.data()));
|
||||
|
||||
ze_device_properties_t deviceProperties = {};
|
||||
ze_device_properties_t deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
for (const auto &device : devices) {
|
||||
VALIDATECALL(zeDeviceGetProperties(device, &deviceProperties));
|
||||
|
||||
|
Reference in New Issue
Block a user