mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Initial DG2 support
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
b8aa2871bd
commit
91dfa5c2ac
14
opencl/source/xe_hpg_core/CMakeLists.txt
Normal file
14
opencl/source/xe_hpg_core/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(SUPPORT_XE_HPG_CORE)
|
||||
set(RUNTIME_SRCS_XE_HPG_CORE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
)
|
||||
|
||||
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_XE_HPG_CORE})
|
||||
set_property(GLOBAL PROPERTY RUNTIME_SRCS_XE_HPG_CORE ${RUNTIME_SRCS_XE_HPG_CORE})
|
||||
endif()
|
@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(RUNTIME_SRCS_ADDITIONAL_FILES_XE_HPG_CORE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/xe_hpg_core/definitions${BRANCH_DIR_SUFFIX}gtpin_setup_xe_hpg_core.inl
|
||||
)
|
||||
include_directories(${NEO_SOURCE_DIR}/opencl/source/xe_hpg_core/definitions${BRANCH_DIR_SUFFIX})
|
||||
|
||||
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_ADDITIONAL_FILES_XE_HPG_CORE})
|
||||
set_property(GLOBAL PROPERTY RUNTIME_SRCS_ADDITIONAL_FILES_XE_HPG_CORE ${RUNTIME_SRCS_ADDITIONAL_FILES_XE_HPG_CORE})
|
20
opencl/source/xe_hpg_core/buffer_xe_hpg_core.cpp
Normal file
20
opencl/source/xe_hpg_core/buffer_xe_hpg_core.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hpg_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/mem_obj/buffer_base.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
typedef XE_HPG_COREFamily Family;
|
||||
static auto gfxCore = IGFX_XE_HPG_CORE;
|
||||
|
||||
template class BufferHw<Family>;
|
||||
|
||||
#include "opencl/source/mem_obj/buffer_factory_init.inl"
|
||||
} // namespace NEO
|
87
opencl/source/xe_hpg_core/cl_hw_helper_xe_hpg_core.cpp
Normal file
87
opencl/source/xe_hpg_core/cl_hw_helper_xe_hpg_core.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
#include "opencl/source/helpers/cl_hw_helper_base.inl"
|
||||
#include "opencl/source/helpers/cl_hw_helper_xehp_and_later.inl"
|
||||
#include "opencl/source/helpers/surface_formats.h"
|
||||
|
||||
#include "hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XE_HPG_COREFamily;
|
||||
static auto gfxCore = IGFX_XE_HPG_CORE;
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<ClHwHelperHw<Family>>() {
|
||||
extern ClHwHelper *clHwHelperFactory[IGFX_MAX_CORE];
|
||||
clHwHelperFactory[gfxCore] = &ClHwHelperHw<Family>::get();
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ClHwHelperHw<Family>::requiresNonAuxMode(const ArgDescPointer &argAsPtr, const HardwareInfo &hwInfo) const {
|
||||
if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->allowStatelessCompression(hwInfo)) {
|
||||
return false;
|
||||
} else {
|
||||
return !argAsPtr.isPureStateful();
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ClHwHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo, const HardwareInfo &hwInfo) const {
|
||||
if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->allowStatelessCompression(hwInfo)) {
|
||||
return false;
|
||||
} else {
|
||||
return hasStatelessAccessToBuffer(kernelInfo);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
std::vector<uint32_t> ClHwHelperHw<Family>::getSupportedThreadArbitrationPolicies() const {
|
||||
return std::vector<uint32_t>{};
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ClHwHelperHw<Family>::isSupportedKernelThreadArbitrationPolicy() const { return false; }
|
||||
|
||||
template <>
|
||||
cl_version ClHwHelperHw<Family>::getDeviceIpVersion(const HardwareInfo &hwInfo) const {
|
||||
return makeDeviceIpVersion(12, 7, makeDeviceRevision(hwInfo));
|
||||
}
|
||||
|
||||
static const std::vector<cl_image_format> incompressibleFormats = {
|
||||
{CL_LUMINANCE, CL_UNORM_INT8},
|
||||
{CL_LUMINANCE, CL_UNORM_INT16},
|
||||
{CL_LUMINANCE, CL_HALF_FLOAT},
|
||||
{CL_LUMINANCE, CL_FLOAT},
|
||||
{CL_INTENSITY, CL_UNORM_INT8},
|
||||
{CL_INTENSITY, CL_UNORM_INT16},
|
||||
{CL_INTENSITY, CL_HALF_FLOAT},
|
||||
{CL_INTENSITY, CL_FLOAT},
|
||||
{CL_A, CL_UNORM_INT16},
|
||||
{CL_A, CL_HALF_FLOAT},
|
||||
{CL_A, CL_FLOAT}};
|
||||
|
||||
template <>
|
||||
bool ClHwHelperHw<Family>::allowImageCompression(cl_image_format format) const {
|
||||
for (auto &referenceFormat : incompressibleFormats) {
|
||||
if (format.image_channel_data_type == referenceFormat.image_channel_data_type &&
|
||||
format.image_channel_order == referenceFormat.image_channel_order) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template class ClHwHelperHw<Family>;
|
||||
|
||||
} // namespace NEO
|
33
opencl/source/xe_hpg_core/command_queue_xe_hpg_core.cpp
Normal file
33
opencl/source/xe_hpg_core/command_queue_xe_hpg_core.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/source/command_queue/enqueue_resource_barrier.h"
|
||||
|
||||
#include "enqueue_init_dispatch_globals.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XE_HPG_COREFamily;
|
||||
static auto gfxCore = IGFX_XE_HPG_CORE;
|
||||
} // namespace NEO
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
template <>
|
||||
void populateFactoryTable<CommandQueueHw<Family>>() {
|
||||
extern CommandQueueCreateFunc commandQueueFactory[IGFX_MAX_CORE];
|
||||
commandQueueFactory[gfxCore] = CommandQueueHw<Family>::create;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
template class NEO::CommandQueueHw<NEO::Family>;
|
@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
template <>
|
||||
uint32_t GTPinHwHelperHw<Family>::getGenVersion() {
|
||||
return gtpin::GTPIN_GEN_INVALID;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/aub_command_stream_receiver_hw.h"
|
||||
#include "shared/source/command_stream/command_stream_receiver_hw.h"
|
||||
#include "shared/source/command_stream/tbx_command_stream_receiver_hw.h"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/source/device_queue/device_queue_hw.h"
|
||||
#include "opencl/source/helpers/cl_hw_helper.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/sampler/sampler.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
typedef XE_HPG_COREFamily Family;
|
||||
|
||||
struct EnableOCLXeHpgCore {
|
||||
EnableOCLXeHpgCore() {
|
||||
populateFactoryTable<AUBCommandStreamReceiverHw<Family>>();
|
||||
populateFactoryTable<BufferHw<Family>>();
|
||||
populateFactoryTable<ClHwHelperHw<Family>>();
|
||||
populateFactoryTable<CommandQueueHw<Family>>();
|
||||
populateFactoryTable<CommandStreamReceiverHw<Family>>();
|
||||
populateFactoryTable<ImageHw<Family>>();
|
||||
populateFactoryTable<SamplerHw<Family>>();
|
||||
populateFactoryTable<TbxCommandStreamReceiverHw<Family>>();
|
||||
}
|
||||
};
|
||||
|
||||
static EnableOCLXeHpgCore enable;
|
||||
} // namespace NEO
|
19
opencl/source/xe_hpg_core/gpgpu_walker_xe_hpg_core.cpp
Normal file
19
opencl/source/xe_hpg_core/gpgpu_walker_xe_hpg_core.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl"
|
||||
#include "opencl/source/command_queue/hardware_interface_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template class GpgpuWalkerHelper<XE_HPG_COREFamily>;
|
||||
|
||||
template class HardwareInterface<XE_HPG_COREFamily>;
|
||||
|
||||
template struct EnqueueOperation<XE_HPG_COREFamily>;
|
||||
|
||||
} // namespace NEO
|
33
opencl/source/xe_hpg_core/gtpin_setup_xe_hpg_core.cpp
Normal file
33
opencl/source/xe_hpg_core/gtpin_setup_xe_hpg_core.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/gtpin/gtpin_hw_helper.h"
|
||||
#include "opencl/source/gtpin/gtpin_hw_helper.inl"
|
||||
#include "opencl/source/gtpin/gtpin_hw_helper_xehp_and_later.inl"
|
||||
|
||||
#include "ocl_igc_shared/gtpin/gtpin_ocl_interface.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
extern GTPinHwHelper *gtpinHwHelperFactory[IGFX_MAX_CORE];
|
||||
|
||||
typedef XE_HPG_COREFamily Family;
|
||||
static const auto gfxFamily = IGFX_XE_HPG_CORE;
|
||||
|
||||
template class GTPinHwHelperHw<Family>;
|
||||
|
||||
struct GTPinEnableXeHpgCore {
|
||||
GTPinEnableXeHpgCore() {
|
||||
gtpinHwHelperFactory[gfxFamily] = >PinHwHelperHw<Family>::get();
|
||||
}
|
||||
};
|
||||
|
||||
#include "gtpin_setup_xe_hpg_core.inl"
|
||||
|
||||
static GTPinEnableXeHpgCore gtpinEnable;
|
||||
|
||||
} // namespace NEO
|
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/source/helpers/hardware_commands_helper_base.inl"
|
||||
#include "opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
using FamilyType = XE_HPG_COREFamily;
|
||||
|
||||
template struct HardwareCommandsHelper<FamilyType>;
|
||||
} // namespace NEO
|
29
opencl/source/xe_hpg_core/image_xe_hpg_core.cpp
Normal file
29
opencl/source/xe_hpg_core/image_xe_hpg_core.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/context/context.h"
|
||||
#include "opencl/source/mem_obj/image.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XE_HPG_COREFamily;
|
||||
static auto gfxCore = IGFX_XE_HPG_CORE;
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
#include "opencl/source/mem_obj/image_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
// clang-format off
|
||||
#include "opencl/source/mem_obj/image_tgllp_and_later.inl"
|
||||
#include "opencl/source/mem_obj/image_factory_init.inl"
|
||||
// clang-format on
|
||||
} // namespace NEO
|
17
opencl/source/xe_hpg_core/sampler_xe_hpg_core.cpp
Normal file
17
opencl/source/xe_hpg_core/sampler_xe_hpg_core.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_base.h"
|
||||
using Family = NEO::XE_HPG_COREFamily;
|
||||
constexpr static auto gfxCore = IGFX_XE_HPG_CORE;
|
||||
|
||||
#include "opencl/source/sampler/sampler.h"
|
||||
#include "opencl/source/sampler/sampler.inl"
|
||||
|
||||
namespace NEO {
|
||||
#include "opencl/source/sampler/sampler_factory_init.inl"
|
||||
} // namespace NEO
|
Reference in New Issue
Block a user