SWDEV-516307 - Clean up ICD references in HIP (#1019)

Moved default empty dispatch table and associated Platform initialization for HIP from fixme.cpp into the respective struct definitions.
Bu işleme şunda yer alıyor:
cadolphe-amd
2025-10-08 09:49:35 -04:00
işlemeyi yapan: GitHub
ebeveyn 0c53a12a88
işleme 207a278d41
5 değiştirilmiş dosya ile 14 ekleme ve 38 silme
-1
Dosyayı Görüntüle
@@ -96,7 +96,6 @@ if(NOT WIN32)
endif()
target_sources(amdhip64 PRIVATE
fixme.cpp
hip_activity.cpp
hip_code_object.cpp
hip_context.cpp
-33
Dosyayı Görüntüle
@@ -1,33 +0,0 @@
/* Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. */
#include "vdi_common.hpp"
#ifdef _WIN32
#include <windows.h>
#include <d3d9.h>
#include <d3d10_1.h>
#include <CL/cl_d3d10.h>
#include <CL/cl_d3d11.h>
#include <CL/cl_dx9_media_sharing.h>
#endif
#include <CL/cl_icd.h>
cl_icd_dispatch amd::ICDDispatchedObject::icdVendorDispatch_[] = {0};
amd::PlatformIDS amd::PlatformID::Platform = {amd::ICDDispatchedObject::icdVendorDispatch_};
-3
Dosyayı Görüntüle
@@ -29,9 +29,6 @@
#include <mutex>
amd::PlatformIDS amd::PlatformID::Platform = //{ NULL };
{amd::ICDDispatchedObject::icdVendorDispatch_};
static cl_int CL_API_CALL icdGetPlatformInfo(cl_platform_id platform, cl_platform_info param_name,
size_t param_value_size, void* param_value,
size_t* param_value_size_ret) {
+1 -1
Dosyayı Görüntüle
@@ -101,7 +101,7 @@ struct PlatformIDS {
};
class PlatformID {
public:
static PlatformIDS Platform;
static inline PlatformIDS Platform = {amd::ICDDispatchedObject::icdVendorDispatch_};
};
#define AMD_PLATFORM (reinterpret_cast<cl_platform_id>(&amd::PlatformID::Platform))
+13
Dosyayı Görüntüle
@@ -27,6 +27,15 @@
#include "os/alloc.hpp"
#include "thread/monitor.hpp"
#include "utils/util.hpp"
#ifdef _WIN32
#include <windows.h>
#include <d3d9.h>
#include <d3d10_1.h>
#include <CL/cl_d3d10.h>
#include <CL/cl_d3d11.h>
#include <CL/cl_dx9_media_sharing.h>
#endif
#include <CL/cl_icd.h>
#define KHR_CL_TYPES_DO(F) \
@@ -124,7 +133,11 @@ CL_TYPES_DO(DEFINE_CL_TRAITS);
//! \endcond
struct ICDDispatchedObject {
#ifdef __HIP_PLATFORM_AMD__
static inline cl_icd_dispatch icdVendorDispatch_[] = {0};
#else
static cl_icd_dispatch icdVendorDispatch_[];
#endif
const cl_icd_dispatch* const dispatch_;
protected: