OpenCL Queue Families extension 15/n

Add queue family name.
This change will break backwards-compatibility.

Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2021-01-14 14:06:40 +00:00
committed by Compute-Runtime-Automation
parent 22c25a231e
commit 320a404a91
8 changed files with 75 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
#include "shared/source/device/sub_device.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/string.h"
#include "shared/source/os_interface/driver_info.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/program/sync_buffer_handler.h"
@@ -243,4 +244,31 @@ cl_command_queue_capabilities_intel ClDevice::getQueueFamilyCapabilities(EngineG
return CL_QUEUE_DEFAULT_CAPABILITIES_INTEL;
}
void ClDevice::getQueueFamilyName(char *outputName, size_t maxOutputNameLength, EngineGroupType type) {
std::string name{};
const auto &clHwHelper = ClHwHelper::get(getHardwareInfo().platform.eRenderCoreFamily);
const bool hasHwSpecificName = clHwHelper.getQueueFamilyName(name, type);
if (!hasHwSpecificName) {
switch (type) {
case EngineGroupType::RenderCompute:
name = "rcs";
break;
case EngineGroupType::Compute:
name = "ccs";
break;
case EngineGroupType::Copy:
name = "bcs";
break;
default:
name = "";
break;
}
}
UNRECOVERABLE_IF(name.length() > maxOutputNameLength + 1);
strncpy_s(outputName, maxOutputNameLength, name.c_str(), name.size());
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -125,6 +125,7 @@ class ClDevice : public BaseObject<_cl_device_id> {
static cl_command_queue_capabilities_intel getQueueFamilyCapabilitiesAll();
MOCKABLE_VIRTUAL cl_command_queue_capabilities_intel getQueueFamilyCapabilities(EngineGroupType type);
void getQueueFamilyName(char *outputName, size_t maxOutputNameLength, EngineGroupType type);
protected:
void initializeCaps();

View File

@@ -369,6 +369,7 @@ void ClDevice::initializeCaps() {
properties.capabilities = getQueueFamilyCapabilities(engineGroupType);
properties.count = static_cast<cl_uint>(enginesInFamily.size());
properties.properties = deviceInfo.queueOnHostProperties;
getQueueFamilyName(properties.name, CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL, engineGroupType);
deviceInfo.queueFamilyProperties.push_back(properties);
}
}