- AMD Device Library eXtra v1.5
-
Programming with ADLX
- Programming with ADLX
-
ADLX Programming Guide
-
ADLX Samples
- ADLX Samples
-
C Samples
- C Samples
-
Display
- Display
- Display3DLUT
- DisplayBlanking
- DisplayColorDepth
- DisplayConnectivityExperience
- DisplayCustomColor
- DisplayCustomResolution
- DisplayDynamicRefreshRateControl
- DisplayEvents
- DisplayFreeSync
- DisplayFreeSyncColorAccuracy
- DisplayGamma
- DisplayGamut
- DisplayGPUScaling
- DisplayHDCP
- DisplayInfo
- DisplayIntegerScaling
- DisplayPixelFormat
- DisplayScalingMode
- DisplayVariBright
- DisplayVSR
-
Performance Monitoring
-
Receiving Events Notifications
-
C++ Samples
- C++ Samples
-
Display
- Display
- Display3DLUT
- DisplayBlanking
- DisplayColorDepth
- DisplayConnectivityExperience
- DisplayCustomColor
- DisplayCustomResolution
- DisplayDynamicRefreshRateControl
- DisplayEvents
- DisplayFreeSync
- DisplayFreeSyncColorAccuracy
- DisplayGamma
- DisplayGamut
- DisplayGPUScaling
- DisplayHDCP
- DisplayInfo
- DisplayIntegerScaling
- DisplayPixelFormat
- DisplayScalingMode
- DisplayVariBright
- DisplayVSR
-
Performance Monitoring
-
Receiving Events Notifications
-
ADLX SDK References
- ADLX SDK References
-
ADLX Helpers
-
ADLX Interfaces
- ADLX Interfaces
-
3D Graphics
- 3D Graphics
-
IADLX3DAnisotropicFiltering
-
IADLX3DAntiAliasing
-
IADLX3DFidelityFXFrameGenUpgrade
-
IADLX3DFidelityFXFrameGenUpgradeRatioOptionList
-
IADLX3DFrameRateTargetControl
-
IADLX3DImageSharpening
-
IADLX3DRadeonSuperResolution
-
IADLX3DSettingsChangedEvent
- IADLX3DSettingsChangedEvent
- GetGPU
- IsAnisotropicFilteringChanged
- IsAntiAliasingChanged
- IsAntiLagChanged
- IsBoostChanged
- IsChillChanged
- IsEnhancedSyncChanged
- IsFrameRateTargetControlChanged
- IsImageSharpeningChanged
- IsMorphologicalAntiAliasingChanged
- IsRadeonSuperResolutionChanged
- IsResetShaderCache
- IsTessellationModeChanged
- IsWaitForVerticalRefreshChanged
-
IADLX3DSettingsChangedEvent3
-
IADLX3DSettingsChangedHandling
-
IADLX3DSettingsServices
-
IADLX3DSettingsServices3
-
Display
- Display
-
IADLXDisplay3DLUT
- IADLXDisplay3DLUT
- ClearUser3DLUT
- GetAllUser3DLUT
- GetHDRUser3DLUT
- GetSCEDynamicContrast
- GetSCEDynamicContrastRange
- GetSDRUser3DLUT
- GetUser3DLUTIndex
- IsCurrentSCEDisabled
- IsCurrentSCEDynamicContrast
- IsCurrentSCEVividGaming
- IsSupportedSCE
- IsSupportedSCEDynamicContrast
- IsSupportedSCEVividGaming
- IsSupportedUser3DLUT
- SetAllUser3DLUT
- SetHDRUser3DLUT
- SetSCEDisabled
- SetSCEDynamicContrast
- SetSCEVividGaming
- SetSDRUser3DLUT
-
IADLXDisplay3DLUTChangedEvent
-
IADLXDisplayBlanking
-
IADLXDisplayChangedHandling
- IADLXDisplayChangedHandling
- AddDisplay3DLUTEventListener
- AddDisplayGammaEventListener
- AddDisplayGamutEventListener
- AddDisplayListEventListener
- AddDisplaySettingsEventListener
- RemoveDisplay3DLUTEventListener
- RemoveDisplayGammaEventListener
- RemoveDisplayGamutEventListener
- RemoveDisplayListEventListener
- RemoveDisplaySettingsEventListener
-
IADLXDisplayConnectivityExperience
- IADLXDisplayConnectivityExperience
- GetDPLinkRate
- GetNumberOfActiveLanes
- GetNumberOfTotalLanes
- GetRelativePreEmphasis
- GetRelativeVoltageSwing
- IsEnabledHDMIQualityDetection
- IsEnabledLinkProtection
- IsSupportedDPLink
- IsSupportedHDMIQualityDetection
- SetEnabledHDMIQualityDetection
- SetRelativePreEmphasis
- SetRelativeVoltageSwing
-
IADLXDisplayCustomColor
- IADLXDisplayCustomColor
- GetBrightness
- GetBrightnessRange
- GetContrast
- GetContrastRange
- GetHue
- GetHueRange
- GetSaturation
- GetSaturationRange
- GetTemperature
- GetTemperatureRange
- IsBrightnessSupported
- IsContrastSupported
- IsHueSupported
- IsSaturationSupported
- IsTemperatureSupported
- SetBrightness
- SetContrast
- SetHue
- SetSaturation
- SetTemperature
-
IADLXDisplayCustomResolution
-
IADLXDisplayDynamicRefreshRateControl
-
IADLXDisplayFreeSyncColorAccuracy
-
IADLXDisplayGamma
- IADLXDisplayGamma
- GetGammaCoefficient
- GetGammaRamp
- IsCurrentDeGammaRamp
- IsCurrentReGamma36
- IsCurrentReGammaBT709
- IsCurrentRegammaCoefficient
- IsCurrentReGammaPQ
- IsCurrentReGammaPQ2084Interim
- IsCurrentReGammaRamp
- IsCurrentReGammaSRGB
- IsSupportedReGamma36
- IsSupportedReGammaBT709
- IsSupportedReGammaPQ
- IsSupportedReGammaPQ2084Interim
- IsSupportedReGammaSRGB
- ResetGammaRamp
- SetDeGammaRamp
- SetReGamma36
- SetReGammaBT709
- SetReGammaCoefficient
- SetReGammaPQ
- SetReGammaPQ2084Interim
- SetReGammaRamp
- SetReGammaSRGB
-
IADLXDisplayGammaChangedEvent
-
IADLXDisplayGamut
- IADLXDisplayGamut
- GetGamutColorSpace
- GetWhitePoint
- IsCurrent5000kWhitePoint
- IsCurrent6500kWhitePoint
- IsCurrent7500kWhitePoint
- IsCurrent9300kWhitePoint
- IsCurrentAdobeRgbColorSpace
- IsCurrentCCIR2020ColorSpace
- IsCurrentCCIR601ColorSpace
- IsCurrentCCIR709ColorSpace
- IsCurrentCIERgbColorSpace
- IsCurrentCustomColorSpace
- IsCurrentCustomWhitePoint
- IsSupported5000kWhitePoint
- IsSupported6500kWhitePoint
- IsSupported7500kWhitePoint
- IsSupported9300kWhitePoint
- IsSupportedAdobeRgbColorSpace
- IsSupportedCCIR2020ColorSpace
- IsSupportedCCIR601ColorSpace
- IsSupportedCCIR709ColorSpace
- IsSupportedCIERgbColorSpace
- IsSupportedCustomColorSpace
- IsSupportedCustomWhitePoint
- SetGamut
-
IADLXDisplayGamutChangedEvent
-
IADLXDisplaySettingsChangedEvent
- IADLXDisplaySettingsChangedEvent
- GetDisplay
- IsColorDepthChanged
- IsCustomColorBrightnessChanged
- IsCustomColorContrastChanged
- IsCustomColorHueChanged
- IsCustomColorSaturationChanged
- IsCustomColorTemperatureChanged
- IsCustomResolutionChanged
- IsFreeSyncChanged
- IsGPUScalingChanged
- IsHDCPChanged
- IsIntegerScalingChanged
- IsPixelFormatChanged
- IsScalingModeChanged
- IsVariBrightChanged
- IsVSRChanged
-
IADLXDisplaySettingsChangedEvent3
-
IADLXDisplayVariBright1
- IADLXDisplayVariBright1
- IsBacklightAdaptiveEnabled
- IsBacklightAdaptiveSupported
- IsBatteryLifeEnabled
- IsBatteryLifeSupported
- IsFullScreenVideoEnabled
- IsFullScreenVideoSupported
- IsWindowsPowerModeEnabled
- IsWindowsPowerModeSupported
- SetBacklightAdaptiveEnabled
- SetBatteryLifeEnabled
- SetFullScreenVideoEnabled
- SetWindowsPowerModeEnabled
-
GPU Tuning
- GPU Tuning
-
IADLXGPUAutoTuningCompleteEvent
-
IADLXGPUTuningChangedEvent1
-
IADLXGPUTuningChangedHandling
-
IADLXGPUTuningServices
- IADLXGPUTuningServices
- GetAutoTuning
- GetGPUTuningChangedHandling
- GetManualFanTuning
- GetManualGFXTuning
- GetManualPowerTuning
- GetManualVRAMTuning
- GetPresetTuning
- IsAtFactory
- IsSupportedAutoTuning
- IsSupportedManualFanTuning
- IsSupportedManualGFXTuning
- IsSupportedManualPowerTuning
- IsSupportedManualVRAMTuning
- IsSupportedPresetTuning
- ResetToFactory
-
IADLXManualFanTuning
- IADLXManualFanTuning
- GetEmptyFanTuningStates
- GetFanTuningRanges
- GetFanTuningStates
- GetMinAcousticLimit
- GetMinAcousticLimitRange
- GetMinFanSpeed
- GetMinFanSpeedRange
- GetTargetFanSpeed
- GetTargetFanSpeedRange
- GetZeroRPMState
- IsSupportedMinAcousticLimit
- IsSupportedMinFanSpeed
- IsSupportedTargetFanSpeed
- IsSupportedZeroRPM
- IsValidFanTuningStates
- SetFanTuningStates
- SetMinAcousticLimit
- SetMinFanSpeed
- SetTargetFanSpeed
- SetZeroRPMState
-
IADLXManualFanTuningState
-
IADLXManualGraphicsTuning1
-
IADLXManualGraphicsTuning2_1
-
Miscellaneous
-
Multimedia
- Multimedia
-
IADLXMultimediaChangedEvent
-
IADLXMultimediaChangedHandling
-
IADLXMultimediaServices
-
IADLXVideoUpscale
-
Performance Monitoring
- Performance Monitoring
-
IADLXGPUMetricsSupport
- IADLXGPUMetricsSupport
- GetGPUClockSpeedRange
- GetGPUFanSpeedRange
- GetGPUHotspotTemperatureRange
- GetGPUIntakeTemperatureRange
- GetGPUPowerRange
- GetGPUTemperatureRange
- GetGPUTotalBoardPowerRange
- GetGPUUsageRange
- GetGPUVoltageRange
- GetGPUVRAMClockSpeedRange
- GetGPUVRAMRange
- IsSupportedGPUClockSpeed
- IsSupportedGPUFanSpeed
- IsSupportedGPUHotspotTemperature
- IsSupportedGPUIntakeTemperature
- IsSupportedGPUPower
- IsSupportedGPUTemperature
- IsSupportedGPUTotalBoardPower
- IsSupportedGPUUsage
- IsSupportedGPUVoltage
- IsSupportedGPUVRAM
- IsSupportedGPUVRAMClockSpeed
-
IADLXPerformanceMonitoringServices
- IADLXPerformanceMonitoringServices
- ClearPerformanceMetricsHistory
- GetAllMetricsHistory
- GetCurrentAllMetrics
- GetCurrentFPS
- GetCurrentGPUMetrics
- GetCurrentPerformanceMetricsHistorySize
- GetCurrentSystemMetrics
- GetFPSHistory
- GetGPUMetricsHistory
- GetMaxPerformanceMetricsHistorySize
- GetMaxPerformanceMetricsHistorySizeRange
- GetSamplingInterval
- GetSamplingIntervalRange
- GetSupportedGPUMetrics
- GetSupportedSystemMetrics
- GetSystemMetricsHistory
- SetMaxPerformanceMetricsHistorySize
- SetSamplingInterval
- StartPerformanceMetricsTracking
- StopPerformanceMetricsTracking
-
Power Tuning
- Power Tuning
-
IADLXGPUConnectChangedEvent
-
IADLXPowerTuningChangedHandling
-
IADLXPowerTuningServices1
-
IADLXSmartShiftMax
-
Legal Information and Compliance/Disclaimers
Log
Navigation: Programming with ADLX → ADLX Samples → C++ Samples → Miscellaneous
Demonstrates how to enable log and get log data when programming with ADLX.
Command Prompts
| Command Prompt | Description |
|---|---|
| 1 | Enable log with local file, file [./ADLX.log] is created. |
| 2 | Enable log with DebugView. |
| 3 | Enable log with application handle. |
| Q/q | Terminate the application. |
Sample Path
/Samples/CPP/Generic/Log
C++
Code
C++
//// Copyright Advanced Micro Devices, Inc. All rights reserved.////-------------------------------------------------------------------------------------------------
/// \file mainLog.cpp/// \brief Demonstrates how to enable log and get log data when programming in ADLX.
#include "SDK/ADLXHelper/Windows/Cpp/ADLXHelper.h"#include "SDK/Include/IDisplays.h"#include "SDK/Include/ILog.h"#include <iostream>
// Use ADLX namespaceusing namespace adlx;
// ADLXHelper instance// No outstanding interfaces from ADLX must exist when ADLX is destoryed.// Use global variables to ensure validity of the interface.static ADLXHelper g_ADLXHelp;
// Demonstrates how applications capture ADLX log// The log class may get used throughout the liftime of ADLX.// Global variables are used as they hold their value throughout the lifetime of ADLX.class AppHandlLog : public IADLXLog{ public: ADLX_RESULT ADLX_STD_CALL WriteLog(const wchar_t* msg) { wprintf(L"%s", msg); return ADLX_OK; }};
// Application creates object to handle ADLX logstatic AppHandlLog g_appHandlLog;
// Wait for exit with error messageint WaitAndExit(const char* msg, const int retCode);
// Local filevoid UseLocalFile();
// Output window of the application debuggervoid UseWindowDebugger();
// Application handle logvoid UseAppHandlLog();
// Main menuvoid MainMenu();
// Menu action controlvoid MenuControl();
int main(){ // Define return code ADLX_RESULT res = ADLX_FAIL;
// Initialize ADLX res = g_ADLXHelp.Initialize(); if (ADLX_SUCCEEDED(res)) { // Menu MainMenu(); MenuControl();
// Call ADLX methods to generate log entries // Get display service and the number of displays IADLXDisplayServicesPtr displayService; res = g_ADLXHelp.GetSystemServices()->GetDisplaysServices(&displayService); if (ADLX_SUCCEEDED(res)) { adlx_uint displayNum; displayService->GetNumberOfDisplays(&displayNum); } } else { return WaitAndExit("ADLX initialization failed", 0); }
// Destroy ADLX res = g_ADLXHelp.Terminate(); std::cout << "Destroy ADLX res: " << res << std::endl;
// Pause to see the print out system("pause"); return 0;}
// Wait for exit with error messageint WaitAndExit(const char* msg, const int retCode){ // Printout the message and pause to see before returning the desired code if (nullptr != msg) std::cout << msg << std::endl;
system("pause"); return retCode;}
// Local file, ADLX log data will be saved to filevoid UseLocalFile(){ // Log destination, severity, logfile ADLX_LOG_DESTINATION mode = LOCALFILE; ADLX_LOG_SEVERITY severity = LDEBUG; wchar_t logfile[] = L"./ADLX.log";
// Enable log ADLX_RESULT res = g_ADLXHelp.GetSystemServices()->EnableLog(mode, severity, nullptr, logfile); std::cout << "Enabled log res: " << res << "(0 means success)" << std::endl;}
// Configure ADLX log to send errors, warnings and debug information messages to the DebugView.void UseDebugView(){ // Log destination, severity ADLX_LOG_DESTINATION mode = DBGVIEW; ADLX_LOG_SEVERITY severity = LDEBUG;
// Enable log ADLX_RESULT res = g_ADLXHelp.GetSystemServices()->EnableLog(mode, severity, nullptr, nullptr); std::cout << "Enabled log result : " << res << "(0 means success)" << std::endl;}
// Application handle log, app's callback will handle the ADLX logvoid UseAppHandlLog(){ // Log destination, severity ADLX_LOG_DESTINATION mode = APPLICATION; ADLX_LOG_SEVERITY severity = LDEBUG;
// Enable log ADLX_RESULT res = g_ADLXHelp.GetSystemServices()->EnableLog(mode, severity, &g_appHandlLog, nullptr); std::cout << "Enabled log result: " << res << "(0 means success)" << std::endl;}
// Main menuvoid MainMenu(){ std::cout << "\tChoose from the following options:" << std::endl; std::cout << "\t->Press 1 to enable log with local file, file [./ADLX.log] will be created." << std::endl; std::cout << "\t->Press 2 to enable log with DebugView" << std::endl; std::cout << "\t->Press 3 to enable log with app handle" << std::endl;}
// Menu action controlvoid MenuControl(){ int num = 0; num = getchar(); switch (num) { // Local file case '1': UseLocalFile(); break;
// DebugView case '2': UseDebugView(); break;
// Application handle case '3': UseAppHandlLog(); break;
default: std::cout << "Invalid input" << std::endl; break; }}See Also: ADLX Macro, ADLX Enums