1 /*========================== begin_copyright_notice ============================ 2 3 Copyright (C) 2020-2021 Intel Corporation 4 5 SPDX-License-Identifier: MIT 6 7 ============================= end_copyright_notice ===========================*/ 8 9 /* 10 @file metrics_library_api_1_0.h 11 12 @brief Interface for Metrics Library umd dll. 13 */ 14 15 #pragma once 16 17 #include <stdint.h> 18 19 #ifdef _MSC_VER 20 #define ML_STDCALL __stdcall 21 #else 22 #define ML_STDCALL 23 #endif 24 25 namespace MetricsLibraryApi 26 { 27 ////////////////////////////////////////////////////////////////////////// 28 /// @brief Metrics Library handles. 29 ////////////////////////////////////////////////////////////////////////// 30 #define METRICS_LIBRARY_HANDLE(Object) typedef struct Object##Handle_1_0 \ 31 { \ 32 void* data; \ 33 Object##Handle_1_0( void ) { data = nullptr; } \ 34 Object##Handle_1_0( void* handle ) { data = handle; } \ 35 bool IsValid( void ) const { return data != nullptr; } \ 36 } Object##Handle_1_0; 37 38 METRICS_LIBRARY_HANDLE( Client ) 39 METRICS_LIBRARY_HANDLE( ClientMemory ) 40 METRICS_LIBRARY_HANDLE( Configuration ) 41 METRICS_LIBRARY_HANDLE( Context ) 42 METRICS_LIBRARY_HANDLE( Marker ) 43 METRICS_LIBRARY_HANDLE( Override ) 44 METRICS_LIBRARY_HANDLE( Query ) 45 46 ////////////////////////////////////////////////////////////////////////// 47 /// @brief Client api types. 48 ////////////////////////////////////////////////////////////////////////// 49 enum class ClientApi : uint32_t 50 { 51 Unknown = 0, 52 // 1-5 reserved. 53 OpenCL = 6, 54 // 7-8 reserved. 55 OneApi = 9, 56 // 10 reserved. 57 // ... 58 Last 59 }; 60 61 ////////////////////////////////////////////////////////////////////////// 62 /// @brief Client gpu generation types. 63 ////////////////////////////////////////////////////////////////////////// 64 enum class ClientGen : uint32_t 65 { 66 Unknown = 0, 67 Gen9 = 1, 68 Gen9LP = 2, 69 Gen11 = 4, 70 Gen11LP = 5, 71 Gen12 = 6, 72 XeHP = 9, 73 XeHPG = 10, 74 XeHPC = 11, 75 // ... 76 Last 77 }; 78 79 ////////////////////////////////////////////////////////////////////////// 80 /// @brief Library object types. 81 ////////////////////////////////////////////////////////////////////////// 82 enum class ObjectType : uint32_t 83 { 84 Unknown = 0, 85 86 // Context objects: 87 Context = 10000, 88 89 // Query objects: 90 QueryHwCounters = 20000, 91 QueryPipelineTimestamps = 20001, 92 QueryHwCountersCopyReports = 20002, 93 94 // Configuration objects: 95 ConfigurationHwCountersOa = 30000, 96 ConfigurationHwCountersUser, 97 98 // Override objects: 99 OverrideUser = 40000, 100 OverrideNullHardware, 101 OverrideFlushCaches, 102 OverridePoshQuery, 103 OverrideDisablePoshPrimitives, 104 105 // Markers: 106 MarkerStreamUser = 50000, 107 MarkerStreamUserExtended = 50001, 108 109 // ... 110 Last 111 }; 112 113 ////////////////////////////////////////////////////////////////////////// 114 /// @brief Client options types. 115 ////////////////////////////////////////////////////////////////////////// 116 enum class ClientOptionsType : uint32_t 117 { 118 Posh = 0, 119 Ptbr, 120 Compute, 121 Tbs, 122 SubDevice, 123 SubDeviceIndex, 124 SubDeviceCount, 125 WorkloadPartition, 126 // ... 127 Last 128 }; 129 130 ////////////////////////////////////////////////////////////////////////// 131 /// @brief Status code types. 132 ////////////////////////////////////////////////////////////////////////// 133 enum class StatusCode : uint32_t 134 { 135 Success = 0, 136 Failed, 137 IncorrectVersion, 138 IncorrectParameter, 139 IncorrectSlot, 140 IncorrectObject, 141 InsufficientSpace, 142 NotInitialized, 143 NotSupported, 144 NotImplemented, 145 NullPointer, 146 OutOfMemory, 147 UnknownGen, 148 TbsUnableToEnable, 149 TbsUnableToRead, 150 ReportNotReady, 151 ReportLost, 152 ReportInconsistent, 153 CannotOpenFile, 154 ReportContextSwitchLost, 155 ReportWithoutWorkload, 156 // ... 157 Last 158 }; 159 160 ////////////////////////////////////////////////////////////////////////// 161 /// @brief Value types. 162 ////////////////////////////////////////////////////////////////////////// 163 enum class ValueType : uint8_t 164 { 165 Uint8 = 0, 166 Int8, 167 Uint16, 168 Int16, 169 Uint32, 170 Int32, 171 Uint64, 172 Int64, 173 Float, 174 Double, 175 Bool, 176 String, 177 // ... 178 Last 179 }; 180 181 ////////////////////////////////////////////////////////////////////////// 182 /// @brief Gpu configuration activation types. 183 ////////////////////////////////////////////////////////////////////////// 184 enum class GpuConfigurationActivationType : uint32_t 185 { 186 EscapeCode = 0, 187 Tbs, 188 // ... 189 Last 190 }; 191 192 ////////////////////////////////////////////////////////////////////////// 193 /// @brief Gpu command buffer types. 194 ////////////////////////////////////////////////////////////////////////// 195 enum class GpuCommandBufferType : uint32_t 196 { 197 Render = 0, 198 Posh, 199 Tile, 200 Compute, 201 // ... 202 Last 203 }; 204 205 ////////////////////////////////////////////////////////////////////////// 206 /// @brief Memory types. 207 ////////////////////////////////////////////////////////////////////////// 208 enum class MemoryType : uint32_t 209 { 210 Query = 0, 211 CommandBuffer, 212 Cpu, 213 // ... 214 Last 215 }; 216 217 ////////////////////////////////////////////////////////////////////////// 218 /// @brief Memory flags. 219 ////////////////////////////////////////////////////////////////////////// 220 enum class MemoryFlags : uint32_t 221 { 222 Linear = 1 << 0, 223 Cachable = 1 << 1 224 }; 225 226 ////////////////////////////////////////////////////////////////////////// 227 /// @brief Parameter types. 228 ////////////////////////////////////////////////////////////////////////// 229 enum class ParameterType : uint32_t 230 { 231 QueryHwCountersReportApiSize = 0, 232 QueryHwCountersReportGpuSize, 233 QueryPipelineTimestampsReportApiSize, 234 QueryPipelineTimestampsReportGpuSize, 235 LibraryBuildNumber, 236 // ... 237 Last 238 }; 239 240 ////////////////////////////////////////////////////////////////////////// 241 /// @brief Linux adapter types. 242 ////////////////////////////////////////////////////////////////////////// 243 enum class LinuxAdapterType : uint8_t 244 { 245 DrmFileDescriptor = 0, 246 // ... 247 Last 248 }; 249 250 ////////////////////////////////////////////////////////////////////////// 251 /// @brief Client type. 252 ////////////////////////////////////////////////////////////////////////// 253 struct ClientType_1_0 254 { 255 ClientApi Api; 256 ClientGen Gen; 257 }; 258 259 ////////////////////////////////////////////////////////////////////////// 260 /// @brief Typed value. 261 ////////////////////////////////////////////////////////////////////////// 262 struct TypedValue_1_0 263 { 264 ValueType Type; 265 266 union 267 { 268 int8_t ValueInt8; 269 uint8_t ValueUInt8; 270 int16_t ValueInt16; 271 uint16_t ValueUInt16; 272 int32_t ValueInt32; 273 uint32_t ValueUInt32; 274 int64_t ValueInt64; 275 uint64_t ValueUInt64; 276 float ValueFloat; 277 bool ValueBool; 278 const char* ValueString; 279 }; 280 }; 281 282 ////////////////////////////////////////////////////////////////////////// 283 /// @brief Gpu memory data. 284 ////////////////////////////////////////////////////////////////////////// 285 struct GpuMemory_1_0 286 { 287 uint64_t GpuAddress; // Virtual gpu address. 288 void* CpuAddress; // Locked cpu address. 289 ClientMemoryHandle_1_0 HandleMemory; // Driver's handle. 290 }; 291 292 ////////////////////////////////////////////////////////////////////////// 293 /// @brief Query creation data. 294 ////////////////////////////////////////////////////////////////////////// 295 struct QueryCreateData_1_0 296 { 297 ContextHandle_1_0 HandleContext; 298 ObjectType Type; 299 uint32_t Slots; 300 }; 301 302 ////////////////////////////////////////////////////////////////////////// 303 /// @brief Query hw counters command buffer data. 304 ////////////////////////////////////////////////////////////////////////// 305 struct CommandBufferQueryHwCounters_1_0 306 { 307 QueryHandle_1_0 Handle; 308 ConfigurationHandle_1_0 HandleUserConfiguration; 309 uint32_t Slot; 310 uint64_t MarkerUser; 311 uint64_t MarkerDriver; 312 uint64_t EndTag; 313 bool Begin; 314 }; 315 316 ////////////////////////////////////////////////////////////////////////// 317 /// @brief Copy query hw counter reports command buffer data. 318 ////////////////////////////////////////////////////////////////////////// 319 struct CommandBufferQueryHwCountersCopyReports_1_0 320 { 321 QueryHandle_1_0 HandleSource; 322 QueryHandle_1_0 HandleTarget; 323 324 GpuMemory_1_0 AddressSource; 325 GpuMemory_1_0 AddressTarget; 326 327 uint32_t SlotSource; 328 uint32_t SlotTarget; 329 330 uint32_t SlotCount; 331 }; 332 333 ////////////////////////////////////////////////////////////////////////// 334 /// @brief Query pipeline timestamps command buffer data. 335 ////////////////////////////////////////////////////////////////////////// 336 struct CommandBufferQueryPipelineTimestamps_1_0 337 { 338 QueryHandle_1_0 Handle; 339 uint64_t EndTag; 340 bool Begin; 341 }; 342 343 ////////////////////////////////////////////////////////////////////////// 344 /// @brief Overrides commands data. 345 ////////////////////////////////////////////////////////////////////////// 346 struct CommandBufferOverride_1_0 347 { 348 OverrideHandle_1_0 Handle; 349 bool Enable; 350 }; 351 352 ////////////////////////////////////////////////////////////////////////// 353 /// @brief Marker stream user commands data. 354 ////////////////////////////////////////////////////////////////////////// 355 struct CommandBufferMarkerStreamUser_1_0 356 { 357 uint32_t Reserved : 7; 358 uint32_t Value : 25; 359 }; 360 361 ////////////////////////////////////////////////////////////////////////// 362 /// @brief Marker stream user extended commands data. 363 ////////////////////////////////////////////////////////////////////////// 364 struct CommandBufferMarkerStreamUserExtended_1_0 365 { 366 }; 367 368 ////////////////////////////////////////////////////////////////////////// 369 /// @brief Command buffer data. 370 ////////////////////////////////////////////////////////////////////////// 371 struct CommandBufferData_1_0 372 { 373 ContextHandle_1_0 HandleContext; // Context handle. 374 ObjectType CommandsType; // Commands type related to library object. 375 GpuCommandBufferType Type; // Gpu command buffer type. 376 GpuMemory_1_0 Allocation; // Gpu memory allocation. 377 void* Data; // Gpu command buffer data. 378 uint32_t Size; // Gpu command buffer size. 379 uint32_t Offset; // Gpu command buffer offset from beginning. 380 381 union 382 { 383 CommandBufferQueryHwCounters_1_0 QueryHwCounters; 384 CommandBufferQueryHwCountersCopyReports_1_0 QueryHwCountersCopyReports; 385 CommandBufferQueryPipelineTimestamps_1_0 QueryPipelineTimestamps; 386 CommandBufferOverride_1_0 Override; 387 CommandBufferMarkerStreamUser_1_0 MarkerStreamUser; 388 CommandBufferMarkerStreamUserExtended_1_0 MarkerStreamUserExtended; 389 }; 390 }; 391 392 ////////////////////////////////////////////////////////////////////////// 393 /// @brief Command buffer size. 394 ////////////////////////////////////////////////////////////////////////// 395 struct CommandBufferSize_1_0 396 { 397 uint32_t GpuMemorySize; 398 uint32_t GpuMemoryPatchesCount; 399 }; 400 401 ////////////////////////////////////////////////////////////////////////// 402 /// @brief Override create data. 403 ////////////////////////////////////////////////////////////////////////// 404 struct OverrideCreateData_1_0 405 { 406 ContextHandle_1_0 HandleContext; 407 ObjectType Type; 408 }; 409 410 ////////////////////////////////////////////////////////////////////////// 411 /// @brief Marker creation data. 412 ////////////////////////////////////////////////////////////////////////// 413 struct MarkerCreateData_1_0 414 { 415 ContextHandle_1_0 HandleContext; 416 ObjectType Type; 417 }; 418 419 ////////////////////////////////////////////////////////////////////////// 420 /// @brief Configuration creation data. 421 ////////////////////////////////////////////////////////////////////////// 422 struct ConfigurationCreateData_1_0 423 { 424 ContextHandle_1_0 HandleContext; 425 ObjectType Type; 426 }; 427 428 ////////////////////////////////////////////////////////////////////////// 429 /// @brief Configuration activate data. 430 ////////////////////////////////////////////////////////////////////////// 431 struct ConfigurationActivateData_1_0 432 { 433 GpuConfigurationActivationType Type; 434 }; 435 436 ////////////////////////////////////////////////////////////////////////// 437 /// @brief Get query report. 438 ////////////////////////////////////////////////////////////////////////// 439 struct GetReportQuery_1_0 440 { 441 QueryHandle_1_0 Handle; // Input. 442 443 uint32_t Slot; // Input. 444 uint32_t SlotsCount; // Input. 445 446 uint32_t DataSize; // Input. 447 void* Data; // Input / output. 448 }; 449 450 ////////////////////////////////////////////////////////////////////////// 451 /// @brief Get override report. 452 ////////////////////////////////////////////////////////////////////////// 453 struct GetReportOverride_1_0 454 { 455 OverrideHandle_1_0 Handle; // Input. 456 457 uint32_t DataSize; // Input. 458 void* Data; // Output. 459 }; 460 461 ////////////////////////////////////////////////////////////////////////// 462 /// @brief Get data. 463 ////////////////////////////////////////////////////////////////////////// 464 struct GetReportData_1_0 465 { 466 ObjectType Type; 467 468 union 469 { 470 GetReportQuery_1_0 Query; 471 GetReportOverride_1_0 Override; 472 }; 473 }; 474 475 ////////////////////////////////////////////////////////////////////////// 476 /// @brief Gpu memory allocate data. 477 ////////////////////////////////////////////////////////////////////////// 478 struct GpuMemoryAllocateData_1_0 479 { 480 MemoryType Type; // Input. 481 MemoryFlags Flags; // Input. 482 uint32_t Size; // Input. 483 void* Data; // Output. 484 }; 485 486 ////////////////////////////////////////////////////////////////////////// 487 /// @brief Cpu memory allocate data. 488 ////////////////////////////////////////////////////////////////////////// 489 struct CpuMemoryAllocateData_1_0 490 { 491 uint32_t Size; // Input. 492 void* Data; // Output. 493 }; 494 495 ////////////////////////////////////////////////////////////////////////// 496 /// @brief Metrics Library functions. 497 ////////////////////////////////////////////////////////////////////////// 498 using GetParameterFunction_1_0 = StatusCode( ML_STDCALL* ) ( const ParameterType parameter, ValueType* type, TypedValue_1_0* value ); 499 500 using CommandBufferGetFunction_1_0 = StatusCode( ML_STDCALL* ) ( const CommandBufferData_1_0* data ); 501 using CommandBufferGetSizeFunction_1_0 = StatusCode( ML_STDCALL* ) ( const CommandBufferData_1_0* data, CommandBufferSize_1_0* size ); 502 503 using QueryCreateFunction_1_0 = StatusCode( ML_STDCALL* ) ( const QueryCreateData_1_0* createData, QueryHandle_1_0* handle ); 504 using QueryDeleteFunction_1_0 = StatusCode( ML_STDCALL* ) ( const QueryHandle_1_0 handle ); 505 506 using OverrideCreateFunction_1_0 = StatusCode( ML_STDCALL* ) ( const OverrideCreateData_1_0* createData, OverrideHandle_1_0* handle ); 507 using OverrideDeleteFunction_1_0 = StatusCode( ML_STDCALL* ) ( const OverrideHandle_1_0 handle ); 508 509 using MarkerCreateFunction_1_0 = StatusCode( ML_STDCALL* ) ( const MarkerCreateData_1_0* createData, MarkerHandle_1_0* handle ); 510 using MarkerDeleteFunction_1_0 = StatusCode( ML_STDCALL* ) ( const MarkerHandle_1_0 handle ); 511 512 using ConfigurationCreateFunction_1_0 = StatusCode( ML_STDCALL* ) ( const ConfigurationCreateData_1_0* createData, ConfigurationHandle_1_0* handle ); 513 using ConfigurationActivateFunction_1_0 = StatusCode( ML_STDCALL* ) ( const ConfigurationHandle_1_0 handle, const ConfigurationActivateData_1_0* activateData ); 514 using ConfigurationDeactivateFunction_1_0 = StatusCode( ML_STDCALL* ) ( const ConfigurationHandle_1_0 handle ); 515 using ConfigurationDeleteFunction_1_0 = StatusCode( ML_STDCALL* ) ( const ConfigurationHandle_1_0 handle ); 516 517 using GetDataFunction_1_0 = StatusCode( ML_STDCALL* ) ( GetReportData_1_0* data ); 518 519 ////////////////////////////////////////////////////////////////////////// 520 /// @brief Metrics Library callbacks. 521 ////////////////////////////////////////////////////////////////////////// 522 using CommandBufferFlushCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle ); 523 using CommandBufferHasSpaceCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle ); 524 using CommandBufferGetSpaceCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle ); 525 526 using GpuMemoryAllocateCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle, GpuMemoryAllocateData_1_0* allocationData, ClientMemoryHandle_1_0* handleMemory ); 527 using GpuMemoryPatchCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle, const ClientMemoryHandle_1_0 handleMemory, const uint64_t allocationOffset, const uint64_t buffer ); 528 using GpuMemoryReleaseCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle ); 529 530 using CpuMemoryAllocateCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle, CpuMemoryAllocateData_1_0* allocationData, ClientMemoryHandle_1_0* handleMemory ); 531 using CpuMemoryReleaseCallback_1_0 = StatusCode ( ML_STDCALL* ) ( const ClientHandle_1_0 handle ); 532 533 ////////////////////////////////////////////////////////////////////////// 534 /// @brief Metrics Library interface. 535 ////////////////////////////////////////////////////////////////////////// 536 struct Interface_1_0 537 { 538 GetParameterFunction_1_0 GetParameter; 539 540 CommandBufferGetFunction_1_0 CommandBufferGet; 541 CommandBufferGetSizeFunction_1_0 CommandBufferGetSize; 542 543 QueryCreateFunction_1_0 QueryCreate; 544 QueryDeleteFunction_1_0 QueryDelete; 545 546 OverrideCreateFunction_1_0 OverrideCreate; 547 OverrideDeleteFunction_1_0 OverrideDelete; 548 549 MarkerCreateFunction_1_0 MarkerCreate; 550 MarkerDeleteFunction_1_0 MarkerDelete; 551 552 ConfigurationCreateFunction_1_0 ConfigurationCreate; 553 ConfigurationActivateFunction_1_0 ConfigurationActivate; 554 ConfigurationDeactivateFunction_1_0 ConfigurationDeactivate; 555 ConfigurationDeleteFunction_1_0 ConfigurationDelete; 556 557 GetDataFunction_1_0 GetData; 558 }; 559 560 ////////////////////////////////////////////////////////////////////////// 561 /// @brief Metrics Library interface callbacks. 562 ////////////////////////////////////////////////////////////////////////// 563 struct ClientCallbacks_1_0 564 { 565 CommandBufferFlushCallback_1_0 CommandBufferFlush; 566 CommandBufferHasSpaceCallback_1_0 CommandBufferHasSpace; 567 CommandBufferGetSpaceCallback_1_0 CommandBufferGetSpace; 568 569 GpuMemoryAllocateCallback_1_0 GpuMemoryAllocate; 570 GpuMemoryPatchCallback_1_0 GpuMemoryPatch; 571 GpuMemoryReleaseCallback_1_0 GpuMemoryRelease; 572 573 CpuMemoryAllocateCallback_1_0 CpuMemoryAllocate; 574 CpuMemoryReleaseCallback_1_0 CpuMemoryRelease; 575 }; 576 577 ////////////////////////////////////////////////////////////////////////// 578 /// @brief Linux client adapter data. 579 ////////////////////////////////////////////////////////////////////////// 580 struct ClientDataLinuxAdapter_1_0 581 { 582 LinuxAdapterType Type; 583 584 union 585 { 586 int32_t DrmFileDescriptor; 587 }; 588 }; 589 590 ////////////////////////////////////////////////////////////////////////// 591 /// @brief Windows client data. 592 ////////////////////////////////////////////////////////////////////////// 593 struct ClientDataWindows_1_0 594 { 595 void* Device; 596 void* Adapter; 597 void* Escape; 598 bool KmdInstrumentationEnabled; 599 }; 600 601 ////////////////////////////////////////////////////////////////////////// 602 /// @brief Linux client data. 603 ////////////////////////////////////////////////////////////////////////// 604 struct ClientDataLinux_1_0 605 { 606 union 607 { 608 ClientDataLinuxAdapter_1_0* Adapter; 609 void* Reserved; 610 }; 611 }; 612 613 ////////////////////////////////////////////////////////////////////////// 614 /// @brief Client options posh data. 615 ////////////////////////////////////////////////////////////////////////// 616 struct ClientOptionsPoshData_1_0 617 { 618 bool Enabled; 619 }; 620 621 ////////////////////////////////////////////////////////////////////////// 622 /// @brief Client options ptbr data. 623 ////////////////////////////////////////////////////////////////////////// 624 struct ClientOptionsPtbrData_1_0 625 { 626 bool Enabled; 627 }; 628 629 ////////////////////////////////////////////////////////////////////////// 630 /// @brief Client options compute data. 631 ////////////////////////////////////////////////////////////////////////// 632 struct ClientOptionsComputeData_1_0 633 { 634 bool Asynchronous; 635 }; 636 637 ////////////////////////////////////////////////////////////////////////// 638 /// @brief Client options time based sampling data. 639 ////////////////////////////////////////////////////////////////////////// 640 struct ClientOptionsTbsData_1_0 641 { 642 bool Enabled; 643 }; 644 645 ////////////////////////////////////////////////////////////////////////// 646 /// @brief Client options sub device data. 647 ////////////////////////////////////////////////////////////////////////// 648 struct ClientOptionsSubDeviceData_1_0 649 { 650 bool Enabled; 651 }; 652 653 ////////////////////////////////////////////////////////////////////////// 654 /// @brief Client options sub device index data. 655 ////////////////////////////////////////////////////////////////////////// 656 struct ClientOptionsSubDeviceIndexData_1_0 657 { 658 uint8_t Index; 659 }; 660 661 ////////////////////////////////////////////////////////////////////////// 662 /// @brief Client options sub device count data. 663 ////////////////////////////////////////////////////////////////////////// 664 struct ClientOptionsSubDeviceCountData_1_0 665 { 666 uint8_t Count; 667 }; 668 669 ////////////////////////////////////////////////////////////////////////// 670 /// @brief Client options workload partition data. 671 ////////////////////////////////////////////////////////////////////////// 672 struct ClientOptionsWorkloadPartition_1_0 673 { 674 bool Enabled; 675 }; 676 677 ////////////////////////////////////////////////////////////////////////// 678 /// @brief Client options data. 679 ////////////////////////////////////////////////////////////////////////// 680 struct ClientOptionsData_1_0 681 { 682 ClientOptionsType Type; 683 684 union 685 { 686 ClientOptionsPoshData_1_0 Posh; 687 ClientOptionsPtbrData_1_0 Ptbr; 688 ClientOptionsComputeData_1_0 Compute; 689 ClientOptionsTbsData_1_0 Tbs; 690 ClientOptionsSubDeviceData_1_0 SubDevice; 691 ClientOptionsSubDeviceIndexData_1_0 SubDeviceIndex; 692 ClientOptionsSubDeviceCountData_1_0 SubDeviceCount; 693 ClientOptionsWorkloadPartition_1_0 WorkloadPartition; 694 }; 695 }; 696 697 ////////////////////////////////////////////////////////////////////////// 698 /// @brief Client data. 699 ////////////////////////////////////////////////////////////////////////// 700 struct ClientData_1_0 701 { 702 ClientHandle_1_0 Handle; 703 704 union 705 { 706 ClientDataWindows_1_0 Windows; 707 ClientDataLinux_1_0 Linux; 708 }; 709 710 ClientOptionsData_1_0* ClientOptions; 711 uint32_t ClientOptionsCount; 712 }; 713 714 ////////////////////////////////////////////////////////////////////////// 715 /// @brief Context create data. 716 ////////////////////////////////////////////////////////////////////////// 717 struct ContextCreateData_1_0 718 { 719 ClientData_1_0* ClientData; 720 ClientCallbacks_1_0* ClientCallbacks; 721 Interface_1_0* Api; 722 }; 723 724 using ContextCreateFunction_1_0 = StatusCode ( ML_STDCALL* ) ( ClientType_1_0 clientType, ContextCreateData_1_0* createData, ContextHandle_1_0* handle ); 725 using ContextDeleteFunction_1_0 = StatusCode ( ML_STDCALL* ) ( const ContextHandle_1_0 handle ); 726 727 ////////////////////////////////////////////////////////////////////////// 728 /// @brief Metrics Library initialize/destroy functions. 729 ////////////////////////////////////////////////////////////////////////// 730 #define METRICS_LIBRARY_CONTEXT_CREATE_1_0 "ContextCreate_1_0" 731 #define METRICS_LIBRARY_CONTEXT_DELETE_1_0 "ContextDelete_1_0" 732 733 ////////////////////////////////////////////////////////////////////////// 734 /// @brief Metrics Library current version. 735 ////////////////////////////////////////////////////////////////////////// 736 #define METRICS_LIBRARY_MAJOR_NUMBER 1 737 #define METRICS_LIBRARY_MINOR_NUMBER 0 738 #define METRICS_LIBRARY_BUILD_NUMBER 66 739 740 } // namespace MetricsLibraryApi 741