Skip to content

Commit a39bfeb

Browse files
committed
Revert "Merge pull request #65 from jcortell68/samsung_vid"
This reverts commit a56daf1, reversing changes made to 0127a5d.
1 parent a56daf1 commit a39bfeb

File tree

10 files changed

+23
-52
lines changed

10 files changed

+23
-52
lines changed

source/gpu_perf_api_common/gpa_context.cc

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ GpaContext::GpaContext(GpaHwInfo& hw_info, GpaOpenContextFlags flags)
2222
, hw_info_(hw_info)
2323
, invalidate_and_flush_l2_cache_enabled_(false)
2424
, is_open_(false)
25+
, is_amd_device_(false)
2526
, active_session_(nullptr)
2627
{
28+
GpaUInt32 vendor_id;
29+
30+
if (hw_info_.GetVendorId(vendor_id) && kAmdVendorId == vendor_id)
31+
{
32+
is_amd_device_ = true;
33+
}
2734
}
2835

2936
GpaContext::~GpaContext()
@@ -409,19 +416,15 @@ void GpaContext::SetAsOpened(bool open)
409416

410417
bool GpaContext::IsAmdDevice() const
411418
{
412-
GpaUInt32 vendor_id = 0;
413-
return hw_info_.GetVendorId(vendor_id) && (kAmdVendorId == vendor_id);
414-
}
419+
GpaUInt32 vendor_id;
420+
bool is_amd = false;
415421

416-
bool GpaContext::IsSamsungDevice() const
417-
{
418-
GpaUInt32 vendor_id = 0;
419-
return hw_info_.GetVendorId(vendor_id) && (kSamsungVendorId == vendor_id);
420-
}
422+
if (hw_info_.GetVendorId(vendor_id) && kAmdVendorId == vendor_id)
423+
{
424+
is_amd = true;
425+
}
421426

422-
bool GpaContext::IsAmdOrSamsungDevice() const
423-
{
424-
return IsAmdDevice() || IsSamsungDevice();
427+
return is_amd;
425428
}
426429

427430
void GpaContext::AddGpaSession(IGpaSession* gpa_session)

source/gpu_perf_api_common/gpa_context.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,6 @@ class GpaContext : public IGpaContext
129129
/// @return true if context device is AMD device otherwise false.
130130
bool IsAmdDevice() const;
131131

132-
/// @brief Returns whether the device is Samsung device or not.
133-
///
134-
/// @return true if context device is Samsung device otherwise false.
135-
bool IsSamsungDevice() const;
136-
137-
/// @brief Returns whether the device is AMD or Samsung device.
138-
///
139-
/// The Samsung Xclipse GPU is based on AMD RDNA2 and can be treated like AMD
140-
/// in most cases.
141-
///
142-
/// @return true if context device is AMD or Samsung device otherwise false.
143-
bool IsAmdOrSamsungDevice() const;
144-
145132
/// @brief Adds the GPA session to the session list.
146133
///
147134
/// @param [in] gpa_session GPA session object pointer.
@@ -176,6 +163,7 @@ class GpaContext : public IGpaContext
176163
bool invalidate_and_flush_l2_cache_enabled_; ///< Flag indicating flush and invalidation of L2 cache is enabled or not.
177164
bool is_open_; ///< Flag indicating context is open or not.
178165
GpaSessionList gpa_session_list_; ///< List of GPA sessions in the context.
166+
bool is_amd_device_; ///< Flag indicating whether the device is AMD or not.
179167
mutable std::mutex gpa_session_list_mutex_; ///< Mutex for GPA session list.
180168
IGpaSession* active_session_; ///< Gpa session to keep track of active session.
181169
mutable std::mutex active_session_mutex_; ///< Mutex for the active session.

source/gpu_perf_api_common/gpa_hw_info.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ bool GpaHwInfo::UpdateDeviceInfoBasedOnDeviceId()
264264
}
265265

266266
// Only emit an error for AMD devices.
267-
if (IsAmdOrSamsung())
267+
if (IsAmd())
268268
{
269269
std::stringstream ss;
270270
ss << "Unrecognized device ID: " << device_id_ << ".";

source/gpu_perf_api_common/gpa_hw_info.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
static const int kAmdVendorId = 0x1002; ///< The AMD vendor ID.
1919
static const int kNvidiaVendorId = 0x10DE; ///< The Nvidia vendor ID.
2020
static const int kIntelVendorId = 0x8086; ///< The Intel vendor ID.
21-
static const int kSamsungVendorId = 0x144D; ///< The Samsung vendor ID.
2221

2322
/// @brief Stores information about the hardware installed in the machine.
2423
class GpaHwInfo
@@ -231,26 +230,7 @@ class GpaHwInfo
231230
/// @return True if the current hardware is AMD hardware.
232231
bool IsAmd() const
233232
{
234-
return vendor_id_set_ && (kAmdVendorId == vendor_id_);
235-
};
236-
237-
/// @brief Check if the current hardware is Samsung hardware.
238-
///
239-
/// @return True if the current hardware is Samsung hardware.
240-
bool IsSamsung() const
241-
{
242-
return vendor_id_set_ && (kSamsungVendorId == vendor_id_);
243-
};
244-
245-
/// @brief Check if the current hardware is AMD or Samsung hardware.
246-
///
247-
/// The Samsung Xclipse GPU is based on AMD RDNA2 and can be treated like AMD
248-
/// in most cases.
249-
///
250-
/// @return True if the current hardware is AMD or Samsung hardware.
251-
bool IsAmdOrSamsung() const
252-
{
253-
return IsAmd() || IsSamsung();
233+
return vendor_id_set_ && kAmdVendorId == vendor_id_;
254234
};
255235

256236
/// @brief Check if the current hardware is Nvidia hardware.

source/gpu_perf_api_common/gpa_implementor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ GpaStatus GpaImplementor::IsDeviceSupported(GpaContextInfoPtr context_info, GpaH
305305
return kGpaStatusErrorFailed;
306306
}
307307

308-
if (api_hw_info.IsAmdOrSamsung())
308+
if (api_hw_info.IsAmd())
309309
{
310310
AMDTADLUtils::Instance()->GetAsicInfoList(asic_info_list);
311311
GpaHwInfo asic_hw_info;

source/gpu_perf_api_counter_generator/gpa_counter_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ GpaStatus GenerateCounters(GpaApiType desired_api,
163163
{
164164
desired_generation = GDT_HW_GENERATION_INTEL;
165165
}
166-
else if ((kAmdVendorId == vendor_id) || (kSamsungVendorId == vendor_id))
166+
else if (kAmdVendorId == vendor_id)
167167
{
168168
if (AMDTDeviceInfoUtils::Instance()->GetDeviceInfo(device_id, revision_id, card_info))
169169
{

source/gpu_perf_api_dx11/dx11_gpa_implementor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ bool Dx11GpaImplementor::VerifyApiHwSupport(const GpaContextInfoPtr context_info
128128
{
129129
GpaStatus status = kGpaStatusOk;
130130

131-
if (hw_info.IsAmdOrSamsung())
131+
if (hw_info.IsAmd())
132132
{
133133
unsigned int major_ver = 0;
134134
unsigned int minor_ver = 0;

source/gpu_perf_api_dx12/dx12_gpa_context.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ bool Dx12GpaContext::InitializeAMDExtension()
137137

138138
if (nullptr != d3d12_device_)
139139
{
140-
if (nullptr == gpa_interface_ && IsAmdOrSamsungDevice())
140+
if (nullptr == gpa_interface_ && IsAmdDevice())
141141
{
142142
result = kGpaStatusErrorDriverNotSupported;
143143

source/gpu_perf_api_gl/gl_gpa_context.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ bool GlGpaContext::ValidateAndUpdateGlCounters() const
311311
{
312312
GPA_LOG_ERROR("Unable to get necessary hardware info.");
313313
}
314-
else if (hwInfo.IsAmdOrSamsung())
314+
else if (hwInfo.IsAmd())
315315
{
316316
if (driver_counter_group_info_.size() == 0)
317317
{

source/gpu_perf_api_vk/vk_gpa_implementor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bool VkGpaImplementor::GetHwInfoFromApi(const GpaContextInfoPtr context_info, Gp
9191
{
9292
hardware_generation = GDT_HW_GENERATION_INTEL;
9393
}
94-
else if ((kAmdVendorId == vendor_id) || (kSamsungVendorId == vendor_id))
94+
else if (kAmdVendorId == vendor_id)
9595
{
9696
GDT_GfxCardInfo card_info = {};
9797

0 commit comments

Comments
 (0)