/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/ROCR-Runtime/src/inc/hsa_ext_amd.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/ROCR-Runtime/src/inc/hsa_ext_amd.h Source File#

HIP Runtime API Reference: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/ROCR-Runtime/src/inc/hsa_ext_amd.h Source File
hsa_ext_amd.h
Go to the documentation of this file.
1
2//
3// The University of Illinois/NCSA
4// Open Source License (NCSA)
5//
6// Copyright (c) 2014-2020, Advanced Micro Devices, Inc. All rights reserved.
7//
8// Developed by:
9//
10// AMD Research and AMD HSA Software Development
11//
12// Advanced Micro Devices, Inc.
13//
14// www.amd.com
15//
16// Permission is hereby granted, free of charge, to any person obtaining a copy
17// of this software and associated documentation files (the "Software"), to
18// deal with the Software without restriction, including without limitation
19// the rights to use, copy, modify, merge, publish, distribute, sublicense,
20// and/or sell copies of the Software, and to permit persons to whom the
21// Software is furnished to do so, subject to the following conditions:
22//
23// - Redistributions of source code must retain the above copyright notice,
24// this list of conditions and the following disclaimers.
25// - Redistributions in binary form must reproduce the above copyright
26// notice, this list of conditions and the following disclaimers in
27// the documentation and/or other materials provided with the distribution.
28// - Neither the names of Advanced Micro Devices, Inc,
29// nor the names of its contributors may be used to endorse or promote
30// products derived from this Software without specific prior written
31// permission.
32//
33// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
36// THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
37// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
38// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
39// DEALINGS WITH THE SOFTWARE.
40//
42
43// HSA AMD extension.
44
45#ifndef HSA_RUNTIME_EXT_AMD_H_
46#define HSA_RUNTIME_EXT_AMD_H_
47
48#include "hsa.h"
49#include "hsa_ext_image.h"
50#include "hsa_ven_amd_pc_sampling.h"
51
61#define HSA_AMD_INTERFACE_VERSION_MAJOR 1
62#define HSA_AMD_INTERFACE_VERSION_MINOR 6
63
64#ifdef __cplusplus
65extern "C" {
66#endif
67
76static __inline__ __attribute__((always_inline)) bool hsa_flag_isset64(uint8_t* value,
77 uint32_t bit) {
78 unsigned int index = bit / 8;
79 unsigned int subBit = bit % 8;
80 return ((uint8_t*)value)[index] & (1 << subBit);
81}
82
86typedef uint32_t hsa_signal_condition32_t;
87
99
104
108typedef struct hsa_amd_packet_header_s {
113 uint16_t header;
114
119
123 uint8_t reserved;
125
131typedef struct hsa_amd_barrier_value_packet_s {
136
140 uint32_t reserved0;
141
147 hsa_signal_t signal;
148
152 hsa_signal_value_t value;
153
157 hsa_signal_value_t mask;
158
163
167 uint32_t reserved1;
168
172 uint64_t reserved2;
173
177 uint64_t reserved3;
178
183 hsa_signal_t completion_signal;
185
193enum {
198
203
208
215
222
227
232};
233
237typedef enum {
242 /* IOMMU V1 support is not relevant to user applications, so not reporting it */
248
252typedef enum hsa_amd_agent_info_s {
439 HSA_AMD_AGENT_INFO_AQL_EXTENSIONS = 0xA115 /* Not implemented yet */
441
445typedef enum hsa_amd_agent_memory_properties_s {
448
470
471typedef struct hsa_amd_hdp_flush_s {
475
500
514
532hsa_status_t HSA_API hsa_amd_coherency_get_type(hsa_agent_t agent,
534
553hsa_status_t HSA_API hsa_amd_coherency_set_type(hsa_agent_t agent,
555
562typedef struct hsa_amd_profiling_dispatch_time_s {
566 uint64_t start;
570 uint64_t end;
572
579typedef struct hsa_amd_profiling_async_copy_time_s {
583 uint64_t start;
587 uint64_t end;
589
606hsa_status_t HSA_API
607 hsa_amd_profiling_set_profiler_enabled(hsa_queue_t* queue, int enable);
608
629hsa_status_t HSA_API
631
660 hsa_agent_t agent, hsa_signal_t signal,
662
685 hsa_signal_t signal, hsa_amd_profiling_async_copy_time_t* time);
686
708hsa_status_t HSA_API
710 uint64_t agent_tick,
711 uint64_t* system_tick);
712
731
767hsa_status_t HSA_API hsa_amd_signal_create(hsa_signal_value_t initial_value, uint32_t num_consumers,
768 const hsa_agent_t* consumers, uint64_t attributes,
769 hsa_signal_t* signal);
770
799hsa_status_t hsa_amd_signal_value_pointer(hsa_signal_t signal,
800 volatile hsa_signal_value_t** value_ptr);
801
826typedef bool (*hsa_amd_signal_handler)(hsa_signal_value_t value, void* arg);
827
869hsa_status_t HSA_API
870 hsa_amd_signal_async_handler(hsa_signal_t signal,
871 hsa_signal_condition_t cond,
872 hsa_signal_value_t value,
873 hsa_amd_signal_handler handler, void* arg);
874
899hsa_status_t HSA_API
900 hsa_amd_async_function(void (*callback)(void* arg), void* arg);
901
911uint32_t HSA_API
912 hsa_amd_signal_wait_any(uint32_t signal_count, hsa_signal_t* signals,
913 hsa_signal_condition_t* conds,
914 hsa_signal_value_t* values, uint64_t timeout_hint,
915 hsa_wait_state_t wait_hint,
916 hsa_signal_value_t* satisfying_value);
917
939hsa_status_t HSA_API hsa_amd_image_get_info_max_dim(hsa_agent_t agent,
940 hsa_agent_info_t attribute,
941 void* value);
942
976hsa_status_t HSA_API hsa_amd_queue_cu_set_mask(const hsa_queue_t* queue,
977 uint32_t num_cu_mask_count,
978 const uint32_t* cu_mask);
979
1004hsa_status_t HSA_API hsa_amd_queue_cu_get_mask(const hsa_queue_t* queue, uint32_t num_cu_mask_count,
1005 uint32_t* cu_mask);
1006
1030
1052typedef struct hsa_amd_memory_pool_s {
1056 uint64_t handle;
1058
1084
1095
1172
1194
1209hsa_status_t HSA_API
1212 void* value);
1213
1248 hsa_agent_t agent,
1249 hsa_status_t (*callback)(hsa_amd_memory_pool_t memory_pool, void* data),
1250 void* data);
1251
1288hsa_status_t HSA_API
1290 uint32_t flags, void** ptr);
1291
1305hsa_status_t HSA_API hsa_amd_memory_pool_free(void* ptr);
1306
1365hsa_status_t HSA_API
1366 hsa_amd_memory_async_copy(void* dst, hsa_agent_t dst_agent, const void* src,
1367 hsa_agent_t src_agent, size_t size,
1368 uint32_t num_dep_signals,
1369 const hsa_signal_t* dep_signals,
1370 hsa_signal_t completion_signal);
1371
1398hsa_status_t HSA_API
1399 hsa_amd_memory_async_copy_on_engine(void* dst, hsa_agent_t dst_agent, const void* src,
1400 hsa_agent_t src_agent, size_t size,
1401 uint32_t num_dep_signals,
1402 const hsa_signal_t* dep_signals,
1403 hsa_signal_t completion_signal,
1404 hsa_amd_sdma_engine_id_t engine_id,
1405 bool force_copy_on_sdma);
1423hsa_status_t HSA_API
1424 hsa_amd_memory_copy_engine_status(hsa_agent_t dst_agent, hsa_agent_t src_agent,
1425 uint32_t *engine_ids_mask);
1426
1427/*
1428[Provisional API]
1429Pitched memory descriptor.
1430All elements must be 4 byte aligned. Pitch and slice are in bytes.
1431*/
1432typedef struct hsa_pitched_ptr_s {
1433 void* base;
1434 size_t pitch;
1435 size_t slice;
1437
1438/*
1439[Provisional API]
1440Copy direction flag.
1441*/
1448
1449/*
1450[Provisional API]
1451SDMA 3D memory copy API. The same requirements must be met by src and dst as in
1452hsa_amd_memory_async_copy.
1453Both src and dst must be directly accessible to the copy_agent during the copy, src and dst rects
1454must not overlap.
1455CPU agents are not supported. API requires SDMA and will return an error if SDMA is not available.
1456Offsets and range carry x in bytes, y and z in rows and layers.
1457*/
1459 const hsa_pitched_ptr_t* dst, const hsa_dim3_t* dst_offset, const hsa_pitched_ptr_t* src,
1460 const hsa_dim3_t* src_offset, const hsa_dim3_t* range, hsa_agent_t copy_agent,
1461 hsa_amd_copy_direction_t dir, uint32_t num_dep_signals, const hsa_signal_t* dep_signals,
1462 hsa_signal_t completion_signal);
1463
1484
1515
1520typedef struct hsa_amd_memory_pool_link_info_s {
1524 uint32_t min_latency;
1525
1529 uint32_t max_latency;
1530
1535
1540
1545
1550
1555
1560
1566
1611
1630 hsa_agent_t agent, hsa_amd_memory_pool_t memory_pool,
1631 hsa_amd_agent_memory_pool_info_t attribute, void* value);
1632
1670hsa_status_t HSA_API
1671 hsa_amd_agents_allow_access(uint32_t num_agents, const hsa_agent_t* agents,
1672 const uint32_t* flags, const void* ptr);
1673
1701hsa_status_t HSA_API
1703 hsa_amd_memory_pool_t dst_memory_pool,
1704 bool* result);
1705
1742hsa_status_t HSA_API hsa_amd_memory_migrate(const void* ptr,
1743 hsa_amd_memory_pool_t memory_pool,
1744 uint32_t flags);
1745
1780hsa_status_t HSA_API hsa_amd_memory_lock(void* host_ptr, size_t size,
1781 hsa_agent_t* agents, int num_agent,
1782 void** agent_ptr);
1783
1829hsa_status_t HSA_API hsa_amd_memory_lock_to_pool(void* host_ptr, size_t size, hsa_agent_t* agents,
1830 int num_agent, hsa_amd_memory_pool_t pool,
1831 uint32_t flags, void** agent_ptr);
1832
1849hsa_status_t HSA_API hsa_amd_memory_unlock(void* host_ptr);
1850
1873hsa_status_t HSA_API
1874 hsa_amd_memory_fill(void* ptr, uint32_t value, size_t count);
1875
1912hsa_status_t HSA_API hsa_amd_interop_map_buffer(uint32_t num_agents,
1913 hsa_agent_t* agents,
1914 int interop_handle,
1915 uint32_t flags,
1916 size_t* size,
1917 void** ptr,
1918 size_t* metadata_size,
1919 const void** metadata);
1920
1925hsa_status_t HSA_API hsa_amd_interop_unmap_buffer(void* ptr);
1926
1932typedef struct hsa_amd_image_descriptor_s {
1933 /*
1934 Version number of the descriptor
1935 */
1936 uint32_t version;
1937
1938 /*
1939 Vendor and device PCI IDs for the format as VENDOR_ID<<16|DEVICE_ID.
1940 */
1941 uint32_t deviceID;
1942
1943 /*
1944 Start of vendor specific data.
1945 */
1946 uint32_t data[1];
1948
1974hsa_status_t HSA_API hsa_amd_image_create(
1975 hsa_agent_t agent,
1976 const hsa_ext_image_descriptor_t *image_descriptor,
1977 const hsa_amd_image_descriptor_t *image_layout,
1978 const void *image_data,
1979 hsa_access_permission_t access_permission,
1980 hsa_ext_image_t *image
1981);
1982
1986typedef enum {
1987 /*
1988 Memory is not known to the HSA driver. Unallocated or unlocked system memory.
1989 */
1991 /*
1992 Memory was allocated with an HSA memory allocator.
1993 */
1995 /*
1996 System memory which has been locked for use with an HSA agent.
1997
1998 Memory of this type is normal malloc'd memory and is always accessible to
1999 the CPU. Pointer info queries may not include CPU agents in the accessible
2000 agents list as the CPU has implicit access.
2001 */
2003 /*
2004 Memory originated in a graphics component and is shared with ROCr.
2005 */
2007 /*
2008 Memory has been shared with the local process via ROCr IPC APIs.
2009 */
2012
2017typedef struct hsa_amd_pointer_info_s {
2018 /*
2019 Size in bytes of this structure. Used for version control within a major ROCr
2020 revision. Set to sizeof(hsa_amd_pointer_t) prior to calling
2021 hsa_amd_pointer_info. If the runtime supports an older version of pointer
2022 info then size will be smaller on return. Members starting after the return
2023 value of size will not be updated by hsa_amd_pointer_info.
2024 */
2025 uint32_t size;
2026 /*
2027 The type of allocation referenced.
2028 */
2030 /*
2031 Base address at which non-host agents may access the allocation. This field is
2032 not meaningful if the type of the allocation is HSA_EXT_POINTER_TYPE_UNKNOWN.
2033 */
2035 /*
2036 Base address at which the host agent may access the allocation. This field is
2037 not meaningful if the type of the allocation is HSA_EXT_POINTER_TYPE_UNKNOWN.
2038 */
2040 /*
2041 Size of the allocation. This field is not meaningful if the type of the allocation
2042 is HSA_EXT_POINTER_TYPE_UNKNOWN.
2043 */
2045 /*
2046 Application provided value. This field is not meaningful if the type of the
2047 allocation is HSA_EXT_POINTER_TYPE_UNKNOWN.
2048 */
2050 /*
2051 Reports an agent which "owns" (ie has preferred access to) the pool in which the
2052 allocation was
2053 made. When multiple agents share equal access to a pool (ex: multiple CPU agents, or multi-die
2054 GPU boards) any such agent may be returned. This field is not meaningful if
2055 the type of the allocation is HSA_EXT_POINTER_TYPE_UNKNOWN or if this agent is not available in
2056 this process, for e.g if this agent is masked using ROCR_VISIBLE_DEVICES.
2057 */
2058 hsa_agent_t agentOwner;
2059 /*
2060 Contains a bitfield of hsa_amd_memory_pool_global_flag_t values.
2061 Reports the effective global flags bitmask for the allocation. This field is not
2062 meaningful if the type of the allocation is HSA_EXT_POINTER_TYPE_UNKNOWN.
2063 */
2066
2102hsa_status_t HSA_API hsa_amd_pointer_info(const void* ptr,
2104 void* (*alloc)(size_t),
2105 uint32_t* num_agents_accessible,
2106 hsa_agent_t** accessible);
2107
2126hsa_status_t HSA_API hsa_amd_pointer_info_set_userdata(const void* ptr,
2127 void* userdata);
2128
2133typedef struct hsa_amd_ipc_memory_s {
2134 uint32_t handle[8];
2136
2167hsa_status_t HSA_API hsa_amd_ipc_memory_create(void* ptr, size_t len,
2168 hsa_amd_ipc_memory_t* handle);
2169
2201hsa_status_t HSA_API hsa_amd_ipc_memory_attach(
2202 const hsa_amd_ipc_memory_t* handle, size_t len,
2203 uint32_t num_agents,
2204 const hsa_agent_t* mapping_agents,
2205 void** mapped_ptr);
2206
2222hsa_status_t HSA_API hsa_amd_ipc_memory_detach(void* mapped_ptr);
2223
2228
2253hsa_status_t HSA_API hsa_amd_ipc_signal_create(hsa_signal_t signal, hsa_amd_ipc_signal_t* handle);
2254
2275hsa_status_t HSA_API hsa_amd_ipc_signal_attach(const hsa_amd_ipc_signal_t* handle,
2276 hsa_signal_t* signal);
2277
2281typedef enum hsa_amd_event_type_s {
2282 /*
2283 AMD GPU memory fault.
2284 */
2286 /*
2287 AMD GPU HW Exception.
2288 */
2291
2295typedef enum {
2296 // Page not present or supervisor privilege.
2298 // Write access to a read-only page.
2300 // Execute access to a page marked NX.
2302 // GPU attempted access to a host only page.
2304 // DRAM ECC failure.
2306 // Can't determine the exact fault address.
2308 // SRAM ECC failure (ie registers, no fault address).
2310 // GPU reset following unspecified hang.
2311 HSA_AMD_MEMORY_FAULT_HANG = 1U << 31
2313
2317typedef struct hsa_amd_gpu_memory_fault_info_s {
2318 /*
2319 The agent where the memory fault occurred.
2320 */
2321 hsa_agent_t agent;
2322 /*
2323 Virtual address accessed.
2324 */
2326 /*
2327 Bit field encoding the memory access failure reasons. There could be multiple bits set
2328 for one fault. Bits are defined in hsa_amd_memory_fault_reason_t.
2329 */
2332
2336typedef enum {
2337 // Unused for now
2340
2344typedef enum {
2345 // GPU Hang
2347 // SRAM ECC
2350
2354typedef struct hsa_amd_gpu_hw_exception_info_s {
2355 /*
2356 The agent where the HW exception occurred.
2357 */
2358 hsa_agent_t agent;
2362
2366typedef struct hsa_amd_event_s {
2367 /*
2368 The event type.
2369 */
2371 union {
2372 /*
2373 The memory fault info, only valid when @p event_type is HSA_AMD_GPU_MEMORY_FAULT_EVENT.
2374 */
2376 /*
2377 The memory fault info, only valid when @p event_type is HSA_AMD_GPU_HW_EXCEPTION_EVENT.
2378 */
2380 };
2382
2383typedef hsa_status_t (*hsa_amd_system_event_callback_t)(const hsa_amd_event_t* event, void* data);
2384
2401 void* data);
2402
2406typedef enum hsa_amd_queue_priority_s {
2407 /*
2408 Below normal/high priority compute and all graphics
2409 */
2411 /*
2412 Above low priority compute, below high priority compute and all graphics
2413 */
2415 /*
2416 Above low/normal priority compute and all graphics
2417 */
2420
2437hsa_status_t HSA_API hsa_amd_queue_set_priority(hsa_queue_t* queue,
2438 hsa_amd_queue_priority_t priority);
2439
2443typedef void (*hsa_amd_deallocation_callback_t)(void* ptr, void* user_data);
2444
2477hsa_status_t HSA_API hsa_amd_register_deallocation_callback(void* ptr,
2479 void* user_data);
2480
2497hsa_status_t HSA_API hsa_amd_deregister_deallocation_callback(void* ptr,
2499
2522
2523typedef enum hsa_amd_svm_attribute_s {
2524 // Memory model attribute.
2525 // Type of this attribute is hsa_amd_svm_model_t.
2527 // Marks the range read only. This allows multiple physical copies to be
2528 // placed local to each accessing device.
2529 // Type of this attribute is bool.
2531 // Automatic migrations should attempt to keep the memory within the xgmi hive
2532 // containing accessible agents.
2533 // Type of this attribute is bool.
2535 // Page granularity to migrate at once. Page granularity is specified as
2536 // log2(page_count).
2537 // Type of this attribute is uint64_t.
2539 // Physical location to prefer when automatic migration occurs.
2540 // Set to the null agent handle (handle == 0) to indicate there
2541 // is no preferred location.
2542 // Type of this attribute is hsa_agent_t.
2544 // This attribute can not be used in ::hsa_amd_svm_attributes_set (see
2545 // ::hsa_amd_svm_prefetch_async).
2546 // Queries the physical location of most recent prefetch command.
2547 // If the prefetch location has not been set or is not uniform across the
2548 // address range then returned hsa_agent_t::handle will be 0.
2549 // Querying this attribute will return the destination agent of the most
2550 // recent ::hsa_amd_svm_prefetch_async targeting the address range. If
2551 // multiple async prefetches have been issued targeting the region and the
2552 // most recently issued prefetch has completed then the query will return
2553 // the location of the most recently completed prefetch.
2554 // Type of this attribute is hsa_agent_t.
2556 // Optimizes with the anticipation that the majority of operations to the
2557 // range will be read operations.
2558 // Type of this attribute is bool.
2560 // Allows the execution on GPU.
2561 // Type of this attribute is bool.
2563 // This attribute can not be used in ::hsa_amd_svm_attributes_get.
2564 // Enables an agent for access to the range. Access may incur a page fault
2565 // and associated memory migration. Either this or
2566 // HSA_AMD_SVM_ATTRIB_AGENT_ACCESSIBLE_IN_PLACE is required prior to SVM
2567 // access if HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT is false.
2568 // Type of this attribute is hsa_agent_t.
2570 // This attribute can not be used in ::hsa_amd_svm_attributes_get.
2571 // Enables an agent for access to the range without page faults. Access
2572 // will not incur a page fault and will not cause access based migration.
2573 // and associated memory migration. Either this or
2574 // HSA_AMD_SVM_ATTRIB_AGENT_ACCESSIBLE is required prior to SVM access if
2575 // HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT is false.
2576 // Type of this attribute is hsa_agent_t.
2578 // This attribute can not be used in ::hsa_amd_svm_attributes_get.
2579 // Denies an agent access to the memory range. Access will cause a terminal
2580 // segfault.
2581 // Type of this attribute is hsa_agent_t.
2583 // This attribute can not be used in ::hsa_amd_svm_attributes_set.
2584 // Returns the access attribute associated with the agent.
2585 // The agent to query must be set in the attribute value field.
2586 // The attribute enum will be replaced with the agent's current access
2587 // attribute for the address range.
2588 // TODO: Clarify KFD return value for non-uniform access attribute.
2589 // Type of this attribute is hsa_agent_t.
2592
2593// List type for hsa_amd_svm_attributes_set/get.
2594typedef struct hsa_amd_svm_attribute_pair_s {
2595 // hsa_amd_svm_attribute_t value.
2596 uint64_t attribute;
2597 // Attribute value. Bit values should be interpreted according to the type
2598 // given in the associated attribute description.
2599 uint64_t value;
2601
2621hsa_status_t hsa_amd_svm_attributes_set(void* ptr, size_t size,
2622 hsa_amd_svm_attribute_pair_t* attribute_list,
2623 size_t attribute_count);
2624
2643hsa_status_t hsa_amd_svm_attributes_get(void* ptr, size_t size,
2644 hsa_amd_svm_attribute_pair_t* attribute_list,
2645 size_t attribute_count);
2646
2671hsa_status_t hsa_amd_svm_prefetch_async(void* ptr, size_t size, hsa_agent_t agent,
2672 uint32_t num_dep_signals, const hsa_signal_t* dep_signals,
2673 hsa_signal_t completion_signal);
2674
2683hsa_status_t hsa_amd_spm_acquire(hsa_agent_t preferred_agent);
2684
2694hsa_status_t hsa_amd_spm_release(hsa_agent_t preferred_agent);
2695
2724hsa_status_t hsa_amd_spm_set_dest_buffer(hsa_agent_t preferred_agent, size_t size_in_bytes,
2725 uint32_t* timeout, uint32_t* size_copied, void* dest,
2726 bool* is_data_loss);
2772hsa_status_t hsa_amd_portable_export_dmabuf(const void* ptr, size_t size, int* dmabuf,
2773 uint64_t* offset);
2774
2796hsa_status_t hsa_amd_portable_close_dmabuf(int dmabuf);
2797
2822hsa_status_t hsa_amd_vmem_address_reserve(void** va, size_t size, uint64_t address,
2823 uint64_t flags);
2824
2849hsa_status_t hsa_amd_vmem_address_reserve(void** va, size_t size, uint64_t address,
2850 uint64_t flags);
2851
2874hsa_status_t hsa_amd_vmem_address_reserve_align(void** va, size_t size, uint64_t address,
2875 uint64_t alignment, uint64_t flags);
2876
2893hsa_status_t hsa_amd_vmem_address_free(void* va, size_t size);
2894
2898typedef struct hsa_amd_vmem_alloc_handle_s {
2903 uint64_t handle;
2905
2910
2937 hsa_amd_memory_type_t type, uint64_t flags,
2938 hsa_amd_vmem_alloc_handle_t* memory_handle);
2939
2950
2974hsa_status_t hsa_amd_vmem_map(void* va, size_t size, size_t in_offset,
2975 hsa_amd_vmem_alloc_handle_t memory_handle, uint64_t flags);
2976
2993hsa_status_t hsa_amd_vmem_unmap(void* va, size_t size);
2994
2995typedef struct hsa_amd_memory_access_desc_s {
2996 hsa_access_permission_t permissions;
2997 hsa_agent_t agent_handle;
2999
3025hsa_status_t hsa_amd_vmem_set_access(void* va, size_t size,
3026 const hsa_amd_memory_access_desc_t* desc,
3027 size_t desc_cnt);
3028
3047hsa_status_t hsa_amd_vmem_get_access(void* va, hsa_access_permission_t* perms,
3048 hsa_agent_t agent_handle);
3049
3070hsa_status_t hsa_amd_vmem_export_shareable_handle(int* dmabuf_fd,
3072 uint64_t flags);
3090hsa_status_t hsa_amd_vmem_import_shareable_handle(int dmabuf_fd,
3092
3108 void* addr);
3109
3125 hsa_amd_memory_type_t* type);
3126
3152hsa_status_t HSA_API hsa_amd_agent_set_async_scratch_limit(hsa_agent_t agent, size_t threshold);
3153
3154typedef enum {
3155 /*
3156 * Returns the agent that owns the underlying HW queue.
3157 * The type of this attribute is hsa_agent_t.
3158 */
3160 /*
3161 * Returns the doorbell ID of the completion signal of the queue
3162 * The type of this attribute is uint64_t.
3163 */
3166
3167hsa_status_t hsa_amd_queue_get_info(hsa_queue_t* queue, hsa_queue_info_attribute_t attribute,
3168 void* value);
3169
3170#ifdef __cplusplus
3171} // end extern "C" block
3172#endif
3173
3174#endif // header guard
uint8_t hsa_amd_packet_type8_t
A fixed-size type used to represent hsa_amd_packet_type_t constants.
Definition hsa_ext_amd.h:103
unsigned int subBit
Definition hsa_ext_amd.h:79
hsa_amd_packet_type_t
AMD vendor specific packet type.
Definition hsa_ext_amd.h:91
static __inline__ uint32_t bit
Definition hsa_ext_amd.h:77
uint32_t hsa_signal_condition32_t
A fixed-size type used to represent ::hsa_signal_condition_t constants.
Definition hsa_ext_amd.h:86
@ HSA_AMD_PACKET_TYPE_BARRIER_VALUE
Definition hsa_ext_amd.h:97
hsa_status_t HSA_API hsa_amd_memory_migrate(const void *ptr, hsa_amd_memory_pool_t memory_pool, uint32_t flags)
Relocate a buffer to a new memory pool.
hsa_amd_iommu_version_t
IOMMU version supported.
Definition hsa_ext_amd.h:237
@ HSA_IOMMU_SUPPORT_NONE
Definition hsa_ext_amd.h:241
@ HSA_IOMMU_SUPPORT_V2
Definition hsa_ext_amd.h:246
hsa_status_t HSA_API hsa_amd_register_system_event_handler(hsa_amd_system_event_callback_t callback, void *data)
Register AMD GPU event handler.
hsa_status_t HSA_API hsa_amd_agent_memory_pool_get_info(hsa_agent_t agent, hsa_amd_memory_pool_t memory_pool, hsa_amd_agent_memory_pool_info_t attribute, void *value)
Get the current value of an attribute of the relationship between an agent and a memory pool.
hsa_status_t HSA_API hsa_amd_register_deallocation_callback(void *ptr, hsa_amd_deallocation_callback_t callback, void *user_data)
Registers a deallocation notifier monitoring for release of agent accessible address ptr....
hsa_status_t hsa_amd_vmem_retain_alloc_handle(hsa_amd_vmem_alloc_handle_t *memory_handle, void *addr)
Returns memory handle for mapped memory.
hsa_status_t HSA_API hsa_amd_queue_set_priority(hsa_queue_t *queue, hsa_amd_queue_priority_t priority)
Modifies the dispatch and wavefront scheduling prioirty for a given compute queue....
hsa_status_t HSA_API hsa_amd_ipc_memory_attach(const hsa_amd_ipc_memory_t *handle, size_t len, uint32_t num_agents, const hsa_agent_t *mapping_agents, void **mapped_ptr)
Imports shared memory into the local process and makes it accessible by the given agents....
hsa_status_t HSA_API hsa_amd_interop_map_buffer(uint32_t num_agents, hsa_agent_t *agents, int interop_handle, uint32_t flags, size_t *size, void **ptr, size_t *metadata_size, const void **metadata)
Maps an interop object into the HSA flat address space and establishes memory residency....
hsa_status_t HSA_API hsa_amd_memory_async_copy(void *dst, hsa_agent_t dst_agent, const void *src, hsa_agent_t src_agent, size_t size, uint32_t num_dep_signals, const hsa_signal_t *dep_signals, hsa_signal_t completion_signal)
Asynchronously copy a block of memory from the location pointed to by src on the src_agent to the mem...
hsa_status_t hsa_amd_spm_acquire(hsa_agent_t preferred_agent)
Acquire Stream Performance Monitor on an agent.
hsa_amd_svm_model_t
Definition hsa_ext_amd.h:2500
@ HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED
Definition hsa_ext_amd.h:2510
@ HSA_AMD_SVM_GLOBAL_FLAG_FINE_GRAINED
Definition hsa_ext_amd.h:2505
@ HSA_AMD_SVM_GLOBAL_FLAG_INDETERMINATE
Definition hsa_ext_amd.h:2520
hsa_status_t HSA_API hsa_amd_image_get_info_max_dim(hsa_agent_t agent, hsa_agent_info_t attribute, void *value)
Query image limits.
hsa_amd_memory_type_t
Definition hsa_ext_amd.h:2906
@ MEMORY_TYPE_PINNED
Definition hsa_ext_amd.h:2908
@ MEMORY_TYPE_NONE
Definition hsa_ext_amd.h:2907
hsa_status_t HSA_API hsa_amd_signal_create(hsa_signal_value_t initial_value, uint32_t num_consumers, const hsa_agent_t *consumers, uint64_t attributes, hsa_signal_t *signal)
Create a signal with specific attributes.
hsa_amd_region_info_t
Region attributes.
Definition hsa_ext_amd.h:479
@ HSA_AMD_REGION_INFO_BUS_WIDTH
Definition hsa_ext_amd.h:493
@ HSA_AMD_REGION_INFO_HOST_ACCESSIBLE
Definition hsa_ext_amd.h:484
@ HSA_AMD_REGION_INFO_MAX_CLOCK_FREQUENCY
Definition hsa_ext_amd.h:498
@ HSA_AMD_REGION_INFO_BASE
Definition hsa_ext_amd.h:488
hsa_status_t hsa_amd_vmem_get_access(void *va, hsa_access_permission_t *perms, hsa_agent_t agent_handle)
Get current access permissions for memory mapping.
hsa_status_t HSA_API hsa_amd_agent_set_async_scratch_limit(hsa_agent_t agent, size_t threshold)
Set the asynchronous scratch limit threshold on all the queues for this agent. Dispatches that are en...
hsa_status_t HSA_API hsa_amd_queue_cu_set_mask(const hsa_queue_t *queue, uint32_t num_cu_mask_count, const uint32_t *cu_mask)
Set a queue's CU affinity mask.
hsa_status_t hsa_amd_vmem_map(void *va, size_t size, size_t in_offset, hsa_amd_vmem_alloc_handle_t memory_handle, uint64_t flags)
Map a virtual memory handle.
hsa_amd_ipc_memory_t hsa_amd_ipc_signal_t
256-bit process independent identifier for a ROCr IPC signal.
Definition hsa_ext_amd.h:2227
@ HSA_STATUS_ERROR_INVALID_MEMORY_POOL
Definition hsa_ext_amd.h:197
@ HSA_STATUS_CU_MASK_REDUCED
Definition hsa_ext_amd.h:221
@ HSA_STATUS_ERROR_ILLEGAL_INSTRUCTION
Definition hsa_ext_amd.h:207
@ HSA_STATUS_ERROR_RESOURCE_BUSY
Definition hsa_ext_amd.h:231
@ HSA_STATUS_ERROR_MEMORY_FAULT
Definition hsa_ext_amd.h:214
@ HSA_STATUS_ERROR_OUT_OF_REGISTERS
Definition hsa_ext_amd.h:226
@ HSA_STATUS_ERROR_MEMORY_APERTURE_VIOLATION
Definition hsa_ext_amd.h:202
hsa_status_t hsa_amd_vmem_handle_create(hsa_amd_memory_pool_t pool, size_t size, hsa_amd_memory_type_t type, uint64_t flags, hsa_amd_vmem_alloc_handle_t *memory_handle)
Create a virtual memory handle.
hsa_status_t hsa_amd_svm_attributes_get(void *ptr, size_t size, hsa_amd_svm_attribute_pair_t *attribute_list, size_t attribute_count)
Gets SVM memory attributes.
hsa_status_t HSA_API hsa_amd_memory_unlock(void *host_ptr)
Unpin the host pointer previously pinned via hsa_amd_memory_lock or hsa_amd_memory_lock_to_pool.
hsa_amd_memory_fault_reason_t
Flags denoting the cause of a memory fault.
Definition hsa_ext_amd.h:2295
@ HSA_AMD_MEMORY_FAULT_DRAMECC
Definition hsa_ext_amd.h:2305
@ HSA_AMD_MEMORY_FAULT_HANG
Definition hsa_ext_amd.h:2311
@ HSA_AMD_MEMORY_FAULT_PAGE_NOT_PRESENT
Definition hsa_ext_amd.h:2297
@ HSA_AMD_MEMORY_FAULT_SRAMECC
Definition hsa_ext_amd.h:2309
@ HSA_AMD_MEMORY_FAULT_NX
Definition hsa_ext_amd.h:2301
@ HSA_AMD_MEMORY_FAULT_IMPRECISE
Definition hsa_ext_amd.h:2307
@ HSA_AMD_MEMORY_FAULT_HOST_ONLY
Definition hsa_ext_amd.h:2303
@ HSA_AMD_MEMORY_FAULT_READ_ONLY
Definition hsa_ext_amd.h:2299
hsa_status_t HSA_API hsa_amd_memory_lock_to_pool(void *host_ptr, size_t size, hsa_agent_t *agents, int num_agent, hsa_amd_memory_pool_t pool, uint32_t flags, void **agent_ptr)
Pin a host pointer allocated by C/C++ or OS allocator (i.e. ordinary system DRAM) and return a new po...
hsa_status_t hsa_amd_spm_release(hsa_agent_t preferred_agent)
Release Stream Performance Monitor on an agent.
hsa_status_t HSA_API hsa_amd_queue_cu_get_mask(const hsa_queue_t *queue, uint32_t num_cu_mask_count, uint32_t *cu_mask)
Retrieve a queue's CU affinity mask.
hsa_status_t HSA_API hsa_amd_pointer_info(const void *ptr, hsa_amd_pointer_info_t *info, void *(*alloc)(size_t), uint32_t *num_agents_accessible, hsa_agent_t **accessible)
Retrieves information about the allocation referenced by the given pointer. Optionally returns the nu...
hsa_status_t HSA_API hsa_amd_pointer_info_set_userdata(const void *ptr, void *userdata)
Associates an arbitrary pointer with an allocation known to ROCr. The pointer can be fetched by hsa_a...
hsa_status_t hsa_amd_spm_set_dest_buffer(hsa_agent_t preferred_agent, size_t size_in_bytes, uint32_t *timeout, uint32_t *size_copied, void *dest, bool *is_data_loss)
Set up the current destination user mode buffer for stream performance counter data....
hsa_status_t HSA_API hsa_amd_deregister_deallocation_callback(void *ptr, hsa_amd_deallocation_callback_t callback)
Removes a deallocation notifier previously registered with hsa_amd_register_deallocation_callback....
hsa_status_t hsa_amd_vmem_set_access(void *va, size_t size, const hsa_amd_memory_access_desc_t *desc, size_t desc_cnt)
Make a memory mapping accessible.
hsa_status_t HSA_API hsa_amd_memory_pool_allocate(hsa_amd_memory_pool_t memory_pool, size_t size, uint32_t flags, void **ptr)
Allocate a block of memory (or buffer) in the specified pool.
hsa_status_t HSA_API hsa_amd_coherency_set_type(hsa_agent_t agent, hsa_amd_coherency_type_t type)
Set the coherency type of the fine grain region of an agent. Deprecated. This is supported on KV plat...
hsa_status_t hsa_amd_vmem_import_shareable_handle(int dmabuf_fd, hsa_amd_vmem_alloc_handle_t *handle)
Import a shareable handle.
hsa_amd_signal_attribute_t
Signal attribute flags.
Definition hsa_ext_amd.h:716
@ HSA_AMD_SIGNAL_AMD_GPU_ONLY
Definition hsa_ext_amd.h:721
@ HSA_AMD_SIGNAL_IPC
Definition hsa_ext_amd.h:729
hsa_status_t HSA_API hsa_amd_signal_async_handler(hsa_signal_t signal, hsa_signal_condition_t cond, hsa_signal_value_t value, hsa_amd_signal_handler handler, void *arg)
Register asynchronous signal handler function.
hsa_status_t hsa_amd_vmem_address_free(void *va, size_t size)
Free a reserved address range.
hsa_status_t hsa_amd_vmem_address_reserve_align(void **va, size_t size, uint64_t address, uint64_t alignment, uint64_t flags)
Allocate a reserved address range.
hsa_status_t HSA_API hsa_amd_agent_iterate_memory_pools(hsa_agent_t agent, hsa_status_t(*callback)(hsa_amd_memory_pool_t memory_pool, void *data), void *data)
Iterate over the memory pools associated with a given agent, and invoke an application-defined callba...
hsa_amd_svm_attribute_t
Definition hsa_ext_amd.h:2523
@ HSA_AMD_SVM_ATTRIB_READ_ONLY
Definition hsa_ext_amd.h:2530
@ HSA_AMD_SVM_ATTRIB_AGENT_ACCESSIBLE
Definition hsa_ext_amd.h:2569
@ HSA_AMD_SVM_ATTRIB_AGENT_NO_ACCESS
Definition hsa_ext_amd.h:2582
@ HSA_AMD_SVM_ATTRIB_PREFETCH_LOCATION
Definition hsa_ext_amd.h:2555
@ HSA_AMD_SVM_ATTRIB_MIGRATION_GRANULARITY
Definition hsa_ext_amd.h:2538
@ HSA_AMD_SVM_ATTRIB_HIVE_LOCAL
Definition hsa_ext_amd.h:2534
@ HSA_AMD_SVM_ATTRIB_GPU_EXEC
Definition hsa_ext_amd.h:2562
@ HSA_AMD_SVM_ATTRIB_PREFERRED_LOCATION
Definition hsa_ext_amd.h:2543
@ HSA_AMD_SVM_ATTRIB_READ_MOSTLY
Definition hsa_ext_amd.h:2559
@ HSA_AMD_SVM_ATTRIB_AGENT_ACCESSIBLE_IN_PLACE
Definition hsa_ext_amd.h:2577
@ HSA_AMD_SVM_ATTRIB_ACCESS_QUERY
Definition hsa_ext_amd.h:2590
@ HSA_AMD_SVM_ATTRIB_GLOBAL_FLAG
Definition hsa_ext_amd.h:2526
hsa_status_t HSA_API hsa_amd_async_function(void(*callback)(void *arg), void *arg)
Call a function asynchronously.
uint32_t HSA_API hsa_amd_signal_wait_any(uint32_t signal_count, hsa_signal_t *signals, hsa_signal_condition_t *conds, hsa_signal_value_t *values, uint64_t timeout_hint, hsa_wait_state_t wait_hint, hsa_signal_value_t *satisfying_value)
Wait for any signal-condition pair to be satisfied.
hsa_amd_memory_pool_global_flag_t
Definition hsa_ext_amd.h:1059
@ HSA_AMD_MEMORY_POOL_GLOBAL_FLAG_EXTENDED_SCOPE_FINE_GRAINED
Definition hsa_ext_amd.h:1081
@ HSA_AMD_MEMORY_POOL_GLOBAL_FLAG_KERNARG_INIT
Definition hsa_ext_amd.h:1065
@ HSA_AMD_MEMORY_POOL_GLOBAL_FLAG_FINE_GRAINED
Definition hsa_ext_amd.h:1071
@ HSA_AMD_MEMORY_POOL_GLOBAL_FLAG_COARSE_GRAINED
Definition hsa_ext_amd.h:1075
hsa_amd_agent_info_t
Agent attributes.
Definition hsa_ext_amd.h:252
@ HSA_AMD_AGENT_INFO_MEMORY_PROPERTIES
Definition hsa_ext_amd.h:433
@ HSA_AMD_AGENT_INFO_NUM_XCC
Definition hsa_ext_amd.h:417
@ HSA_AMD_AGENT_INFO_COOPERATIVE_QUEUES
Definition hsa_ext_amd.h:336
@ HSA_AMD_AGENT_INFO_DRIVER_UID
Definition hsa_ext_amd.h:422
@ HSA_AMD_AGENT_INFO_MEMORY_MAX_FREQUENCY
Definition hsa_ext_amd.h:294
@ HSA_AMD_AGENT_INFO_MEMORY_WIDTH
Definition hsa_ext_amd.h:290
@ HSA_AMD_AGENT_INFO_ASIC_FAMILY_ID
Definition hsa_ext_amd.h:384
@ HSA_AMD_AGENT_INFO_IOMMU_SUPPORT
Definition hsa_ext_amd.h:412
@ HSA_AMD_AGENT_INFO_MEMORY_AVAIL
Definition hsa_ext_amd.h:373
@ HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY
Definition hsa_ext_amd.h:379
@ HSA_AMD_AGENT_INFO_ASIC_REVISION
Definition hsa_ext_amd.h:354
@ HSA_AMD_AGENT_INFO_AQL_EXTENSIONS
Definition hsa_ext_amd.h:439
@ HSA_AMD_AGENT_INFO_COMPUTE_UNIT_COUNT
Definition hsa_ext_amd.h:265
@ HSA_AMD_AGENT_INFO_NUM_SIMDS_PER_CU
Definition hsa_ext_amd.h:309
@ HSA_AMD_AGENT_INFO_SDMA_UCODE_VERSION
Definition hsa_ext_amd.h:394
@ HSA_AMD_AGENT_INFO_UUID
Definition hsa_ext_amd.h:346
@ HSA_AMD_AGENT_INFO_SVM_DIRECT_HOST_ACCESS
Definition hsa_ext_amd.h:360
@ HSA_AMD_AGENT_INFO_MAX_WAVES_PER_CU
Definition hsa_ext_amd.h:304
@ HSA_AMD_AGENT_INFO_COOPERATIVE_COMPUTE_UNIT_COUNT
Definition hsa_ext_amd.h:367
@ HSA_AMD_AGENT_INFO_NUM_SDMA_ENG
Definition hsa_ext_amd.h:402
@ HSA_AMD_AGENT_INFO_NEAREST_CPU
Definition hsa_ext_amd.h:427
@ HSA_AMD_AGENT_INFO_BDFID
Definition hsa_ext_amd.h:285
@ HSA_AMD_AGENT_INFO_CHIP_ID
Definition hsa_ext_amd.h:256
@ HSA_AMD_AGENT_INFO_NUM_SHADER_ENGINES
Definition hsa_ext_amd.h:314
@ HSA_AMD_AGENT_INFO_DRIVER_NODE_ID
Definition hsa_ext_amd.h:274
@ HSA_AMD_AGENT_INFO_HDP_FLUSH
Definition hsa_ext_amd.h:325
@ HSA_AMD_AGENT_INFO_DOMAIN
Definition hsa_ext_amd.h:331
@ HSA_AMD_AGENT_INFO_NUM_SDMA_XGMI_ENG
Definition hsa_ext_amd.h:407
@ HSA_AMD_AGENT_INFO_MAX_ADDRESS_WATCH_POINTS
Definition hsa_ext_amd.h:280
@ HSA_AMD_AGENT_INFO_MAX_CLOCK_FREQUENCY
Definition hsa_ext_amd.h:270
@ HSA_AMD_AGENT_INFO_PRODUCT_NAME
Definition hsa_ext_amd.h:299
@ HSA_AMD_AGENT_INFO_CACHELINE_SIZE
Definition hsa_ext_amd.h:260
@ HSA_AMD_AGENT_INFO_NUM_SHADER_ARRAYS_PER_SE
Definition hsa_ext_amd.h:319
@ HSA_AMD_AGENT_INFO_UCODE_VERSION
Definition hsa_ext_amd.h:389
hsa_status_t HSA_API hsa_amd_profiling_set_profiler_enabled(hsa_queue_t *queue, int enable)
Enable or disable profiling capability of a queue.
hsa_status_t HSA_API hsa_amd_profiling_async_copy_enable(bool enable)
Enable or disable asynchronous memory copy profiling.
hsa_status_t HSA_API hsa_amd_image_create(hsa_agent_t agent, const hsa_ext_image_descriptor_t *image_descriptor, const hsa_amd_image_descriptor_t *image_layout, const void *image_data, hsa_access_permission_t access_permission, hsa_ext_image_t *image)
Creates an image from an opaque vendor specific image format. Does not modify data at image_data....
hsa_amd_memory_pool_info_t
Memory pool features.
Definition hsa_ext_amd.h:1099
@ HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALIGNMENT
Definition hsa_ext_amd.h:1145
@ HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_GRANULE
Definition hsa_ext_amd.h:1138
@ HSA_AMD_MEMORY_POOL_INFO_SEGMENT
Definition hsa_ext_amd.h:1104
@ HSA_AMD_MEMORY_POOL_INFO_SIZE
Definition hsa_ext_amd.h:1117
@ HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE
Definition hsa_ext_amd.h:1170
@ HSA_AMD_MEMORY_POOL_INFO_GLOBAL_FLAGS
Definition hsa_ext_amd.h:1113
@ HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED
Definition hsa_ext_amd.h:1125
@ HSA_AMD_MEMORY_POOL_INFO_ALLOC_MAX_SIZE
Definition hsa_ext_amd.h:1157
@ HSA_AMD_MEMORY_POOL_INFO_LOCATION
Definition hsa_ext_amd.h:1162
@ HSA_AMD_MEMORY_POOL_INFO_ACCESSIBLE_BY_ALL
Definition hsa_ext_amd.h:1152
hsa_status_t HSA_API hsa_amd_ipc_signal_create(hsa_signal_t signal, hsa_amd_ipc_signal_t *handle)
Obtains an interprocess sharing handle for a signal. The handle is valid while the signal it referenc...
hsa_status_t HSA_API hsa_amd_memory_async_copy_rect(const hsa_pitched_ptr_t *dst, const hsa_dim3_t *dst_offset, const hsa_pitched_ptr_t *src, const hsa_dim3_t *src_offset, const hsa_dim3_t *range, hsa_agent_t copy_agent, hsa_amd_copy_direction_t dir, uint32_t num_dep_signals, const hsa_signal_t *dep_signals, hsa_signal_t completion_signal)
hsa_amd_coherency_type_t
Coherency attributes of fine grain region.
Definition hsa_ext_amd.h:504
@ HSA_AMD_COHERENCY_TYPE_NONCOHERENT
Definition hsa_ext_amd.h:512
@ HSA_AMD_COHERENCY_TYPE_COHERENT
Definition hsa_ext_amd.h:508
hsa_status_t HSA_API hsa_amd_memory_pool_can_migrate(hsa_amd_memory_pool_t src_memory_pool, hsa_amd_memory_pool_t dst_memory_pool, bool *result)
Query if buffers currently located in some memory pool can be relocated to a destination memory pool.
hsa_queue_info_attribute_t
Definition hsa_ext_amd.h:3154
@ HSA_AMD_QUEUE_INFO_AGENT
Definition hsa_ext_amd.h:3159
@ HSA_AMD_QUEUE_INFO_DOORBELL_ID
Definition hsa_ext_amd.h:3164
hsa_status_t HSA_API hsa_amd_interop_unmap_buffer(void *ptr)
Removes a previously mapped interop object from HSA's flat address space. Ends lifetime for the mappi...
hsa_amd_memory_pool_access_t
Type of accesses to a memory pool from a given agent.
Definition hsa_ext_amd.h:1467
@ HSA_AMD_MEMORY_POOL_ACCESS_DISALLOWED_BY_DEFAULT
Definition hsa_ext_amd.h:1482
@ HSA_AMD_MEMORY_POOL_ACCESS_ALLOWED_BY_DEFAULT
Definition hsa_ext_amd.h:1476
@ HSA_AMD_MEMORY_POOL_ACCESS_NEVER_ALLOWED
Definition hsa_ext_amd.h:1471
hsa_status_t HSA_API hsa_amd_memory_pool_get_info(hsa_amd_memory_pool_t memory_pool, hsa_amd_memory_pool_info_t attribute, void *value)
Get the current value of an attribute of a memory pool.
hsa_status_t hsa_amd_portable_export_dmabuf(const void *ptr, size_t size, int *dmabuf, uint64_t *offset)
Obtains an OS specific, vendor neutral, handle to a memory allocation.
hsa_status_t HSA_API hsa_amd_ipc_memory_detach(void *mapped_ptr)
Decrements the reference count for the shared memory mapping and releases access to shared memory imp...
hsa_status_t hsa_amd_vmem_export_shareable_handle(int *dmabuf_fd, hsa_amd_vmem_alloc_handle_t handle, uint64_t flags)
Get an exportable shareable handle.
hsa_status_t hsa_amd_vmem_get_alloc_properties_from_handle(hsa_amd_vmem_alloc_handle_t memory_handle, hsa_amd_memory_pool_t *pool, hsa_amd_memory_type_t *type)
Returns the current allocation properties of a handle.
hsa_amd_hw_exception_reset_type_t
Flags denoting the type of a HW exception.
Definition hsa_ext_amd.h:2336
@ HSA_AMD_HW_EXCEPTION_RESET_TYPE_OTHER
Definition hsa_ext_amd.h:2338
hsa_amd_segment_t
Memory segments associated with a memory pool.
Definition hsa_ext_amd.h:1010
@ HSA_AMD_SEGMENT_GROUP
Definition hsa_ext_amd.h:1028
@ HSA_AMD_SEGMENT_GLOBAL
Definition hsa_ext_amd.h:1014
@ HSA_AMD_SEGMENT_READONLY
Definition hsa_ext_amd.h:1019
@ HSA_AMD_SEGMENT_PRIVATE
Definition hsa_ext_amd.h:1023
hsa_status_t hsa_amd_vmem_address_reserve(void **va, size_t size, uint64_t address, uint64_t flags)
Allocate a reserved address range.
hsa_amd_sdma_engine_id_t
SDMA engine IDs unique by single set bit position.
Definition hsa_ext_amd.h:452
@ HSA_AMD_SDMA_ENGINE_13
Definition hsa_ext_amd.h:466
@ HSA_AMD_SDMA_ENGINE_9
Definition hsa_ext_amd.h:462
@ HSA_AMD_SDMA_ENGINE_2
Definition hsa_ext_amd.h:455
@ HSA_AMD_SDMA_ENGINE_6
Definition hsa_ext_amd.h:459
@ HSA_AMD_SDMA_ENGINE_4
Definition hsa_ext_amd.h:457
@ HSA_AMD_SDMA_ENGINE_7
Definition hsa_ext_amd.h:460
@ HSA_AMD_SDMA_ENGINE_11
Definition hsa_ext_amd.h:464
@ HSA_AMD_SDMA_ENGINE_8
Definition hsa_ext_amd.h:461
@ HSA_AMD_SDMA_ENGINE_12
Definition hsa_ext_amd.h:465
@ HSA_AMD_SDMA_ENGINE_10
Definition hsa_ext_amd.h:463
@ HSA_AMD_SDMA_ENGINE_1
Definition hsa_ext_amd.h:454
@ HSA_AMD_SDMA_ENGINE_0
Definition hsa_ext_amd.h:453
@ HSA_AMD_SDMA_ENGINE_5
Definition hsa_ext_amd.h:458
@ HSA_AMD_SDMA_ENGINE_3
Definition hsa_ext_amd.h:456
@ HSA_AMD_SDMA_ENGINE_14
Definition hsa_ext_amd.h:467
@ HSA_AMD_SDMA_ENGINE_15
Definition hsa_ext_amd.h:468
hsa_status_t HSA_API hsa_amd_profiling_get_async_copy_time(hsa_signal_t signal, hsa_amd_profiling_async_copy_time_t *time)
Retrieve asynchronous copy timestamps.
hsa_status_t HSA_API hsa_amd_agents_allow_access(uint32_t num_agents, const hsa_agent_t *agents, const uint32_t *flags, const void *ptr)
Enable direct access to a buffer from a given set of agents.
hsa_status_t hsa_amd_vmem_unmap(void *va, size_t size)
Unmap a virtual memory handle.
hsa_status_t HSA_API hsa_amd_memory_copy_engine_status(hsa_agent_t dst_agent, hsa_agent_t src_agent, uint32_t *engine_ids_mask)
Reports the availability of SDMA copy engines.
hsa_amd_memory_pool_flag_t
Memory pool flag used to specify allocation directives.
Definition hsa_ext_amd.h:1177
@ HSA_AMD_MEMORY_POOL_PCIE_FLAG
Definition hsa_ext_amd.h:1187
@ HSA_AMD_MEMORY_POOL_STANDARD_FLAG
Definition hsa_ext_amd.h:1181
@ HSA_AMD_MEMORY_POOL_CONTIGUOUS_FLAG
Definition hsa_ext_amd.h:1191
void(* hsa_amd_deallocation_callback_t)(void *ptr, void *user_data)
Deallocation notifier function type.
Definition hsa_ext_amd.h:2443
hsa_status_t hsa_amd_queue_get_info(hsa_queue_t *queue, hsa_queue_info_attribute_t attribute, void *value)
hsa_status_t HSA_API hsa_amd_memory_async_copy_on_engine(void *dst, hsa_agent_t dst_agent, const void *src, hsa_agent_t src_agent, size_t size, uint32_t num_dep_signals, const hsa_signal_t *dep_signals, hsa_signal_t completion_signal, hsa_amd_sdma_engine_id_t engine_id, bool force_copy_on_sdma)
Asynchronously copy a block of memory from the location pointed to by src on the src_agent to the mem...
hsa_amd_agent_memory_properties_t
Agent memory properties attributes.
Definition hsa_ext_amd.h:445
@ HSA_AMD_MEMORY_PROPERTY_AGENT_IS_APU
Definition hsa_ext_amd.h:446
hsa_amd_pointer_type_t
Denotes the type of memory in a pointer info query.
Definition hsa_ext_amd.h:1986
@ HSA_EXT_POINTER_TYPE_IPC
Definition hsa_ext_amd.h:2010
@ HSA_EXT_POINTER_TYPE_HSA
Definition hsa_ext_amd.h:1994
@ HSA_EXT_POINTER_TYPE_LOCKED
Definition hsa_ext_amd.h:2002
@ HSA_EXT_POINTER_TYPE_UNKNOWN
Definition hsa_ext_amd.h:1990
@ HSA_EXT_POINTER_TYPE_GRAPHICS
Definition hsa_ext_amd.h:2006
hsa_amd_event_type_t
GPU system event type.
Definition hsa_ext_amd.h:2281
@ HSA_AMD_GPU_MEMORY_FAULT_EVENT
Definition hsa_ext_amd.h:2285
@ HSA_AMD_GPU_HW_EXCEPTION_EVENT
Definition hsa_ext_amd.h:2289
hsa_status_t HSA_API hsa_amd_memory_fill(void *ptr, uint32_t value, size_t count)
Sets the first count of uint32_t of the block of memory pointed by ptr to the specified value.
hsa_status_t HSA_API hsa_amd_profiling_get_dispatch_time(hsa_agent_t agent, hsa_signal_t signal, hsa_amd_profiling_dispatch_time_t *time)
Retrieve packet processing time stamps.
hsa_amd_agent_memory_pool_info_t
Properties of the relationship between an agent a memory pool.
Definition hsa_ext_amd.h:1570
@ HSA_AMD_AGENT_MEMORY_POOL_INFO_ACCESS
Definition hsa_ext_amd.h:1591
@ HSA_AMD_AGENT_MEMORY_POOL_INFO_LINK_INFO
Definition hsa_ext_amd.h:1608
@ HSA_AMD_AGENT_MEMORY_POOL_INFO_NUM_LINK_HOPS
Definition hsa_ext_amd.h:1600
hsa_status_t hsa_amd_portable_close_dmabuf(int dmabuf)
Closes an OS specific, vendor neutral, handle to a memory allocation.
hsa_amd_memory_pool_location_t
Definition hsa_ext_amd.h:1085
@ HSA_AMD_MEMORY_POOL_LOCATION_CPU
Definition hsa_ext_amd.h:1089
@ HSA_AMD_MEMORY_POOL_LOCATION_GPU
Definition hsa_ext_amd.h:1093
hsa_status_t hsa_amd_svm_attributes_set(void *ptr, size_t size, hsa_amd_svm_attribute_pair_t *attribute_list, size_t attribute_count)
Sets SVM memory attributes.
hsa_amd_queue_priority_t
Per-queue dispatch and wavefront scheduling priority.
Definition hsa_ext_amd.h:2406
@ HSA_AMD_QUEUE_PRIORITY_LOW
Definition hsa_ext_amd.h:2410
@ HSA_AMD_QUEUE_PRIORITY_HIGH
Definition hsa_ext_amd.h:2418
@ HSA_AMD_QUEUE_PRIORITY_NORMAL
Definition hsa_ext_amd.h:2414
bool(* hsa_amd_signal_handler)(hsa_signal_value_t value, void *arg)
Asyncronous signal handler function type.
Definition hsa_ext_amd.h:826
hsa_status_t HSA_API hsa_amd_memory_pool_free(void *ptr)
Deallocate a block of memory previously allocated using hsa_amd_memory_pool_allocate.
hsa_amd_copy_direction_t
Definition hsa_ext_amd.h:1442
@ hsaHostToHost
Definition hsa_ext_amd.h:1443
@ hsaDeviceToDevice
Definition hsa_ext_amd.h:1446
@ hsaHostToDevice
Definition hsa_ext_amd.h:1444
@ hsaDeviceToHost
Definition hsa_ext_amd.h:1445
hsa_status_t HSA_API hsa_amd_coherency_get_type(hsa_agent_t agent, hsa_amd_coherency_type_t *type)
Get the coherency type of the fine grain region of an agent.
hsa_amd_hw_exception_reset_cause_t
Flags denoting the cause of a HW exception.
Definition hsa_ext_amd.h:2344
@ HSA_AMD_HW_EXCEPTION_CAUSE_GPU_HANG
Definition hsa_ext_amd.h:2346
@ HSA_AMD_HW_EXCEPTION_CAUSE_ECC
Definition hsa_ext_amd.h:2348
hsa_status_t HSA_API hsa_amd_memory_lock(void *host_ptr, size_t size, hsa_agent_t *agents, int num_agent, void **agent_ptr)
Pin a host pointer allocated by C/C++ or OS allocator (i.e. ordinary system DRAM) and return a new po...
hsa_status_t hsa_amd_svm_prefetch_async(void *ptr, size_t size, hsa_agent_t agent, uint32_t num_dep_signals, const hsa_signal_t *dep_signals, hsa_signal_t completion_signal)
Asynchronously migrates memory to an agent.
hsa_status_t HSA_API hsa_amd_ipc_memory_create(void *ptr, size_t len, hsa_amd_ipc_memory_t *handle)
Prepares an allocation for interprocess sharing and creates a handle of type hsa_amd_ipc_memory_t uni...
hsa_status_t(* hsa_amd_system_event_callback_t)(const hsa_amd_event_t *event, void *data)
Definition hsa_ext_amd.h:2383
hsa_status_t HSA_API hsa_amd_profiling_convert_tick_to_system_domain(hsa_agent_t agent, uint64_t agent_tick, uint64_t *system_tick)
Computes the frequency ratio and offset between the agent clock and HSA system clock and converts the...
hsa_status_t hsa_amd_vmem_handle_release(hsa_amd_vmem_alloc_handle_t memory_handle)
Release a virtual memory handle.
hsa_amd_link_info_type_t
Properties of the relationship between an agent a memory pool.
Definition hsa_ext_amd.h:1488
@ HSA_AMD_LINK_INFO_TYPE_XGMI
Definition hsa_ext_amd.h:1512
@ HSA_AMD_LINK_INFO_TYPE_INFINBAND
Definition hsa_ext_amd.h:1507
@ HSA_AMD_LINK_INFO_TYPE_PCIE
Definition hsa_ext_amd.h:1502
@ HSA_AMD_LINK_INFO_TYPE_QPI
Definition hsa_ext_amd.h:1497
@ HSA_AMD_LINK_INFO_TYPE_HYPERTRANSPORT
Definition hsa_ext_amd.h:1492
hsa_status_t HSA_API hsa_amd_ipc_signal_attach(const hsa_amd_ipc_signal_t *handle, hsa_signal_t *signal)
Imports an IPC capable signal into the local process. If an IPC signal handle is attached multiple ti...
hsa_status_t hsa_amd_signal_value_pointer(hsa_signal_t signal, volatile hsa_signal_value_t **value_ptr)
Returns a pointer to the value of a signal.
AMD barrier value packet. Halts packet processing and waits for (signal_value & mask) cond value to b...
Definition hsa_ext_amd.h:131
hsa_amd_vendor_packet_header_t header
Definition hsa_ext_amd.h:135
uint32_t reserved1
Definition hsa_ext_amd.h:167
hsa_signal_value_t mask
Definition hsa_ext_amd.h:157
uint64_t reserved2
Definition hsa_ext_amd.h:172
hsa_signal_value_t value
Definition hsa_ext_amd.h:152
hsa_signal_condition32_t cond
Definition hsa_ext_amd.h:162
hsa_signal_t completion_signal
Definition hsa_ext_amd.h:183
uint64_t reserved3
Definition hsa_ext_amd.h:177
hsa_signal_t signal
Definition hsa_ext_amd.h:147
uint32_t reserved0
Definition hsa_ext_amd.h:140
AMD GPU event data passed to event handler.
Definition hsa_ext_amd.h:2366
hsa_amd_event_type_t event_type
Definition hsa_ext_amd.h:2370
hsa_amd_gpu_hw_exception_info_t hw_exception
Definition hsa_ext_amd.h:2379
hsa_amd_gpu_memory_fault_info_t memory_fault
Definition hsa_ext_amd.h:2375
AMD GPU HW Exception event data.
Definition hsa_ext_amd.h:2354
hsa_agent_t agent
Definition hsa_ext_amd.h:2358
hsa_amd_hw_exception_reset_type_t reset_type
Definition hsa_ext_amd.h:2359
hsa_amd_hw_exception_reset_cause_t reset_cause
Definition hsa_ext_amd.h:2360
AMD GPU memory fault event data.
Definition hsa_ext_amd.h:2317
uint32_t fault_reason_mask
Definition hsa_ext_amd.h:2330
hsa_agent_t agent
Definition hsa_ext_amd.h:2321
uint64_t virtual_address
Definition hsa_ext_amd.h:2325
Definition hsa_ext_amd.h:471
uint32_t * HDP_MEM_FLUSH_CNTL
Definition hsa_ext_amd.h:472
uint32_t * HDP_REG_FLUSH_CNTL
Definition hsa_ext_amd.h:473
Encodes an opaque vendor specific image format. The length of data depends on the underlying format....
Definition hsa_ext_amd.h:1932
uint32_t deviceID
Definition hsa_ext_amd.h:1941
uint32_t version
Definition hsa_ext_amd.h:1936
256-bit process independent identifier for a ROCr shared memory allocation.
Definition hsa_ext_amd.h:2133
Definition hsa_ext_amd.h:2995
hsa_access_permission_t permissions
Definition hsa_ext_amd.h:2996
hsa_agent_t agent_handle
Definition hsa_ext_amd.h:2997
A memory pool encapsulates physical storage on an agent along with a memory access model.
Definition hsa_ext_amd.h:1052
uint64_t handle
Definition hsa_ext_amd.h:1056
Describes a memory allocation known to ROCr. Within a ROCr major version this structure can only grow...
Definition hsa_ext_amd.h:2017
void * userData
Definition hsa_ext_amd.h:2049
uint32_t size
Definition hsa_ext_amd.h:2025
void * agentBaseAddress
Definition hsa_ext_amd.h:2034
hsa_agent_t agentOwner
Definition hsa_ext_amd.h:2058
uint32_t global_flags
Definition hsa_ext_amd.h:2064
hsa_amd_pointer_type_t type
Definition hsa_ext_amd.h:2029
void * hostBaseAddress
Definition hsa_ext_amd.h:2039
size_t sizeInBytes
Definition hsa_ext_amd.h:2044
Structure containing profiling async copy time information.
Definition hsa_ext_amd.h:579
uint64_t end
Definition hsa_ext_amd.h:587
uint64_t start
Definition hsa_ext_amd.h:583
Structure containing profiling dispatch time information.
Definition hsa_ext_amd.h:562
uint64_t end
Definition hsa_ext_amd.h:570
uint64_t start
Definition hsa_ext_amd.h:566
Definition hsa_ext_amd.h:2594
uint64_t value
Definition hsa_ext_amd.h:2599
uint64_t attribute
Definition hsa_ext_amd.h:2596
AMD vendor specific AQL packet header.
Definition hsa_ext_amd.h:108
hsa_amd_packet_type8_t AmdFormat
Definition hsa_ext_amd.h:118
uint16_t header
Definition hsa_ext_amd.h:113
uint8_t reserved
Definition hsa_ext_amd.h:123
Struct containing an opaque handle to a memory allocation handle.
Definition hsa_ext_amd.h:2898
uint64_t handle
Definition hsa_ext_amd.h:2903
Definition hsa_ext_amd.h:1432
size_t slice
Definition hsa_ext_amd.h:1435
void * base
Definition hsa_ext_amd.h:1433
size_t pitch
Definition hsa_ext_amd.h:1434